[ACCEPTED]-SaltStack: In a watch statement, how do I specify a directory where all files should be watched?-salt-stack
Accepted answer
I'm using a glob for matching:
file: /etc/nginx/conf.d/*
Here's the 7 corrected snippet:
nginx:
pkg.installed:
- name: nginx
service:
- running
- enable: True
- restart: True
- watch:
- file: /etc/nginx/nginx.conf
- file: /etc/nginx/conf.d/*
- pkg: nginx
Also do note that salt 6 can only watch other states that are already 5 specified in your state file, so it will 4 only watch files that are managed by salt 3 itself.
If this doesn't work for you, then 2 try to refer the following link for a different 1 solution: http://intothesaltmine.org/blog/html/2012/12/18/using_watch_with_file_recurse.html
According to issue 663 closed in February 2012, a 1 watch on /path/*
should watch recursively.
Source:
stackoverflow.com
More Related questions
Cookie Warning
We use cookies to improve the performance of the site. By staying on our site, you agree to the terms of use of cookies.