From 47a3a4826f48414c153ed07545a6eb66d5d34648 Mon Sep 17 00:00:00 2001 From: Andre Kantek Date: Thu, 29 Jun 2023 09:01:27 -0300 Subject: [PATCH] Add L4 service ports value to bootstrap runtime hieradata 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 to be available 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 Depends-On: https://review.opendev.org/c/starlingx/config/+/887372 Change-Id: I8ed58954338181bc32806f7f448f6ec280027830 Signed-off-by: Andre Kantek --- .../tasks/apply_bootstrap_manifest.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/playbookconfig/src/playbooks/roles/bootstrap/apply-manifest/tasks/apply_bootstrap_manifest.yml b/playbookconfig/src/playbooks/roles/bootstrap/apply-manifest/tasks/apply_bootstrap_manifest.yml index f0305eb2e..f35dbc67c 100644 --- a/playbookconfig/src/playbooks/roles/bootstrap/apply-manifest/tasks/apply_bootstrap_manifest.yml +++ b/playbookconfig/src/playbooks/roles/bootstrap/apply-manifest/tasks/apply_bootstrap_manifest.yml @@ -200,6 +200,19 @@ - "platform::drbd::pgsql::params::lv_size: {{ pgsql_size }}" - "platform::drbd::platform::params::lv_size: {{ platform_size }}" when: root_disk_size|int >= minimum_small_root_disk_size + + - name: Add L4 service ports value to bootstrap runtime hieradata + vars: + script_content: | + import sysinv.common.platform_firewall as pf + file = "{{ hieradata_workdir }}/runtime.yaml" + with open(file, "a") as f: + for key in pf.SYSTEM_CONFIG: + f.write(f"{key}: {pf.SYSTEM_CONFIG[key]}\n") + shell: "{{ script_content }}" + args: + executable: /usr/bin/python + when: mode == 'bootstrap' - block: