Fix IPSet hostname lookup regression#3977
Conversation
PR openstack-k8s-operators#3930 added an explicit `ansible.builtin.setup` task before the `cifmw_nfs` role invocation and changed `import_role` to `include_role`. Both changes cause `ansible_domain` to resolve incorrectly in the `_nfs_host` variable: - The explicit `setup` gathers fresh facts **after** EDPM deployment has configured the compute's hostname with a domain suffix (`ctlplane.example.com`), causing the IPSet lookup to use `compute-0.ctlplane.example.com` instead of `compute-0`. - `include_role` alters variable scoping so `ansible_domain` no longer resolves from the play target host's facts. **Fix:** - Remove the explicit `setup` task. With `gather_facts: false` and no manual fact gathering, `ansible_domain` remains undefined. The `select()` filter in `_nfs_host` drops it, producing the correct short hostname matching the IPSet name. - Revert `include_role` back to `import_role` to restore play-level variable scoping. Fixes: `component-watcher` and other NFS-based jobs broken after PR openstack-k8s-operators#3930 merged. Related-Issue: ANVIL-109 Co-authored-by: Cursor <cursoragent@cursor.com> Signed-off-by: Roberto Alfieri <ralfieri@redhat.com>
|
Build failed (check pipeline). Post ✔️ openstack-k8s-operators-content-provider SUCCESS in 1h 50m 10s |
|
recheck |
|
recheck |
|
/lgtm |
|
/lgtm |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: nemarjan The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
ff0fae9
into
openstack-k8s-operators:main
PR #3930 added an explicit
ansible.builtin.setuptask before thecifmw_nfsrole invocation and changedimport_roletoinclude_role. Both changes causeansible_domainto resolve incorrectly in the_nfs_hostvariable:setupgathers fresh facts after EDPM deployment has configured the compute's hostname with a domain suffix (ctlplane.example.com), causing the IPSet lookup to usecompute-0.ctlplane.example.cominstead ofcompute-0.include_rolealters variable scoping soansible_domainno longer resolves from the play target host's facts.Fix:
setuptask. Withgather_facts: falseand no manual fact gathering,ansible_domainremains undefined. Theselect()filter in_nfs_hostdrops it, producing the correct short hostname matching the IPSet name.include_roleback toimport_roleto restore play-level variable scoping.Fixes:
component-watcherand other NFS-based jobs broken after PR #3930 merged.Related-Issue: ANVIL-109
Closes: OSPCIX-1394