Reputation: 11
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
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
Reputation: 3959
There is the pkg module. Use it like that:
salt '*' pkg.upgrade --refresh=True
Upvotes: 2