From 6e4f34885db4d44372cb824186024b9cec560a11 Mon Sep 17 00:00:00 2001 From: Alan Rominger Date: Tue, 5 Oct 2021 14:52:22 -0400 Subject: [PATCH 1/2] Add a playbook that will sleep and then write --- sleep_then_write.yml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 sleep_then_write.yml diff --git a/sleep_then_write.yml b/sleep_then_write.yml new file mode 100644 index 0000000000..38a5c8181f --- /dev/null +++ b/sleep_then_write.yml @@ -0,0 +1,18 @@ +--- + +- name: Sleep for a certain amount of time and then write a file for verification + hosts: localhost + gather_facts: false + vars: + sleep_interval: 30 + test_content: Test string + file_path: /tmp/test_ansible_write + + tasks: + - name: sleep for a specified interval + command: sleep '{{ sleep_interval }}' + + - name: write content to a file + copy: + content: "{{ test_content }}" + dest: "{{ file_path }}" From 6e2122821e0da1253a494b9701035a703682ce07 Mon Sep 17 00:00:00 2001 From: Alan Rominger Date: Tue, 5 Oct 2021 15:16:05 -0400 Subject: [PATCH 2/2] Add another sleep, I guess this is really hacky --- sleep_then_write.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sleep_then_write.yml b/sleep_then_write.yml index 38a5c8181f..70888ca4d4 100644 --- a/sleep_then_write.yml +++ b/sleep_then_write.yml @@ -16,3 +16,6 @@ copy: content: "{{ test_content }}" dest: "{{ file_path }}" + + - name: sleep for a the same specified interval to allow checking stuff + command: sleep '{{ sleep_interval }}'