openstack-ansible-ops/elements/slow-network/post-install.d/50-modules
Matthew Thode 1602871952
change the phase we run post-install.d actions
It's generally not a good idea to use the last phase if you can help it.

Change-Id: If815aa0438c1eed3a71c0d94544c18520351753b
2017-11-28 10:42:44 -06:00

20 lines
719 B
Bash
Executable File

#!/bin/bash
if [ ${DIB_DEBUG_TRACE:-0} -gt 0 ]; then
set -x
fi
set -eu
set -o pipefail
# If the file /etc/sysconfig/network exists, set some options to make dhcp happy happy happy
if [ -e "/etc/sysconfig/network" ] ; then
# Give some time for the link to come up before configuring via dhcp
grep -v -q '^LINKDELAY' /etc/sysconfig/network && echo "LINKDELAY=${NETWORK_TIMEOUT}" >> /etc/sysconfig/network
# Persistently try to gain a dhcp address
grep -v -q '^PERSISTENT_DHCLIENT' /etc/sysconfig/network && echo 'PERSISTENT_DHCLIENT=yes' >> /etc/sysconfig/network
# since we are running on centos only no need to gate this behind an if statement
systemctl enable NetworkManager.service
fi