From 7724fb8f330e474dbc15f1897921f14c88ee5c7d Mon Sep 17 00:00:00 2001 From: Matt Clay Date: Fri, 7 Feb 2020 11:40:08 -0800 Subject: [PATCH] Split handler tasks for setup_remote_tmp_dir. This allows a platform handler to run even when the module required for the other platform is not present. --- .../targets/setup_remote_tmp_dir/handlers/main.yml | 9 ++------- .../setup_remote_tmp_dir/tasks/default-cleanup.yml | 5 +++++ .../setup_remote_tmp_dir/tasks/windows-cleanup.yml | 4 ++++ 3 files changed, 11 insertions(+), 7 deletions(-) create mode 100644 test/integration/targets/setup_remote_tmp_dir/tasks/default-cleanup.yml create mode 100644 test/integration/targets/setup_remote_tmp_dir/tasks/windows-cleanup.yml diff --git a/test/integration/targets/setup_remote_tmp_dir/handlers/main.yml b/test/integration/targets/setup_remote_tmp_dir/handlers/main.yml index 82c9e5ed485..229037c8b22 100644 --- a/test/integration/targets/setup_remote_tmp_dir/handlers/main.yml +++ b/test/integration/targets/setup_remote_tmp_dir/handlers/main.yml @@ -1,10 +1,5 @@ - name: delete temporary directory - file: - path: "{{ remote_tmp_dir }}" - state: absent - no_log: yes + include_tasks: default-cleanup.yml - name: delete temporary directory (windows) - win_file: - path: "{{ remote_tmp_dir }}" - state: absent + include_tasks: windows-cleanup.yml diff --git a/test/integration/targets/setup_remote_tmp_dir/tasks/default-cleanup.yml b/test/integration/targets/setup_remote_tmp_dir/tasks/default-cleanup.yml new file mode 100644 index 00000000000..39872d749f3 --- /dev/null +++ b/test/integration/targets/setup_remote_tmp_dir/tasks/default-cleanup.yml @@ -0,0 +1,5 @@ +- name: delete temporary directory + file: + path: "{{ remote_tmp_dir }}" + state: absent + no_log: yes diff --git a/test/integration/targets/setup_remote_tmp_dir/tasks/windows-cleanup.yml b/test/integration/targets/setup_remote_tmp_dir/tasks/windows-cleanup.yml new file mode 100644 index 00000000000..1936b610b59 --- /dev/null +++ b/test/integration/targets/setup_remote_tmp_dir/tasks/windows-cleanup.yml @@ -0,0 +1,4 @@ +- name: delete temporary directory (windows) + win_file: + path: "{{ remote_tmp_dir }}" + state: absent