From d5a462f09958bcaf408ecd9ba220dc092fe0f4a0 Mon Sep 17 00:00:00 2001 From: Vladimir Kozhukalov Date: Wed, 1 Apr 2015 19:59:53 +0300 Subject: [PATCH] IBP: fixed configuring admin interface for centos Change-Id: Ibb0123ceb9a05cb5bd8db1a4f44d51cc92bbe2fa Closes-Bug: #1439150 --- cloud-init-templates/boothook_centos.jinja2 | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/cloud-init-templates/boothook_centos.jinja2 b/cloud-init-templates/boothook_centos.jinja2 index 13f5ab3..bebae82 100644 --- a/cloud-init-templates/boothook_centos.jinja2 +++ b/cloud-init-templates/boothook_centos.jinja2 @@ -23,9 +23,7 @@ cloud-init-per instance udev_persistent_net1 service network stop ADMIN_MAC={{ common.admin_mac }} ADMIN_IF=$(echo {{ common.udevrules }} | sed 's/[,=]/\n/g' | grep "$ADMIN_MAC" | cut -d_ -f2 | head -1) -if [ ! -z "$(grep $ADMIN_IF /etc/sysconfig/network-scripts/ifcfg-$ADMIN_IF | grep dhcp)" ] ; then - echo -e "# FROM COBBLER SNIPPET\nDEVICE=$ADMIN_IF\nIPADDR={{ common.admin_ip }}\nNETMASK={{ common.admin_mask }}\nBOOTPROTO=none\nONBOOT=yes\nUSERCTL=no\n" > /etc/sysconfig/network-scripts/ifcfg-"$ADMIN_IF" -fi +cloud-init-per instance configure_admin_interface /bin/sh -c "echo -e \"# FROM COBBLER SNIPPET\nDEVICE=$ADMIN_IF\nIPADDR={{ common.admin_ip }}\nNETMASK={{ common.admin_mask }}\nBOOTPROTO=none\nONBOOT=yes\nUSERCTL=no\n\" | tee /etc/sysconfig/network-scripts/ifcfg-$ADMIN_IF" cloud-init-per instance set_gateway /bin/sh -c 'echo GATEWAY="{{ common.gw }}" | tee -a /etc/sysconfig/network'