From b60878abdb600dbb9a6d430bf3c076e45be38c87 Mon Sep 17 00:00:00 2001 From: Alex Willmer Date: Tue, 21 May 2024 12:55:48 +0100 Subject: [PATCH] tests: Check behaviour if ansible_remote_tmp is deleted mid-play --- .../integration/context_service/all.yml | 1 + .../context_service/remote_tmp.yml | 26 +++++++++++++++++++ 2 files changed, 27 insertions(+) create mode 100644 tests/ansible/integration/context_service/remote_tmp.yml diff --git a/tests/ansible/integration/context_service/all.yml b/tests/ansible/integration/context_service/all.yml index edcf8eff4..58057da72 100644 --- a/tests/ansible/integration/context_service/all.yml +++ b/tests/ansible/integration/context_service/all.yml @@ -2,3 +2,4 @@ - import_playbook: lru_one_target.yml - import_playbook: reconnection.yml - import_playbook: remote_name.yml +- import_playbook: remote_tmp.yml diff --git a/tests/ansible/integration/context_service/remote_tmp.yml b/tests/ansible/integration/context_service/remote_tmp.yml new file mode 100644 index 000000000..efa92467b --- /dev/null +++ b/tests/ansible/integration/context_service/remote_tmp.yml @@ -0,0 +1,26 @@ +# issue #1061: ensure remote temporary directory is recreated + +- name: integration/context_service/remote_tmp.yml + hosts: test-targets + gather_facts: false + vars: + ansible_remote_tmp: ~/.ansible/remote_tmp_test + tasks: + - name: Exercise ansible_remote_tmp + copy: + dest: canary + mode: u=rw,go= + content: | + Created by integration/context_service/remote_tmp.yml + + - name: Delete ansible_remote_tmp + raw: | + rm -rf "{{ ansible_remote_tmp }}" + + - name: Do something else that requires ansible_remote_tmp + file: + path: canary + state: absent + tags: + - issue_1061 + - remote_tmp