From 79f9d05b1aaf9f38b672ec470a0751d79f7a4161 Mon Sep 17 00:00:00 2001 From: Knut Ahlers Date: Thu, 30 Aug 2018 23:16:23 +0200 Subject: [PATCH] Execute commands only when file has changed Signed-off-by: Knut Ahlers --- tasks/inner.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tasks/inner.yml b/tasks/inner.yml index 408d61e..0fdd917 100644 --- a/tasks/inner.yml +++ b/tasks/inner.yml @@ -29,9 +29,10 @@ src: '{{ item.src | default(omit) }}' unsafe_writes: '{{ item.unsafe_writes | default(omit) }}' validate: '{{ item.validate | default(omit) }}' + register: simplefile_write_file - name: Execute post-command command: '{{ item.post_command }}' - when: item.post_command is defined + when: item.post_command is defined and simplefile_write_file.changed ...