Skip to content

Instantly share code, notes, and snippets.

@asteriskie
Created May 2, 2016 19:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save asteriskie/4f49976241ce2cdd591e58db4f0e879a to your computer and use it in GitHub Desktop.
Save asteriskie/4f49976241ce2cdd591e58db4f0e879a to your computer and use it in GitHub Desktop.
On salt master:
/etc/salt/master.d/reactor.conf
----------------------------------------------------------------------
reactor:
- 'salt/beacon/<hostnamehere>/inotify//etc/rsyslog.d/server.conf':
- salt://reactor/restorefiles.sls
----------------------------------------------------------------------
Within Git:
/reactor/restorefiles.sls
----------------------------------------------------------------------
{% if data['data']['path'] == '/etc/rsyslog.d/server.conf' %}
restore rsylog configuration:
local.state.sls:
- tgt: {{ data['data']['id'] }}
- arg:
- rSyslog
{% endif %}
----------------------------------------------------------------------
@asteriskie
Copy link
Author

Output of a test run of modifying the file and watching the event.

salt/beacon/hostnamehere/inotify//etc/rsyslog.d/server.conf {
"_stamp": "2016-05-02T19:57:42.707042",
"data": {
"change": "IN_MODIFY",
"id": "hostnamehere",
"path": "/etc/rsyslog.d/server.conf"
},
"tag": "salt/beacon/hostnamehere/inotify//etc/rsyslog.d/server.conf"
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment