From a9f7ffc3fead4607cfded29f781e98467da57f35 Mon Sep 17 00:00:00 2001 From: Josh Patterson Date: Tue, 15 Sep 2026 13:10:33 -0400 Subject: [PATCH] FIX: validate MAINIP without so-common during setup setup runs so-minion -o=setup before /usr/sbin/so-common is installed, so valid_ip4 was undefined, every MAINIP was rejected, and no minion pillar was written. Pillar compile then failed for the new manager and setup gave up waiting for the salt master. Use an inline IPv4 regex instead. --- salt/manager/tools/sbin/so-minion | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/salt/manager/tools/sbin/so-minion b/salt/manager/tools/sbin/so-minion index 34bb6f8b1..cbae05652 100755 --- a/salt/manager/tools/sbin/so-minion +++ b/salt/manager/tools/sbin/so-minion @@ -1078,6 +1078,9 @@ function updateMineAndApplyStates() { # Values end up in a Jinja-rendered pillar and in bash, and may come from the minion function validate_minion_vars() { local error_msg="" + # Inline rather than valid_ip4: so-common is not installed yet when setup runs -o=setup + local octet='(25[0-5]|2[0-4][0-9]|1?[0-9]?[0-9])' + local ip4_re="^($octet\.){3}$octet$" case "$NODETYPE" in EVAL|STANDALONE|MANAGER|MANAGERSEARCH|MANAGERHYPE|IMPORT) @@ -1092,7 +1095,7 @@ function validate_minion_vars() { esac if [[ -z "$error_msg" ]]; then - if ! valid_ip4 "$MAINIP"; then + if [[ ! "$MAINIP" =~ $ip4_re ]]; then error_msg="Invalid MAINIP: ${MAINIP:0:64}" elif [[ ! "$MNIC" =~ ^[A-Za-z0-9._-]*$ ]]; then error_msg="Invalid MNIC: ${MNIC:0:64}"