|
16 | 16 |
|
17 | 17 | - name: Ensure directories are present |
18 | 18 | ansible.builtin.file: |
19 | | - path: "{{ cifmw_os_must_gather_output_dir }}/{{ item }}" |
| 19 | + path: "{{ cifmw_os_must_gather_output_dir }}/logs/openstack-k8s-operators-openstack-must-gather" |
20 | 20 | state: directory |
21 | 21 | mode: "0755" |
22 | | - loop: |
23 | | - - logs |
24 | 22 |
|
25 | 23 | - name: Construct project change list |
26 | 24 | ansible.builtin.set_fact: |
|
65 | 63 | oc adm must-gather --image {{ cifmw_os_must_gather_image }} |
66 | 64 | --timeout {{ cifmw_os_must_gather_timeout }} |
67 | 65 | --host-network={{ cifmw_os_must_gather_host_network }} |
68 | | - --dest-dir {{ cifmw_os_must_gather_output_dir }}/logs |
| 66 | + --dest-dir {{ cifmw_os_must_gather_output_dir }}/logs/openstack-k8s-operators-openstack-must-gather |
69 | 67 | -- ADDITIONAL_NAMESPACES={{ cifmw_os_must_gather_additional_namespaces }} |
70 | 68 | OPENSTACK_DATABASES=$OPENSTACK_DATABASES |
71 | 69 | SOS_EDPM=$SOS_EDPM |
72 | 70 | SOS_DECOMPRESS=$SOS_DECOMPRESS |
73 | | - gather &> {{ cifmw_os_must_gather_output_dir }}/logs/os_must_gather.log |
74 | | -
|
75 | | - # directory name will be generated starting from cifmw_os_must_gather_image |
76 | | - # variable e.g.: |
77 | | - # EXAMPLE 1 |
78 | | - # original value: "quay.io/openstack-k8s-operators/openstack-must-gather:latest" |
79 | | - # pattern value: "quay-io-openstack-k8s-operators-openstack-must-gather*" |
80 | | - # EXAMPLE 2 |
81 | | - # original value: "foo.bar.example.com/repofoo/openstack-must-gather-rhel9:1.0.0" |
82 | | - # patterns value: "foo-bar-example-com-repofoo-openstack-must-gather-rhel9*" |
83 | | - # TODO: add molecule testing |
84 | | - - name: Get exact must-gather output folder name |
85 | | - ansible.builtin.find: |
86 | | - paths: "{{ cifmw_os_must_gather_output_dir }}/logs" |
87 | | - patterns: >- |
88 | | - {{ |
89 | | - cifmw_os_must_gather_image | |
90 | | - ansible.builtin.split(':') | |
91 | | - first | |
92 | | - ansible.builtin.regex_replace('([.]|[/])', '-') ~ '*' |
93 | | - }} |
94 | | - file_type: directory |
95 | | - register: _must_gather_output_folder |
96 | | - |
97 | | - - name: Move must-gather folder name to a fixed name |
98 | | - ansible.builtin.command: |
99 | | - cmd: > |
100 | | - mv "{{ _must_gather_output_folder.files[0].path }}/" |
101 | | - "{{ cifmw_os_must_gather_output_dir }}/logs/openstack-k8s-operators-openstack-must-gather" |
| 71 | + gather &> {{ cifmw_os_must_gather_output_dir }}/logs/openstack-k8s-operators-openstack-must-gather/os_must_gather.log |
102 | 72 |
|
103 | 73 | rescue: |
104 | 74 | - name: Openstack-must-gather failure |
|
0 commit comments