From 1f4a9dd8fd6b428160a0941b2286593a5a54340b Mon Sep 17 00:00:00 2001 From: Andre Kantek Date: Fri, 30 Jun 2023 09:34:50 -0300 Subject: [PATCH] Create SYSTEM_CONFIG in sysinv.common.platform_firewall As part of story 2010591 the hard-coded values for L4 ports in puppet were moved to sysinv.common.constants and exported there to "system.yaml". But the bootstrap runs prior to this file availability, hence the port definitions are not available, and barbican failed during the subcloud bootstrap. To avoid that we are exporting all L4 ports that were exported to system.yaml to the runtime.yaml file by accessing SYSTEM_CONFIG during bootstrap. Test Plan: [PASS] AIO-DX standalone install/unlock/enable [PASS] AIO-DX system controller install/unlock/enable [PASS] AIO-SX subcloud install/unlock/enable Closes-Bug: 2025361 Change-Id: Ieca1d6dd764622ec575fc29b73cc167cae968a5e Signed-off-by: Andre Kantek --- .../sysinv/sysinv/common/platform_firewall.py | 31 +++++++++++++++++++ .../sysinv/sysinv/puppet/platform_firewall.py | 30 +----------------- 2 files changed, 32 insertions(+), 29 deletions(-) diff --git a/sysinv/sysinv/sysinv/sysinv/common/platform_firewall.py b/sysinv/sysinv/sysinv/sysinv/common/platform_firewall.py index f492782558..ec5def5574 100644 --- a/sysinv/sysinv/sysinv/sysinv/common/platform_firewall.py +++ b/sysinv/sysinv/sysinv/sysinv/common/platform_firewall.py @@ -96,3 +96,34 @@ SUBCLOUD = \ { 162: "snmp trap" }} + +# If the variable needs to be present on puppet, add here to be included in system.yaml +# is also used to export to bootstrap's runtime.yaml +SYSTEM_CONFIG = { + "platform::nfv::params::api_port": + constants.PLATFORM_NFV_PARAMS_API_PORT, + "platform::patching::params::public_port": + constants.PLATFORM_PATCHING_PARAMS_PUBLIC_PORT, + "platform::sysinv::params::api_port": + constants.PLATFORM_SYSINV_PARAMS_API_PORT, + "platform::docker::params::registry_port": + constants.PLATFORM_DOCKER_PARAMS_REGISTRY_PORT, + "platform::docker::params::token_port": + constants.PLATFORM_DOCKER_PARAMS_TOKEN_PORT, + "platform::ceph::params::rgw_port": + constants.PLATFORM_CEPH_PARAMS_RGW_PORT, + "openstack::barbican::params::api_port": + constants.OPENSTACK_BARBICAN_PARAMS_API_PORT, + "openstack::keystone::params::api_port": + constants.OPENSTACK_KEYSTONE_PARAMS_API_PORT, + "platform::fm::params::api_port": + constants.PLATFORM_FM_PARAMS_API_PORT, + "platform::dcmanager::params::api_port": + constants.PLATFORM_DCMANAGER_PARAMS_API_PORT, + "platform::dcorch::params::sysinv_api_proxy_port": + constants.PLATFORM_DCORCH_PARAMS_SYSINV_API_PROXY_PORT, + "platform::dcorch::params::patch_api_proxy_port": + constants.PLATFORM_DCORCH_PARAMS_PATCH_API_PROXY_PORT, + "platform::dcorch::params::identity_api_proxy_port": + constants.PLATFORM_DCORCH_PARAMS_IDENTITY_API_PROXY_PORT +} diff --git a/sysinv/sysinv/sysinv/sysinv/puppet/platform_firewall.py b/sysinv/sysinv/sysinv/sysinv/puppet/platform_firewall.py index 32da6d8013..9ebc4005b1 100644 --- a/sysinv/sysinv/sysinv/sysinv/puppet/platform_firewall.py +++ b/sysinv/sysinv/sysinv/sysinv/puppet/platform_firewall.py @@ -37,35 +37,7 @@ class PlatformFirewallPuppet(base.BasePuppet): super(PlatformFirewallPuppet, self).__init__(*args, **kwargs) def get_system_config(self): - config = { - "platform::nfv::params::api_port": - constants.PLATFORM_NFV_PARAMS_API_PORT, - "platform::patching::params::public_port": - constants.PLATFORM_PATCHING_PARAMS_PUBLIC_PORT, - "platform::sysinv::params::api_port": - constants.PLATFORM_SYSINV_PARAMS_API_PORT, - "platform::docker::params::registry_port": - constants.PLATFORM_DOCKER_PARAMS_REGISTRY_PORT, - "platform::docker::params::token_port": - constants.PLATFORM_DOCKER_PARAMS_TOKEN_PORT, - "platform::ceph::params::rgw_port": - constants.PLATFORM_CEPH_PARAMS_RGW_PORT, - "openstack::barbican::params::api_port": - constants.OPENSTACK_BARBICAN_PARAMS_API_PORT, - "openstack::keystone::params::api_port": - constants.OPENSTACK_KEYSTONE_PARAMS_API_PORT, - "platform::fm::params::api_port": - constants.PLATFORM_FM_PARAMS_API_PORT, - "platform::dcmanager::params::api_port": - constants.PLATFORM_DCMANAGER_PARAMS_API_PORT, - "platform::dcorch::params::sysinv_api_proxy_port": - constants.PLATFORM_DCORCH_PARAMS_SYSINV_API_PROXY_PORT, - "platform::dcorch::params::patch_api_proxy_port": - constants.PLATFORM_DCORCH_PARAMS_PATCH_API_PROXY_PORT, - "platform::dcorch::params::identity_api_proxy_port": - constants.PLATFORM_DCORCH_PARAMS_IDENTITY_API_PROXY_PORT - } - return config + return firewall.SYSTEM_CONFIG def get_host_config(self, host): """ Plugin public method