Skip to content

Commit bc5941f

Browse files
author
Mauricio Harley
committed
Add support for custom Barbican images and parameterized HSM secrets
This change adds support for: - Custom Barbican API and Worker container images via barbican_custom_api_image and barbican_custom_worker_image variables - Parameterized HSM secret names via proteccio_login_secret_name and proteccio_client_data_secret_name variables This enables adoption scenarios where Barbican requires custom images with HSM client libraries (e.g., Proteccio) installed. Signed-off-by: Mauricio Harley <mharley@redhat.com>
1 parent 3fa665b commit bc5941f

File tree

2 files changed

+28
-2
lines changed

2 files changed

+28
-2
lines changed

tests/roles/backend_services/tasks/main.yaml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,32 @@
9393
args:
9494
chdir: "{{ dpa_tests_dir }}/config"
9595

96+
- name: Get OpenStackVersion resource name for custom Barbican images
97+
when: >-
98+
(barbican_custom_api_image is defined and barbican_custom_api_image) or
99+
(barbican_custom_worker_image is defined and barbican_custom_worker_image)
100+
ansible.builtin.shell: |
101+
{{ shell_header }}
102+
{{ oc_header }}
103+
oc get openstackversions -o jsonpath='{.items[0].metadata.name}'
104+
register: openstack_version_name
105+
changed_when: false
106+
failed_when: openstack_version_name.stdout == ""
107+
108+
- name: Patch OpenStackVersion with custom Barbican images
109+
when: >-
110+
(barbican_custom_api_image is defined and barbican_custom_api_image) or
111+
(barbican_custom_worker_image is defined and barbican_custom_worker_image)
112+
ansible.builtin.shell: |
113+
{{ shell_header }}
114+
{{ oc_header }}
115+
{% if barbican_custom_api_image is defined and barbican_custom_api_image %}
116+
oc patch openstackversion {{ openstack_version_name.stdout }} --type=merge -p '{"spec":{"customContainerImages":{"barbicanAPIImage":"{{ barbican_custom_api_image }}"}}}'
117+
{% endif %}
118+
{% if barbican_custom_worker_image is defined and barbican_custom_worker_image %}
119+
oc patch openstackversion {{ openstack_version_name.stdout }} --type=merge -p '{"spec":{"customContainerImages":{"barbicanWorkerImage":"{{ barbican_custom_worker_image }}"}}}'
120+
{% endif %}
121+
96122
- name: execute alternative tasks when source env is ODPdO
97123
ansible.builtin.include_tasks: ospdo_backend_services.yaml
98124
when: ospdo_src| bool

tests/roles/barbican_adoption/defaults/main.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,8 @@ barbican_hsm_patch: |
8080
globalDefaultSecretStore: pkcs11
8181
enabledSecretStores: ["simple_crypto", "pkcs11"]
8282
pkcs11:
83-
loginSecret: hsm-login
84-
clientDataSecret: proteccio-data
83+
loginSecret: {{ proteccio_login_secret_name | default('hsm-login') }}
84+
clientDataSecret: {{ proteccio_client_data_secret_name | default('proteccio-data') }}
8585
clientDataPath: /etc/proteccio
8686
barbicanAPI:
8787
replicas: 1

0 commit comments

Comments
 (0)