Support file removal

Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
Knut Ahlers 2019-04-12 17:27:53 +02:00
parent ec061b1f92
commit 070080dd86
Signed by: luzifer
GPG key ID: DC2729FDD34BE99E

View file

@ -34,6 +34,13 @@
unsafe_writes: '{{ item.unsafe_writes | default(omit) }}' unsafe_writes: '{{ item.unsafe_writes | default(omit) }}'
validate: '{{ item.validate | default(omit) }}' validate: '{{ item.validate | default(omit) }}'
register: simplefile_write_file register: simplefile_write_file
when: item.state is not defined or item.state != 'absent'
- name: Remove file
file:
dest: '{{ item.dest }}'
state: 'absent'
when: item.state is defined and item.state == 'absent'
- name: Execute post-command - name: Execute post-command
command: '{{ item.post_command }}' command: '{{ item.post_command }}'