Skip to content

Commit f088cbd

Browse files
committed
[cifmw_setup] Fix deploy-edpm.yml crash on unpreprovisioned baremetal computes
The NFS and Ceph plays in deploy-edpm.yml target the computes group with gather_facts enabled (the default). In architecture deployments with preProvisioned=false, compute nodes are bare libvirt domains with no OS until Ironic provisions them during the kustomize_deploy stages. Ansible's implicit fact gathering tries to SSH into these unreachable hosts, aborting the entire playbook before the architecture deployment can run. Add gather_facts: false to both the NFS and Ceph plays. For the NFS play, insert an end_play guard when cifmw_architecture_scenario is defined and move fact gathering after that guard. The Ceph play already had an end_play guard but Ansible was crashing on fact gathering before reaching it. Similarly, the "Fetch network facts" task in deploy_architecture.yml delegates setup to every host in the inventory, including unprovisioned computes. Skip computes when cifmw_edpm_deploy_pre_provisioned is false. This fixes all architecture-uni03gamma-deploy-bm-* jobs which have been consistently failing since the deploy-bm variant was introduced. Related-Issue: ANVIL-109 Co-authored-by: Cursor <cursoragent@cursor.com> Signed-off-by: Roberto Alfieri <ralfieri@redhat.com>
1 parent 93e8984 commit f088cbd

2 files changed

Lines changed: 15 additions & 2 deletions

File tree

deploy-edpm.yml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,21 +87,30 @@
8787

8888
- name: Deploy NFS server on target nodes
8989
become: true
90+
gather_facts: false
9091
hosts: "{{ groups[cifmw_nfs_target | default('computes')][0] | default([]) }}"
9192
tasks:
93+
- name: End play early for architecture deploys
94+
when:
95+
- cifmw_architecture_scenario is defined
96+
ansible.builtin.meta: end_play
97+
98+
- name: Gather facts for NFS deployment
99+
ansible.builtin.setup:
100+
92101
- name: Run cifmw_nfs role
93102
vars:
94103
nftables_path: /etc/nftables
95104
nftables_conf: /etc/sysconfig/nftables.conf
96105
when:
97106
- cifmw_edpm_deploy_nfs | default(false) | bool
98-
ansible.builtin.import_role:
107+
ansible.builtin.include_role:
99108
name: cifmw_nfs
100109

101110
- name: Clear ceph target hosts facts to force refreshing in HCI deployments
111+
gather_facts: false
102112
hosts: "{{ cifmw_ceph_target | default('computes') }}"
103113
tasks:
104-
# end_play will end only current play, not the main edpm-deploy.yml
105114
- name: Early end if architecture deploy
106115
when:
107116
- cifmw_architecture_scenario is defined

roles/cifmw_setup/tasks/deploy_architecture.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@
1111
- always
1212
when:
1313
- "not item.startswith('ocp-')"
14+
- >-
15+
(item not in groups.get('computes', []) and
16+
not item.startswith('compute-')) or
17+
(cifmw_edpm_deploy_pre_provisioned | default(true) | bool)
1418
ansible.builtin.setup:
1519
gather_subset: network
1620
delegate_facts: true

0 commit comments

Comments
 (0)