我想在/etc/nginx/conf.d
创建或修改目录中的任何文件时重新启动nginx服务.
该目录中有许多文件,而不是指定特定文件,我想观察所有更改.
我试过这个:
nginx: pkg.installed: - name: nginx service: - running - enable: True - restart: True - watch: - file: /etc/nginx/nginx.conf - file: /etc/nginx/conf.d - pkg: nginx
但这条线- file: /etc/nginx/conf.d
并没有做我想要的.
这是错误:
ID: nginx Function: service.running Result: False Comment: The following requisites were not found: watch: file: /etc/nginx/conf.d Changes:
我也尝试了许多变化,包括尾部斜线,但它们都不起作用.
应该- file: /etc/nginx/conf.d/
改变什么?