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 <andrefernandozanella.kantek@windriver.com>
This commit is contained in:
Andre Kantek 2023-06-29 09:01:27 -03:00 committed by Andre Kantek
parent 22b45d60e7
commit 47a3a4826f

View File

@ -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: