Reorder ifup interfaces and modifying /etc/resolv.conf
With day01 image, /etc/resolv.conf gets wrong IPs for nameservers
if modified before ifdown/ifup ens3
Change-Id: Ib30887735ad5d4e48da1ab9bb34fba39d0ceec03
diff --git a/tcp_tests/templates/mcp-local-aptly/underlay--user-data-apt01.yaml b/tcp_tests/templates/mcp-local-aptly/underlay--user-data-apt01.yaml
index 1cf30bd..adc7942 100644
--- a/tcp_tests/templates/mcp-local-aptly/underlay--user-data-apt01.yaml
+++ b/tcp_tests/templates/mcp-local-aptly/underlay--user-data-apt01.yaml
@@ -27,6 +27,10 @@
all: '| tee -a /var/log/cloud-init-output.log /dev/tty0'
runcmd:
+ # Prepare network connection
+ - sudo ifup ens3
+ #- sudo route add default gw {gateway} {interface_name}
+
- rm /etc/resolv.conf
- touch /etc/resolv.conf
- export LOCAL_DNS_IP=$(ifconfig ens3 | grep "inet addr" | cut -d ':' -f 2 | cut -d ' ' -f 1)
@@ -37,9 +41,6 @@
- export TERM=linux
- export LANG=C
- # Prepare network connection
- - sudo ifup ens3
- #- sudo route add default gw {gateway} {interface_name}
# Create swap
- fallocate -l 4G /swapfile