From ec3be7ff90bbfd929858a1a0bf3ca2c809bd265a Mon Sep 17 00:00:00 2001 From: Michael Prokop Date: Wed, 26 Sep 2012 20:36:40 +0000 Subject: [PATCH] deployment: also retrieve /etc/hosts through mgmt REST API From: Michael Prokop --- deployment.sh | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/deployment.sh b/deployment.sh index 9f4c9ed..6b5f24c 100755 --- a/deployment.sh +++ b/deployment.sh @@ -48,7 +48,7 @@ DHCP=false LOGO=true BONDING=false VLAN=false -RETRIEVE_NETWORK_CONFIG=false +RETRIEVE_MGMT_CONFIG=false LINUX_HA3=false TRUNK_VERSION=false DEBIAN_RELEASE=squeeze @@ -172,7 +172,7 @@ fi if checkBootParam ngcpmgmt ; then MANAGEMENT_IP=$(getBootParam ngcpmgmt) - RETRIEVE_NETWORK_CONFIG=true + RETRIEVE_MGMT_CONFIG=true fi if checkBootParam ngcptrunk ; then @@ -823,6 +823,12 @@ ff02::1 ip6-allnodes ff02::2 ip6-allrouters EOF +# needed for carrier +if "$RETRIEVE_MGMT_CONFIG" ; then + echo "Retrieving /etc/hosts configuration from management server" + wget --timeout=30 -O "$TARGET/etc/hosts" "${MANAGEMENT_IP}:3000/hostconfig/$(cat ${TARGET}/etc/hostname)" +fi + if "$PRO_EDITION" ; then if [ -n "$CROLE" ] ; then echo "Writing $CROLE to /etc/ngcp_ha_role" @@ -858,7 +864,7 @@ fi # needs to be executed *after* udev rules have been set up, # otherwise we get duplicated MAC address<->device name mappings -if "$RETRIEVE_NETWORK_CONFIG" ; then +if "$RETRIEVE_MGMT_CONFIG" ; then echo "Retrieving network configuration from management server" wget --timeout=30 -O /etc/network/interfaces "${MANAGEMENT_IP}:3000/nwconfig/$(cat ${TARGET}/etc/hostname)" @@ -1110,7 +1116,7 @@ cat > $TARGET/etc/hostname << EOF ${TARGET_HOSTNAME} EOF -if "$RETRIEVE_NETWORK_CONFIG" ; then +if "$RETRIEVE_MGMT_CONFIG" ; then echo "Nothing to do, /etc/network/interfaces was already set up." elif "$DHCP" ; then cat > $TARGET/etc/network/interfaces << EOF