diff --git a/puppet-manifests/src/bin/apply_network_config.sh b/puppet-manifests/src/bin/apply_network_config.sh index a0cb813ec..2a69df102 100755 --- a/puppet-manifests/src/bin/apply_network_config.sh +++ b/puppet-manifests/src/bin/apply_network_config.sh @@ -316,8 +316,13 @@ else parse_interface_stanzas - update_interfaces - update_routes + if [[ ! -f /var/run/.network_upgrade_bootstrap ]]; then + update_interfaces + update_routes + else + log_it "Executing upgrade bootstrap, just add the config files into /etc/network/" + update_config + fi else log_it "Not using sysconfig or ifupdown, cannot advance! Aborting..." diff --git a/puppet-manifests/src/bin/network_ifupdown.sh b/puppet-manifests/src/bin/network_ifupdown.sh index 731c054af..6819424ca 100644 --- a/puppet-manifests/src/bin/network_ifupdown.sh +++ b/puppet-manifests/src/bin/network_ifupdown.sh @@ -626,3 +626,33 @@ function update_routes { do_cp ${PUPPET_ROUTES_FILE} ${ETC_ROUTES_FILE} fi } + +function update_config { + + # process interfaces + auto_puppet=( $(grep -v HEADER ${PUPPET_DIR}/auto) ) + for auto_if in ${auto_puppet[@]:1}; do + cfg="ifcfg-${auto_if}" + do_cp ${PUPPET_DIR}/${cfg} ${ETC_DIR}/${cfg} + done + do_cp ${PUPPET_DIR}/auto ${ETC_DIR}/auto + + # process routes + if [ -f ${PUPPET_ROUTES6_FILE} ]; then + log_it "add IPv6 routes generated in network.pp" + if [ -f ${PUPPET_ROUTES_FILE} ]; then + puppet_data=$(grep -v HEADER ${PUPPET_ROUTES6_FILE}) + while read route6Line; do + route_exists=$( grep -E "${route6Line}" ${PUPPET_ROUTES_FILE} ) + if [ "${route_exists}" == "" ]; then + echo "${route6Line}" >> ${PUPPET_ROUTES_FILE} + fi + done <<< ${puppet_data} + else + cat ${PUPPET_ROUTES6_FILE} >> ${PUPPET_ROUTES_FILE} + fi + fi + if [ -f ${PUPPET_ROUTES_FILE} ]; then + do_cp ${PUPPET_ROUTES_FILE} ${ETC_ROUTES_FILE} + fi +}