|
1 | 1 | --- |
2 | | -- name: "Pause 60 seconds to wait for MC to be triggered by a resource change" |
3 | | - ansible.builtin.pause: |
4 | | - seconds: 60 |
5 | | - |
6 | | -- name: Wait for MCP to be updated |
| 2 | +- name: "Check if MachineConfigPools exist in the cluster" |
7 | 3 | kubernetes.core.k8s_info: |
8 | 4 | api_version: machineconfiguration.openshift.io/v1 |
9 | 5 | kind: MachineConfigPool |
10 | | - register: _cr_mcp_status |
11 | | - vars: |
12 | | - _cr_status_query: "resources[*].status.conditions[?type=='Updated'].status" |
13 | | - _cr_update_status: "{{ _cr_mcp_status | json_query(_cr_status_query) | flatten | unique }}" |
14 | | - until: |
15 | | - - _cr_mcp_status.resources is defined |
16 | | - - _cr_update_status == ['True'] |
17 | | - retries: "{{ check_wait_retries }}" |
18 | | - delay: "{{ check_wait_delay }}" |
| 6 | + register: _cr_mcp_check |
| 7 | + no_log: true |
| 8 | + |
| 9 | +- name: "Wait for MCP updates" |
| 10 | + when: |
| 11 | + - _cr_mcp_check.resources is defined |
| 12 | + - _cr_mcp_check.resources | length > 0 |
| 13 | + block: |
| 14 | + - name: "Pause 60 seconds to wait for MC to be triggered by a resource change" |
| 15 | + ansible.builtin.pause: |
| 16 | + seconds: 60 |
| 17 | + |
| 18 | + - name: Wait for MCP to be updated |
| 19 | + kubernetes.core.k8s_info: |
| 20 | + api_version: machineconfiguration.openshift.io/v1 |
| 21 | + kind: MachineConfigPool |
| 22 | + register: _cr_mcp_status |
| 23 | + vars: |
| 24 | + _cr_status_query: "resources[*].status.conditions[?type=='Updated'].status" |
| 25 | + _cr_update_status: "{{ _cr_mcp_status | json_query(_cr_status_query) | flatten | unique }}" |
| 26 | + until: |
| 27 | + - _cr_mcp_status.resources is defined |
| 28 | + - _cr_update_status == ['True'] |
| 29 | + retries: "{{ check_wait_retries }}" |
| 30 | + delay: "{{ check_wait_delay }}" |
19 | 31 |
|
20 | 32 | ... |
0 commit comments