Skip to content

Commit

Permalink
Reboot CRC host in crc-cloud after attaching interfaces; port patches
Browse files Browse the repository at this point in the history
The network interfaces were not available, so it is breaking the CI
tests if they are not available.
Also apply patches [1][2] related to the machineconfigpool.

[1] https://review.rdoproject.org/r/c/config/+/53694
[2] https://review.rdoproject.org/r/c/config/+/53729

Change-Id: Ie98da4e61508303c411203a9190647fae56ae1d7
  • Loading branch information
danpawlik committed Jul 8, 2024
1 parent df727cf commit 555ddb1
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 1 deletion.
14 changes: 13 additions & 1 deletion roles/prepare-crc-cloud/tasks/machineconfigpool.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,17 @@
- worker
changed_when: false

- name: Get node name
ansible.builtin.shell: |
oc get nodes --no-headers | awk '{print $1}'
register: _crc_node
changed_when: false
tags:
- skip_ansible_lint

- name: Patch node
ansible.builtin.shell: >
oc patch node crc
oc patch node {{ _crc_node.stdout }}
--type merge
-p '{"metadata": {"annotations": {"machineconfiguration.openshift.io/{{ item }}": null }}}'
loop:
Expand Down Expand Up @@ -65,3 +73,7 @@
register: _worker_status
until: _worker_status.stdout | int == 0
changed_when: false

- name: Print current machineconfigpool
ansible.builtin.command: oc get machineconfigpool
changed_when: false
3 changes: 3 additions & 0 deletions roles/prepare-crc-cloud/tasks/main.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
---
- name: Reboot CRC host to get the network interfaces
ansible.builtin.include_tasks: reboot_crc.yaml

- name: Prepare for executing crc-cloud
ansible.builtin.include_tasks: pre.yaml

Expand Down
9 changes: 9 additions & 0 deletions roles/prepare-crc-cloud/tasks/reboot_crc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
- name: Reboot host after adding pull secret and changing kubelet node params
become: true
ansible.builtin.reboot:
reboot_timeout: 900

- name: Start Zuul console after reboot
include_role:
name: start-zuul-console

0 comments on commit 555ddb1

Please sign in to comment.