fix unidempotent task

This commit is contained in:
Sergey Malyuk
2025-12-24 11:28:36 +03:00
parent 29b28edc82
commit d72a570783

View File

@@ -6,12 +6,19 @@
update_cache: true
cache_valid_time: 3600
- name: Touch /etc/projects and /etc/projid
- name: Check files
loop:
- /etc/projects
- /etc/projid
ansible.builtin.file:
ansible.builtin.stat:
path: "{{ item }}"
register: proj_files
- name: Create missing files
loop: "{{ proj_files.results }}"
when: not item.stat.exists
ansible.builtin.file:
path: "{{ item.invocation.module_args.path }}"
state: touch
owner: root
group: root