Linux Saltstack:目录清理,不包括子目录

Linux Saltstack:目录清理,不包括子目录,linux,salt-stack,Linux,Salt Stack,因此,我在nginx/common/init.sls中有以下内容: nginx: pkg: - latest /etc/nginx: file.directory: - user: root - group: root - mode: 755 - clean: True - require: - pkg: nginx /etc/nginx/conf.d: file.recurse: - source: salt:

因此,我在nginx/common/init.sls中有以下内容:

nginx:
  pkg:
    - latest

/etc/nginx:
  file.directory:
    - user: root
    - group: root
    - mode: 755
    - clean: True
    - require:
      - pkg: nginx

/etc/nginx/conf.d:
  file.recurse:
    - source: salt://nginx/common/files/conf.d
    - user: root
    - group: root
    - clean: True
    - template: jinja
    - recurse:
      - user
      - group
      - mode
    - require_in:
      - file: /etc/nginx

/etc/nginx/vhosts.d:
  file.directory:
    - user: root
    - group: root
    - mode: 755
    - makedirs: True
    - require_in:
      - file: /etc/nginx
保持默认配置文件中的/etc/nginx干净,并将我自己的配置种子植入该目录和子目录。当我运行highstate时,它工作正常,但当我使用test=true运行highstate时,它会返回一个通知:

  ID: /etc/nginx
  Function: file.directory
    Result: None
   Comment: The following files will be changed:
      /etc/nginx/conf.d: removed - Removed due to clean
      /etc/nginx/vhosts.d: removed - Removed due to clean
这是不好的,因为阻止我监视“干净”的highstate,实际上是不真实的


我试图在/etc/nginx的“requirer”中添加subdirs,但结果是一样的。我还注意到问题只影响file.directoryfile.recurse,而不影响file.managed。如何防止这种错误的输出?

从我在文档中读到的内容来看,这似乎是它应该提供给您的输出,这不是一个坏输出,这只是我添加的标记test=true works的方式
排除:'E@(conf.d | vhosts.d | htpasswd)
到/etc/nginx状态,它工作,但这似乎是一个丑陋的解决办法。您认为什么可能会覆盖您的nginx配置文件?哪一个?实际上没有文件被覆盖,只有测试运行输出中的注意事项