Example from: https://docs.saltstack.com/en/latest/topics/tutorials/states_pt2.html
/etc/httpd/extra/httpd-vhosts.conf:
file.managed:
- source: salt://webserver/httpd-vhosts.conf
apache:
pkg.installed: []
service.running:
- watch:
- file: /etc/httpd/extra/httpd-vhosts.conf
- require:
- pkg: apache
Is there a way to inject a "watch"?
I manage a file for apache in an optional module.
The service.running
is already in the main part, which is installed on all hosts.
How can I tell apache to restart if the optional module was changed?
I want strict separation in my salt files: The main part does not know the optional module.
I hope you understand me. If not, please leave a comment. Thank you.