Remove containers' list file.

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 procedure).

Change-Id: I65c7b61ab1c472b2eb68530ca8246297cb1c14bc
This commit is contained in:
Julia Marciano 2023-11-29 02:58:07 +02:00 committed by Julia Mariano
parent 69bfc9cbbe
commit d6dde5a7a6
2 changed files with 23 additions and 0 deletions

View File

@ -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

View File

@ -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