From c9ecda0788d8b77e66dac1b9797afa187aa3f76a Mon Sep 17 00:00:00 2001 From: Roberto Alfieri Date: Wed, 13 May 2026 17:59:47 +0200 Subject: [PATCH] [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 Signed-off-by: Roberto Alfieri --- deploy-edpm.yml | 13 +++++++++++-- roles/cifmw_setup/tasks/deploy_architecture.yml | 3 +++ 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/deploy-edpm.yml b/deploy-edpm.yml index 5e9b24292..6e9b1e624 100644 --- a/deploy-edpm.yml +++ b/deploy-edpm.yml @@ -87,21 +87,30 @@ - name: Deploy NFS server on target nodes become: true + gather_facts: false hosts: "{{ groups[cifmw_nfs_target | default('computes')][0] | default([]) }}" tasks: + - name: End play early for architecture deploys + when: + - cifmw_architecture_scenario is defined + ansible.builtin.meta: end_play + + - name: Gather facts for NFS deployment + ansible.builtin.setup: + - name: Run cifmw_nfs role vars: nftables_path: /etc/nftables nftables_conf: /etc/sysconfig/nftables.conf when: - cifmw_edpm_deploy_nfs | default(false) | bool - ansible.builtin.import_role: + ansible.builtin.include_role: name: cifmw_nfs - name: Clear ceph target hosts facts to force refreshing in HCI deployments + gather_facts: false hosts: "{{ cifmw_ceph_target | default('computes') }}" tasks: - # end_play will end only current play, not the main edpm-deploy.yml - name: Early end if architecture deploy when: - cifmw_architecture_scenario is defined diff --git a/roles/cifmw_setup/tasks/deploy_architecture.yml b/roles/cifmw_setup/tasks/deploy_architecture.yml index afde76814..e355eb8f1 100644 --- a/roles/cifmw_setup/tasks/deploy_architecture.yml +++ b/roles/cifmw_setup/tasks/deploy_architecture.yml @@ -11,6 +11,9 @@ - always when: - "not item.startswith('ocp-')" + - >- + item not in groups.get('computes', []) or + (cifmw_edpm_deploy_pre_provisioned | default(true) | bool) ansible.builtin.setup: gather_subset: network delegate_facts: true