Execute commands only when file has changed

Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
Knut Ahlers 2018-08-30 23:16:23 +02:00
parent 2dbeaba57b
commit 79f9d05b1a
Signed by: luzifer
GPG key ID: DC2729FDD34BE99E

View file

@ -29,9 +29,10 @@
src: '{{ item.src | default(omit) }}' src: '{{ item.src | default(omit) }}'
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
- name: Execute post-command - name: Execute post-command
command: '{{ item.post_command }}' command: '{{ item.post_command }}'
when: item.post_command is defined when: item.post_command is defined and simplefile_write_file.changed
... ...