Skip to content

Instantly share code, notes, and snippets.

@jfindlay
Last active May 1, 2019 18:46
Show Gist options
  • Save jfindlay/cacfda0c6657a0ca13028b7c4c545671 to your computer and use it in GitHub Desktop.
Save jfindlay/cacfda0c6657a0ca13028b7c4c545671 to your computer and use it in GitHub Desktop.
Equivalent of `service.running`+`watch`
# Watch version
my-file-watch:
file.managed:
- name: /etc/file.conf
- source: salt://file.conf
my-service-watch:
service.running:
- name: my-service
- watch:
- file: my-file-watch
# Require+onchanges version: requires (hah) `use_superseded: [module.run]` in minion config
my-file-onchanges:
file.managed:
- name: /etc/file.conf
- source: salt://file.conf
my-service-onchanges:
service.running:
- name: my-service
- require:
- file: my-file-watch
module.run:
- service.reload:
- my-service
- require:
- file: my-file-onchanges
- onchanges:
- file: my-file-onchanges
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment