I would like the nginx service to restart whenever any file in the /etc/nginx/conf.d
directory is created or modified.
There are a number of files in that directory, and rather than specifying particular files, I would like to watch for all changes.
I've tried this:
nginx:
pkg.installed:
- name: nginx
service:
- running
- enable: True
- restart: True
- watch:
- file: /etc/nginx/nginx.conf
- file: /etc/nginx/conf.d
- pkg: nginx
but the line - file: /etc/nginx/conf.d
is not doing what I want.
This is the error:
ID: nginx
Function: service.running
Result: False
Comment: The following requisites were not found:
watch:
file: /etc/nginx/conf.d
Changes:
I've also tried a number of variations including a trailing slash, but none of them work.
What should - file: /etc/nginx/conf.d/
be changed to?