我找到了找到ansible模块Ansible - 否定过滤
- find:
paths: "/"
patterns: ["*.service"]
file_type: file
hidden: True
recurse: yes
register: find_results
when: ansible_service_mgr == "systemd"
现在我要检查修改某些文件的权限一些文件:
- file:
path: "{{ item.path }}"
owner: root
group: root
mode: 0644
with_items:
- "{{ find_results.files }}"
when:
- item.path | match("/sys/devices/power/events/*")
- ansible_service_mgr == "systemd"
的问题是,我不不想要比赛。我想要所有不符合该路径的东西?
我怎么能否定匹配过滤器? (!,不等)?
所以你需要通过投票的答案,如果有帮助的感谢,并接受的答案,如果它是正确的。 – BMW