From c643b946c0945fa0a0cca480a69626431e105547 Mon Sep 17 00:00:00 2001 From: Winston Chen Date: Wed, 26 Aug 2026 11:33:40 +0100 Subject: [PATCH 1/2] Add configuration flexibility for network and MTU settings * Make dummy interface MTU optional via enable_dummy_mtu flag to handle cases where max mtu = 0 causes os-net-config failures. * Make external network name configurable to allow using hostonly network as router external gateway. * Move NTP server configuration outside RHSM block for independent control. --- playbooks/prepare_stack_testconfig.yaml | 2 +- playbooks/templates/dev-install_net_config.yaml.j2 | 4 ++++ playbooks/templates/standalone_parameters.yaml.j2 | 6 +++--- playbooks/vars/defaults.yaml | 9 +++++++++ 4 files changed, 17 insertions(+), 4 deletions(-) diff --git a/playbooks/prepare_stack_testconfig.yaml b/playbooks/prepare_stack_testconfig.yaml index 4a59611..c000384 100644 --- a/playbooks/prepare_stack_testconfig.yaml +++ b/playbooks/prepare_stack_testconfig.yaml @@ -56,7 +56,7 @@ # Create a router for private<->external if ! openstack router show private-subnet-external >/dev/null; then openstack router create private-subnet-external - openstack router set private-subnet-external --external-gateway external + openstack router set private-subnet-external --external-gateway {{ external_network }} openstack router add subnet private-subnet-external private-subnet fi environment: diff --git a/playbooks/templates/dev-install_net_config.yaml.j2 b/playbooks/templates/dev-install_net_config.yaml.j2 index dbddb3e..118a92f 100644 --- a/playbooks/templates/dev-install_net_config.yaml.j2 +++ b/playbooks/templates/dev-install_net_config.yaml.j2 @@ -31,7 +31,9 @@ network_config: - type: interface name: dummy0 nm_controlled: true +{% if enable_dummy_mtu %} mtu: {{ dcn_az is defined | ternary(ctlplane_mtu, public_mtu) }} +{% end %} {% for ip in tunnel_remote_ips %} - type: ovs_tunnel name: "tun-ctlplane-{{ ip | to_uuid }}" @@ -63,7 +65,9 @@ network_config: - type: interface name: dummy1 nm_controlled: true +{% if enable_dummy_mtu %} mtu: {{ dcn_az is defined | ternary(hostonly_mtu, public_mtu) }} +{% end %} {% if sriov_interface is defined %} - type: sriov_pf name: {{ sriov_interface }} diff --git a/playbooks/templates/standalone_parameters.yaml.j2 b/playbooks/templates/standalone_parameters.yaml.j2 index df499a0..2843dc8 100644 --- a/playbooks/templates/standalone_parameters.yaml.j2 +++ b/playbooks/templates/standalone_parameters.yaml.j2 @@ -140,15 +140,15 @@ parameter_defaults: AdminPassword: {{ admin_password }} {% endif %} {% if rhsm_enabled %} -{% if ntp_server is defined %} - NtpServer: {{ ntp_server }} -{% endif %} ContainerImageRegistryCredentials: # assume first registry {{ registers.0.name | ansible.builtin.mandatory}}: {{ registers.0.username | ansible.builtin.mandatory | ansible.builtin.quote }}: {{ registers.0.password | ansible.builtin.mandatory | ansible.builtin.quote }} ContainerImageRegistryLogin: true {% endif %} +{% if ntp_server is defined %} + NtpServer: {{ ntp_server }} +{% endif %} {% if ssl_enabled %} AddVipsToEtcHosts: true HorizonSecureCookies: True diff --git a/playbooks/vars/defaults.yaml b/playbooks/vars/defaults.yaml index 98bef41..b6646ce 100644 --- a/playbooks/vars/defaults.yaml +++ b/playbooks/vars/defaults.yaml @@ -270,3 +270,12 @@ public_mtu: "{{ ctlplane_mtu | int + 100 }}" # Usually people don't use RHSM when deploying from the internal RH network, but use # the puddles; so they'll get our internal NTP server. ntp_server: "{{ rhsm_enabled | ternary('0.pool.ntp.org', 'clock.redhat.com') }}" + +# Dummy interfaces may have max mtu = 0, which causes failure when os-net-config tries to apply +# the specified mtu. This allows disabling setting mtu for dummy interfaces. +enable_dummy_mtu: true + +# If external_fip_pool_start and external_fip_pool_end are not defined, network `external` +# will not be created. `hostonly` can be used as the external network for the router when +# running `prepare_stack_testconfig.yaml` +external_network: external From 866cb0b6399392ee7e735bdb2bcc33a9598eb93d Mon Sep 17 00:00:00 2001 From: Winston Chen Date: Wed, 26 Aug 2026 16:00:59 +0100 Subject: [PATCH 2/2] Add workaround for lint error caused by redhat-subscription --- .github/workflows/ansible-lint.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ansible-lint.yml b/.github/workflows/ansible-lint.yml index 1c2b976..5cbcd0e 100644 --- a/.github/workflows/ansible-lint.yml +++ b/.github/workflows/ansible-lint.yml @@ -19,5 +19,10 @@ jobs: - name: Install dependency run: ansible-galaxy collection install -r requirements.yaml + # This works around the lint error from `ansible-playbook --syntax-check -vv playbooks/install_stack.yaml` + # [ERROR]: Could not find specified file in role, its 'tasks/' is not usable. + - name: Prepare redhat-subscription + run: git clone --depth 1 --branch 1.3.0 https://opendev.org/openstack/ansible-role-redhat-subscription.git $HOME/.ansible/roles/redhat-subscription + - name: Run lint - run: ansible-lint playbooks/** + run: export ANSIBLE_COLLECTIONS_PATH=$HOME/.ansible/collections; ansible-lint playbooks/**