Created
April 30, 2020 11:58
-
-
Save deniszh/d9a09f469eb66496972114cfff6ab3a8 to your computer and use it in GitHub Desktop.
How to patch Salt by salt
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
{% if grains.saltversion == "2016.11.6" %} | |
# Just in case there is no patch command installed | |
patch: | |
pkg.installed | |
# We use directory name here (saltpath) to apply patches that touch multiple files | |
saltmaster_security_patch: | |
file.patch: | |
- name: '{{ grains.saltpath }}' | |
- source: salt://saltstack/files/salt-2016.11-security.patch | |
- strip: 2 | |
- require: | |
- pkg: patch | |
# Restart salt master after the patch is applied | |
restart_salt_master: | |
cmd.run: | |
- name: 'salt-call service.restart salt-master' | |
- bg: true | |
- onchanges: | |
- file: saltmaster_security_patch | |
{%- endif %} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment