fix unidempotent task
This commit is contained in:
@@ -6,12 +6,19 @@
|
|||||||
update_cache: true
|
update_cache: true
|
||||||
cache_valid_time: 3600
|
cache_valid_time: 3600
|
||||||
|
|
||||||
- name: Touch /etc/projects and /etc/projid
|
- name: Check files
|
||||||
loop:
|
loop:
|
||||||
- /etc/projects
|
- /etc/projects
|
||||||
- /etc/projid
|
- /etc/projid
|
||||||
ansible.builtin.file:
|
ansible.builtin.stat:
|
||||||
path: "{{ item }}"
|
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
|
state: touch
|
||||||
owner: root
|
owner: root
|
||||||
group: root
|
group: root
|
||||||
|
|||||||
Reference in New Issue
Block a user