tester0
tester0

Reputation: 11

unattended update without questions (saltstack)

How to correctly update hosts in saltstack?

cmd.run "apt update && apt upgrade -y"

sometimes asks confirmation to overwrite config files with new version, how automatically preserve the current config file? "Y/N"

or

there are better way to update entire system via salt-stack?

Upvotes: 1

Views: 668

Answers (2)

gtmanfred
gtmanfred

Reputation: 593

You can use the pkg.upgrade module, or you could schedule a pkg.uptodate state.

https://docs.saltstack.com/en/latest/ref/states/all/salt.states.pkg.html#salt.states.pkg.uptodate

And use the salt scheduler to run it periodically.

https://docs.saltstack.com/en/latest/topics/jobs/#scheduling-jobs

Upvotes: 0

dahrens
dahrens

Reputation: 3959

There is the pkg module. Use it like that:

salt '*' pkg.upgrade --refresh=True

Upvotes: 2

Related Questions