From 740aa8a6fabdd79e3fcb77906e9feb7286af5da3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Andr=C3=A9?= Date: Tue, 23 Jun 2026 08:47:32 +0200 Subject: [PATCH 1/5] Use ansible.utils.nthhost FQCN to replace deprecated ansible.netcommon filter --- playbooks/roles/ceph/tasks/main.yaml | 4 ++-- playbooks/vars/defaults.yaml | 22 +++++++++++----------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/playbooks/roles/ceph/tasks/main.yaml b/playbooks/roles/ceph/tasks/main.yaml index 0b66aab..7d4e1bc 100644 --- a/playbooks/roles/ceph/tasks/main.yaml +++ b/playbooks/roles/ceph/tasks/main.yaml @@ -22,8 +22,8 @@ interface: br-ctlplane dummy_ip_cidr: "{{ mon_ip ~ '/' ~ control_plane_prefix | string }}" dummy_vip: "{{ control_plane_ip }}" - start: "{{ control_plane_cidr | nthhost(4) }}" - end: "{{ control_plane_cidr | nthhost(250) }}" + start: "{{ control_plane_cidr | ansible.utils.nthhost(4) }}" + end: "{{ control_plane_cidr | ansible.utils.nthhost(250) }}" - name: Create OSD spec file ansible.builtin.copy: diff --git a/playbooks/vars/defaults.yaml b/playbooks/vars/defaults.yaml index 98bef41..2084774 100644 --- a/playbooks/vars/defaults.yaml +++ b/playbooks/vars/defaults.yaml @@ -25,8 +25,8 @@ openshift_password: password # You probably won't need to change this. control_plane_cidr: 192.168.24.0/24 control_plane_prefix: "{{ control_plane_cidr | ansible.utils.ipaddr('prefix') }}" -local_ip: "{{ control_plane_cidr | nthhost(1) }}" -control_plane_ip: "{{ control_plane_cidr | nthhost(2) }}" +local_ip: "{{ control_plane_cidr | ansible.utils.nthhost(1) }}" +control_plane_ip: "{{ control_plane_cidr | ansible.utils.nthhost(2) }}" # The IP address of the public openstack endpoints # By default we use the default IP of the host @@ -63,22 +63,22 @@ external_gateway: "{{ network_info.public_ipv4.gateway }}" hostonly_cidr: 192.168.25.0/24 # The IP of the gateway used by the hostonly provider network, which must be # within hostonly_cidr. -hostonly_gateway: "{{ hostonly_cidr | nthhost(1) }}" +hostonly_gateway: "{{ hostonly_cidr | ansible.utils.nthhost(1) }}" # The range of allocatable FIPs within hostonly_cidr -hostonly_fip_pool_start: "{{ hostonly_cidr | nthhost(2) }}" -hostonly_fip_pool_end: "{{ hostonly_cidr | nthhost(-2) }}" +hostonly_fip_pool_start: "{{ hostonly_cidr | ansible.utils.nthhost(2) }}" +hostonly_fip_pool_end: "{{ hostonly_cidr | ansible.utils.nthhost(-2) }}" # Same for IPv6 hostonly_v6_cidr: 2001:db8::/64 -hostonly_v6_gateway: "{{ hostonly_v6_cidr | nthhost(1) }}" -hostonly_v6_fip_pool_start: "{{ hostonly_v6_cidr | nthhost(2) }}" -hostonly_v6_fip_pool_end: "{{ hostonly_v6_cidr | nthhost(-2) }}" +hostonly_v6_gateway: "{{ hostonly_v6_cidr | ansible.utils.nthhost(1) }}" +hostonly_v6_fip_pool_start: "{{ hostonly_v6_cidr | ansible.utils.nthhost(2) }}" +hostonly_v6_fip_pool_end: "{{ hostonly_v6_cidr | ansible.utils.nthhost(-2) }}" # `hostonly` variants hostonly_sriov_cidr: 192.168.26.0/24 -hostonly_sriov_gateway: "{{ hostonly_sriov_cidr | nthhost(1) }}" +hostonly_sriov_gateway: "{{ hostonly_sriov_cidr | ansible.utils.nthhost(1) }}" hostonly_sriov_prefix: "{{ hostonly_sriov_cidr | ansible.utils.ipaddr('prefix') }}" -hostonly_sriov_fip_pool_start: "{{ hostonly_sriov_cidr | nthhost(2) }}" -hostonly_sriov_fip_pool_end: "{{ hostonly_sriov_cidr | nthhost(-2) }}" +hostonly_sriov_fip_pool_start: "{{ hostonly_sriov_cidr | ansible.utils.nthhost(2) }}" +hostonly_sriov_fip_pool_end: "{{ hostonly_sriov_cidr | ansible.utils.nthhost(-2) }}" # Configuration used only by prepare_stack_testconfig, which is not run by # default. From 3070b88290a482610c84929d6587cf3f1dc33745 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Andr=C3=A9?= Date: Tue, 23 Jun 2026 08:47:45 +0200 Subject: [PATCH 2/5] Remove redundant from_yaml filter on non-string input --- playbooks/network.yaml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/playbooks/network.yaml b/playbooks/network.yaml index b842135..8b7bb10 100644 --- a/playbooks/network.yaml +++ b/playbooks/network.yaml @@ -35,7 +35,7 @@ when: - dpdk_interface is not defined ansible.builtin.set_fact: - nmstate_ifs: | + nmstate_ifs: - name: dummy0 type: dummy state: up @@ -55,15 +55,15 @@ when: - dpdk_interface is defined ansible.builtin.set_fact: - nmstate_ifs: | + nmstate_ifs: - name: dummy0 type: dummy state: up ipv4: enabled: true address: - - ip: {{ local_ip }} - prefix-length: {{ control_plane_prefix | int }} + - ip: "{{ local_ip }}" + prefix-length: "{{ control_plane_prefix | int }}" ipv6: enabled: false @@ -96,7 +96,7 @@ # * We need it for installation - name: Remove all physical nics from NM control except the public interface ansible.builtin.set_fact: - nmstate_ifs: "{{ nmstate_ifs | from_yaml + [{'name': item} | combine(removed)] }}" + nmstate_ifs: "{{ nmstate_ifs + [{'name': item} | combine(removed)] }}" loop: "{{ physical_nics | difference(primary_nic) }}" vars: primary_nic: "{{ [network_info.public_ipv4.interface] }}" From 8d02ab1d3cbe0b56c4ba15ca78770568e2fba2a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Andr=C3=A9?= Date: Tue, 23 Jun 2026 08:47:57 +0200 Subject: [PATCH 3/5] Remove deprecated warn parameter from shell tasks --- playbooks/prepare_host.yaml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/playbooks/prepare_host.yaml b/playbooks/prepare_host.yaml index 6331c53..a2e1542 100644 --- a/playbooks/prepare_host.yaml +++ b/playbooks/prepare_host.yaml @@ -104,8 +104,6 @@ dnf -y swap centos-linux-repos centos-stream-repos dnf -y distro-sync fi - args: - warn: false register: stream_output changed_when: (stream_output.stdout_lines | length) > 1 @@ -118,8 +116,6 @@ ansible.builtin.shell: | dnf module disable -y container-tools:rhel8 dnf module enable -y container-tools:3.0 - args: - warn: false # This fixes a bogus resolv.conf entry in the CentOS cloud image. The CentOS # cloud image disables this in /etc/NetworkManager/conf.d/99-cloud-init.conf From ce6442462ae280673cb173989a75fd6604d9bea0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Andr=C3=A9?= Date: Tue, 23 Jun 2026 08:48:05 +0200 Subject: [PATCH 4/5] Explicitly set inject_facts_as_vars to silence deprecation warning --- ansible.cfg | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ansible.cfg b/ansible.cfg index dda3acb..fce87e4 100644 --- a/ansible.cfg +++ b/ansible.cfg @@ -1,2 +1,5 @@ +[defaults] +inject_facts_as_vars = True + [ssh_connection] pipelining = true From 93fae77bd28548abf38a828207cd5fbd9ded313b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Andr=C3=A9?= Date: Tue, 23 Jun 2026 14:09:41 +0200 Subject: [PATCH 5/5] Use include_role for redhat-subscription unregister task import_role is resolved statically at parse time by ansible-playbook --syntax-check. The redhat-subscription role is git-cloned at runtime and the ansible-lint mock only stubs tasks/main.yaml, so tasks_from: unregister.yml causes a syntax-check failure in CI. include_role is dynamic and skipped during --syntax-check, avoiding the failure while being semantically equivalent here (the task is already guarded by a conditional block). --- playbooks/install_stack.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/playbooks/install_stack.yaml b/playbooks/install_stack.yaml index b17c26c..6a95b88 100644 --- a/playbooks/install_stack.yaml +++ b/playbooks/install_stack.yaml @@ -539,7 +539,7 @@ - rhsm_ephemeral block: - name: Unregister Red Hat Subscription Manager - ansible.builtin.import_role: + ansible.builtin.include_role: name: redhat-subscription tasks_from: unregister.yml