Skip to content

Conversation

@jordimassaguerpla
Copy link
Contributor

What does this PR change?

Only remove only salt-client if this is a server.

Otherwise, remove all salt packages.

This reverts commit 59104d3 and adds a "is server" case.

Otherwise, remove all salt packages.

This reverts commit 59104d3 and adds a
"is server" case.

s

Signed-off-by: Jordi Massaguer Pla <[email protected]>
@jordimassaguerpla jordimassaguerpla requested a review from meaksh June 14, 2023 11:39
elif [[ "$INSTALLER" == "apt" ]]; then
apt-get --yes purge salt-common > /dev/null 2>&1 ||:
if [[ "$SERVER" == "true" ]];then
apt-get --yes purge salt-client > /dev/null 2>&1 ||:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it should be salt-minion here, right?

Suggested change
apt-get --yes purge salt-client > /dev/null 2>&1 ||:
apt-get --yes purge salt-minion > /dev/null 2>&1 ||:

INSTALL_SALT_BUNDLE=$(${SALT_CALL} --local --log-level=quiet --output=txt grains.get install_salt_bundle)
SERVER=false
ROLES=$(${SALT_CALL} --local --log-level=quiet --output=txt grains.get roles)
if [[ "${ROLES}" == "local: ['server']" ]];then
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The roles variable is a actually a list, so in principle it could accept multiple values and therefore this comparision would fail.

Maybe something like:

Suggested change
if [[ "${ROLES}" == "local: ['server']" ]];then
if [[ "${ROLES}" == *"'server'"* ]];then

What do you think?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants