Created
May 12, 2017 19:13
-
-
Save asteriskie/6077e01c3f9d1e890bdec2fe726097df to your computer and use it in GitHub Desktop.
saltstack update (could probably be cleaner)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Create Salt Repo - Latest: | |
pkgrepo.managed: | |
- name: salt-latest | |
- humanname: Salt Repo Latest - $releasever/$basearch | |
- baseurl: https://repo.saltstack.com/yum/redhat/$releasever/$basearch/latest | |
- gpgcheck: 1 | |
- enabled: 1 | |
- gpgkey: https://repo.saltstack.com/yum/redhat/$releasever/$basearch/latest/SALTSTACK-GPG-KEY.pub | |
{% if salt['grains.get']('saltversion',{}).split('.')[0] >= '2016' %} | |
pkg.latest: | |
- refresh: True | |
- name: salt-minion | |
- bg: True | |
Salt Upgrade Script: | |
file.missing: | |
- name: /tmp/upgradesalt | |
Enable Salt Minion: | |
service.enabled: | |
- name: salt-minion | |
- onchanges: | |
- pkg: Create Salt Repo - Latest | |
{% else %} | |
Download Salt Minion: | |
cmd.run: | |
- name: | | |
yum install -y --downloaddir=/tmp/saltpkgs --downloadonly salt-minion salt 2>&1 > /dev/null && \ | |
echo 'Packages downloaded to /tmp/saltpkgs manual installation required!' | |
exit 1 | |
{% endif %} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment