Skip to content

Instantly share code, notes, and snippets.

@roaldnefs
Created November 22, 2017 17:21
Show Gist options
  • Save roaldnefs/b2b636c1f6432ccd874551890b26706a to your computer and use it in GitHub Desktop.
Save roaldnefs/b2b636c1f6432ccd874551890b26706a to your computer and use it in GitHub Desktop.
Restart Salt Services via Salt

Restarting the salt-minion:

# Restart salt-minion in the background (on changes only).
salt-minion_restart:
  cmd.run:
    - name: 'salt-call --local service.restart salt-minion'
    - bg: True
    - order: last
    - onchanges:
      - pkg: salt-minion_package
      - file: salt-minion_configuration

Restart the salt-master:

# Restart salt-master in the background (on changes only).
salt-master_restart:
  cmd.run:
    - name: 'salt-call --local service.restart salt-master'
    - bg: True
    - order: last
    - onchanges:
      - pkg: salt-master_packages
      - file: salt-master_configuration
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment