Skip to content

Commit ffdfb24

Browse files
committed
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. Architecture deploys handle NFS via a pre_stage hook instead (see the companion nfs-on-computes.yml hook playbook). 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 c6798e9 commit ffdfb24

2 files changed

Lines changed: 38 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
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
---
2+
# Deploy NFS on compute nodes for architecture-based deployments.
3+
#
4+
# In architecture flows with preProvisioned=false (baremetal/Ironic),
5+
# compute nodes are not reachable until the architecture stages
6+
# provision them. The standard NFS play in deploy-edpm.yml runs
7+
# before the architecture stages, so it must be skipped. This hook
8+
# playbook is designed to run as a pre_stage_run or post_stage_run
9+
# hook after the EDPM NodeSet reaches SetupReady (computes are
10+
# provisioned and SSH-reachable) but before the DataPlaneDeployment
11+
# configures services that depend on NFS.
12+
13+
- name: Deploy NFS on compute nodes (architecture hook)
14+
become: true
15+
hosts: "{{ groups[cifmw_nfs_target | default('computes')][0] | default([]) }}"
16+
tasks:
17+
- name: Skip if NFS deployment is not requested
18+
when:
19+
- not (cifmw_edpm_deploy_nfs | default(false) | bool)
20+
ansible.builtin.meta: end_play
21+
22+
- name: Run cifmw_nfs role
23+
vars:
24+
nftables_path: /etc/nftables
25+
nftables_conf: /etc/sysconfig/nftables.conf
26+
ansible.builtin.include_role:
27+
name: cifmw_nfs

0 commit comments

Comments
 (0)