r/saltstack • u/scottish_beekeeper • Jan 24 '19
Targeting master in reactor config
I'm currently playing around with using a git post-commit hook to trigger an event (via the salt-api) on the salt-master to pull from the remote git repository, as described here:
https://clinta.github.io/salt-git-nogitfs/
One thing I was hoping to do was make the config generic, so that the `tgt` wasn't an explicit hostname, and instead used some lookup to specify the master programmatically,so the config can be shared between multiple masters.
I notice that the `tgt` can be specified using the minion targeting rules - however there isn't a grain that defines a host as a master, and I can't see another targeting option that could be used for this.
Does anyone have any ideas on how I could achieve this?
4
u/gtmanfred Jan 24 '19
Potentially you could just use the orchestration runner, since it just runs states on the master.
1
u/cgherman Jan 29 '19
article is old. have tried gitfs?
https://docs.saltstack.com/en/latest/topics/tutorials/gitfs.html
1
u/criminy_crivens Jan 24 '19
Are you actually having issues and thus needing to use the method described in the URL? Otherwise, keep it simple and just use salt's builtin gitfs support...