diff --git a/infrared_plugin/plugin.spec b/infrared_plugin/plugin.spec index 7bc40f49d..234ab632c 100644 --- a/infrared_plugin/plugin.spec +++ b/infrared_plugin/plugin.spec @@ -268,6 +268,14 @@ subparsers: Timeout error is raised if an ubuntu instance is not reachable before it expires ansible_variable: ubuntu_is_reachable_timeout + cleanup-containerlist-file: + type: Bool + help: | + Remove containers-list file (saved during a resource creation + stage) before running a Tobiko second stage, if we expect changes + to the containers list (For example, after the FFU upgrade). + default: False + ansible_variable: cleanup_containerlist_file - title: Cleanup stage diff --git a/infrared_plugin/roles/tobiko-ir-before-run/tasks/main.yaml b/infrared_plugin/roles/tobiko-ir-before-run/tasks/main.yaml index a7bd3a811..52caa3b9f 100644 --- a/infrared_plugin/roles/tobiko-ir-before-run/tasks/main.yaml +++ b/infrared_plugin/roles/tobiko-ir-before-run/tasks/main.yaml @@ -66,3 +66,18 @@ - groups.get("undercloud") - test_host is defined - test_host not in groups.undercloud + +- name: Remove the containers list file, if required + block: + - name: Save the containers list file, if exists + copy: + dest: ~/expected_containers_list_df.old.csv + src: ~/expected_containers_list_df.csv + remote_src: yes + failed_when: false + + - name: Remove the original containers list file + file: + path: ~/expected_containers_list_df.csv + state: absent + when: cleanup_containerlist_file | bool