From 792a0cf79e1d32e57e43d8d906b30081ee44a0a3 Mon Sep 17 00:00:00 2001 From: Roman Dobosz Date: Thu, 23 Nov 2023 13:03:16 +0100 Subject: [PATCH] OpenStack: Determine dualstack installation by value Check os_subnet6 instead of os_subnet6_range to determine dual-stack installation in UPI playbooks. --- upi/openstack/bootstrap.yaml | 4 ++-- upi/openstack/compute-nodes.yaml | 4 ++-- upi/openstack/control-plane.yaml | 4 ++-- upi/openstack/network.yaml | 21 ++++++--------------- upi/openstack/security-groups.yaml | 3 +-- upi/openstack/update-network-resources.yaml | 4 +--- 6 files changed, 14 insertions(+), 26 deletions(-) diff --git a/upi/openstack/bootstrap.yaml b/upi/openstack/bootstrap.yaml index 3645f13fef..3dd53f7b69 100644 --- a/upi/openstack/bootstrap.yaml +++ b/upi/openstack/bootstrap.yaml @@ -19,7 +19,7 @@ - "{{ os_sg_master }}" allowed_address_pairs: - ip_address: "{{ os_apiVIP }}" - when: os_subnet6_range is not defined + when: os_subnet6 is not defined - name: 'Create the bootstrap dualstack server port' os_port: @@ -30,7 +30,7 @@ allowed_address_pairs: - ip_address: "{{ os_apiVIP }}" - ip_address: "{{ os_apiVIP6 }}" - when: os_subnet6_range is defined + when: os_subnet6 is defined - name: 'Set bootstrap port tag' command: diff --git a/upi/openstack/compute-nodes.yaml b/upi/openstack/compute-nodes.yaml index 165da15c78..1e0d714964 100644 --- a/upi/openstack/compute-nodes.yaml +++ b/upi/openstack/compute-nodes.yaml @@ -21,7 +21,7 @@ - ip_address: "{{ os_ingressVIP }}" with_indexed_items: "{{ [os_port_worker] * os_compute_nodes_number }}" register: ports - when: os_subnet6_range is not defined + when: os_subnet6 is not defined - name: 'Create the dualstack Compute ports' openstack.cloud.port: @@ -34,7 +34,7 @@ - ip_address: "{{ os_ingressVIP6 }}" with_indexed_items: "{{ [os_port_worker] * os_compute_nodes_number }}" register: ports - when: os_subnet6_range is defined + when: os_subnet6 is defined - name: 'Set Compute ports tag' ansible.builtin.command: diff --git a/upi/openstack/control-plane.yaml b/upi/openstack/control-plane.yaml index beaa8a10e1..019aa69062 100644 --- a/upi/openstack/control-plane.yaml +++ b/upi/openstack/control-plane.yaml @@ -22,7 +22,7 @@ - ip_address: "{{ os_ingressVIP }}" with_indexed_items: "{{ [os_port_master] * os_cp_nodes_number }}" register: ports - when: os_subnet6_range is not defined + when: os_subnet6 is not defined - name: 'Create the dualstack Control Plane ports' openstack.cloud.port: @@ -37,7 +37,7 @@ - ip_address: "{{ os_ingressVIP6 }}" with_indexed_items: "{{ [os_port_master] * os_cp_nodes_number }}" register: ports - when: os_subnet6_range is defined + when: os_subnet6 is defined - name: 'Set Control Plane ports tag' ansible.builtin.command: diff --git a/upi/openstack/network.yaml b/upi/openstack/network.yaml index 57ffbeb8fd..db268eaee2 100644 --- a/upi/openstack/network.yaml +++ b/upi/openstack/network.yaml @@ -30,9 +30,7 @@ ip_version: 6 ipv6_address_mode: "{{ os_subnet6_address_mode }}" ipv6_ra_mode: "{{ os_subnet6_router_advertisements_mode }}" - when: - - os_subnet6_range is defined - - os_subnet6_range|ansible.utils.ipv6 + when: os_subnet6 is defined - name: 'Create external router' openstack.cloud.router: @@ -49,8 +47,7 @@ - "{{ os_subnet }}" - "{{ os_subnet6 }}" when: - - os_subnet6_range is defined - - os_subnet6_range|ansible.utils.ipv6 + - os_subnet6 is defined - os_external_network is defined and os_external_network|length>0 - name: 'Create the API port' @@ -61,8 +58,7 @@ - subnet: "{{ os_subnet }}" ip_address: "{{ os_apiVIP }}" register: _api_ports - when: - - os_subnet6_range is not defined + when: os_subnet6 is not defined - set_fact: api_ports: "{{ _api_ports }}" @@ -73,9 +69,7 @@ name: "{{ os_port_api }}" network: "{{ os_network }}" register: _api_ports - when: - - os_subnet6_range is defined - - os_subnet6_range|ansible.utils.ipv6 + when: os_subnet6 is defined - set_fact: api_ports: "{{ _api_ports }}" @@ -89,8 +83,7 @@ - subnet: "{{ os_subnet }}" ip_address: "{{ os_ingressVIP }}" register: _ingress_ports - when: - - os_subnet6_range is not defined + when: os_subnet6 is not defined - set_fact: ingress_ports: "{{ _ingress_ports }}" @@ -101,9 +94,7 @@ name: "{{ os_port_ingress }}" network: "{{ os_network }}" register: _ingress_ports - when: - - os_subnet6_range is defined - - os_subnet6_range|ansible.utils.ipv6 + when: os_subnet6 is defined - set_fact: ingress_ports: "{{ _ingress_ports }}" diff --git a/upi/openstack/security-groups.yaml b/upi/openstack/security-groups.yaml index b9f93e69c2..7d8c3d372a 100644 --- a/upi/openstack/security-groups.yaml +++ b/upi/openstack/security-groups.yaml @@ -373,5 +373,4 @@ when: os_master_schedulable is defined and os_master_schedulable when: - - os_subnet6_range is defined - - os_subnet6_range|ansible.utils.ipv6 + when: os_subnet6 is defined diff --git a/upi/openstack/update-network-resources.yaml b/upi/openstack/update-network-resources.yaml index e58a031383..e32b2638cc 100644 --- a/upi/openstack/update-network-resources.yaml +++ b/upi/openstack/update-network-resources.yaml @@ -22,9 +22,7 @@ - name: 'Set tags on primary cluster subnet IPv6' ansible.builtin.command: cmd: "openstack subnet set --tag {{ cluster_id_tag }} {{ os_subnet6 }}" - when: - - os_subnet6_range is defined - - os_subnet6_range|ansible.utils.ipv6 + when: os_subnet6 is defined - name: 'Set tags on the API VIP port' ansible.builtin.command: