Skip to content

Commit

Permalink
Remove server keys to allow reregistering to different master (uyuni-…
Browse files Browse the repository at this point in the history
…project#7360)

Co-authored-by: Ondrej Holecek <oholecek@suse.com>
  • Loading branch information
mbussolotto and aaannz authored Aug 4, 2023
1 parent 562077e commit df5084c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
9 changes: 8 additions & 1 deletion spacewalk/certs-tools/rhn_bootstrap_strings.py
Original file line number Diff line number Diff line change
Expand Up @@ -605,7 +605,7 @@ def getRegistrationStackSh():
call_tukit "zypper --non-interactive update {PKG_NAME_VENV_UPDATE} ||:"
fi
else
if [ -z "$SNAPSHOT_ID"]; then
if [ -z "$SNAPSHOT_ID" ]; then
zypper --non-interactive up {PKG_NAME_UPDATE} $RHNLIB_PKG ||:
else
call_tukit "zypper --non-interactive update {PKG_NAME_UPDATE} $RHNLIB_PKG ||:"
Expand Down Expand Up @@ -896,12 +896,14 @@ def getRegistrationSaltSh(productName):
fi
MINION_ID_FILE="${{SNAPSHOT_PREFIX}}/etc/salt/minion_id"
MINION_PKI_CONF="${{SNAPSHOT_PREFIX}}/etc/salt/pki"
MINION_CONFIG_DIR="${{SNAPSHOT_PREFIX}}/etc/salt/minion.d"
SUSEMANAGER_MASTER_FILE="${{MINION_CONFIG_DIR}}/susemanager.conf"
MINION_SERVICE="salt-minion"
if [ $VENV_ENABLED -eq 1 ]; then
MINION_ID_FILE="${{SNAPSHOT_PREFIX}}/etc/venv-salt-minion/minion_id"
MINION_PKI_CONF="${{SNAPSHOT_PREFIX}}/etc/venv-salt-minion/pki"
MINION_CONFIG_DIR="${{SNAPSHOT_PREFIX}}/etc/venv-salt-minion/minion.d"
SUSEMANAGER_MASTER_FILE="${{MINION_CONFIG_DIR}}/susemanager.conf"
MINION_SERVICE="venv-salt-minion"
Expand Down Expand Up @@ -951,6 +953,11 @@ def getRegistrationSaltSh(productName):
SALT_RUNNING: 1
EOF
# Remove old minion keys so reregistration do different master works
if [ -d "$MINION_PKI_CONF" ]; then
rm -r "$MINION_PKI_CONF"
fi
if [ -n "$SNAPSHOT_ID" ]; then
cat <<EOF >> "${{MINION_CONFIG_DIR}}/transactional_update.conf"
# Enable the transactional_update executor
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- Remove server keys to allow reregistering to different master

0 comments on commit df5084c

Please sign in to comment.