[fix] Set variables used by sensor pillar before generating the pillar

This commit is contained in:
William Wernert
2021-01-15 10:29:51 -05:00
parent ed129bcf1f
commit e440f6c44a
2 changed files with 17 additions and 8 deletions

View File

@@ -854,10 +854,8 @@ configure_network_sensor() {
echo "Setting up sensor interface" >> "$setup_log" 2>&1
if [[ $is_cloud ]]; then
INTERFACE=${BNICS[0]}
local nmcli_con_args=( "type" "ethernet" )
else
INTERFACE='bond0'
local nmcli_con_args=( "type" "bond" "mode" "0" )
fi
@@ -1307,6 +1305,22 @@ generate_repo_tarball() {
tar -czf /opt/so/repo/"$SOVERSION".tar.gz ../.
}
generate_sensor_vars() {
# Set the MTU
if [[ $NSMSETUP != 'ADVANCED' ]]; then
if [[ $is_cloud ]]; then MTU=1575; else MTU=1500; fi
fi
export MTU
# Set interface variable
if [[ $is_cloud ]]; then
INTERFACE=${BNICS[0]}
else
INTERFACE='bond0'
fi
export INTERFACE
}
get_redirect() {
whiptail_set_redirect
if [ "$REDIRECTINFO" = "OTHER" ]; then
@@ -2243,12 +2257,6 @@ sensor_pillar() {
local pillar_file=$temp_install_dir/pillar/minions/$MINION_ID.sls
# Set the MTU
if [[ $NSMSETUP != 'ADVANCED' ]]; then
if [[ $is_cloud ]]; then MTU=1575; else MTU=1500; fi
fi
export MTU
# Create the sensor pillar
printf '%s\n'\
"sensor:"\

View File

@@ -575,6 +575,7 @@ set_redirect >> $setup_log 2>&1
if [[ $is_sensor || $is_helix || $is_import ]]; then
set_progress_str 3 'Generating sensor pillar'
generate_sensor_vars
sensor_pillar >> $setup_log 2>&1
if [[ $is_sensor || $is_helix ]]; then
steno_pillar >> $setup_log