Merge "When executing upgrade bootstrap for AIO-SX only update /etc/network/"
This commit is contained in:
commit
ffd09b26de
@ -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..."
|
||||
|
@ -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
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user