-
Notifications
You must be signed in to change notification settings - Fork 151
Separate kustomization from image creation and fix HSM password loading for adoption #3579
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
danpawlik
merged 2 commits into
openstack-k8s-operators:main
from
mauricioharley:proteccio_adoption_fix
Jan 28, 2026
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,77 @@ | ||
| --- | ||
| - name: Create modified barbican image and get secrets | ||
| hosts: "{{ cifmw_target_hook_host | default('localhost') }}" | ||
| tasks: | ||
| # Load HSM password from Zuul secret file if not already defined. | ||
| # The file is created by the qe-creds-crc.yaml pre-run playbook | ||
| # in the components-integration-config repository. | ||
| - name: Load HSM password from secrets file if not defined | ||
| when: cifmw_hsm_password is not defined | ||
| block: | ||
| - name: Check if Proteccio PIN file exists | ||
| ansible.builtin.stat: | ||
| path: /var/tmp/qe-secrets/proteccio_pin.yaml | ||
| register: _proteccio_pin_file | ||
|
|
||
| - name: Read Proteccio PIN from file | ||
| when: _proteccio_pin_file.stat.exists | ||
| ansible.builtin.include_vars: | ||
|
danpawlik marked this conversation as resolved.
|
||
| file: /var/tmp/qe-secrets/proteccio_pin.yaml | ||
| name: _proteccio_pin_data | ||
|
|
||
| - name: Set cifmw_hsm_password from file | ||
| when: _proteccio_pin_file.stat.exists | ||
| ansible.builtin.set_fact: | ||
| cifmw_hsm_password: "{{ _proteccio_pin_data.rdu2Pin }}" | ||
|
|
||
| - name: Fail if HSM password is not available | ||
| when: cifmw_hsm_password is not defined | ||
|
danpawlik marked this conversation as resolved.
|
||
| ansible.builtin.fail: | ||
| msg: >- | ||
| The HSM password (cifmw_hsm_password) is not defined and could not | ||
| be loaded from the secrets file at /var/tmp/qe-secrets/proteccio_pin.yaml. | ||
| Please ensure either: | ||
| 1. The variable cifmw_hsm_password is set in your job configuration, or | ||
| 2. The Zuul secret file exists (created by qe-creds-crc.yaml pre-run playbook) | ||
|
|
||
| - name: Check out the role Git repository | ||
| ansible.builtin.git: | ||
| dest: "./rhoso_proteccio_hsm" | ||
| repo: "{{ cifmw_hsm_proteccio_ansible_role_repo | default('https://github.com/openstack-k8s-operators/ansible-role-rhoso-proteccio-hsm.git', true) }}" | ||
|
danpawlik marked this conversation as resolved.
|
||
| version: "{{ cifmw_hsm_proteccio_ansible_role_version| default('main', true) }}" | ||
|
danpawlik marked this conversation as resolved.
|
||
|
|
||
| - name: Create and upload the new Barbican images | ||
| ansible.builtin.include_role: | ||
| name: rhoso_proteccio_hsm | ||
| tasks_from: create_image | ||
| vars: | ||
| barbican_src_api_image_name: "{{ cifmw_barbican_src_api_image_name }}" | ||
| barbican_src_worker_image_name: "{{ cifmw_barbican_src_worker_image_name }}" | ||
| barbican_src_image_registry: "{{ content_provider_registry_ip }}:5001" | ||
| barbican_src_image_namespace: "{{ cifmw_update_containers_org | default('podified-antelope-centos9') }}" | ||
| barbican_src_image_tag: "{{ cifmw_update_containers_tag | default('component-ci-testing') }}" | ||
| barbican_dest_api_image_name: "{{ cifmw_barbican_dest_api_image_name }}" | ||
| barbican_dest_worker_image_name: "{{ cifmw_barbican_dest_worker_image_name }}" | ||
| barbican_dest_image_registry: "{{ content_provider_registry_ip }}:5001" | ||
| barbican_dest_image_namespace: "{{ cifmw_update_containers_org | default('podified-antelope-centos9') }}" | ||
| barbican_dest_image_tag: "{{ cifmw_update_containers_barbican_custom_tag }}" | ||
| image_registry_verify_tls: "{{ cifmw_image_registry_verify_tls | default('false', true) }}" | ||
| proteccio_client_src: "{{ cifmw_hsm_proteccio_client_src }}" | ||
| proteccio_client_iso: "{{ cifmw_hsm_proteccio_client_iso | default('Proteccio3.06.05.iso') }}" | ||
|
|
||
| - name: Create secrets with the HSM certificates and hsm-login credentials | ||
| ansible.builtin.include_role: | ||
| name: rhoso_proteccio_hsm | ||
| tasks_from: create_secrets | ||
| vars: | ||
| proteccio_conf_src: "{{ cifmw_hsm_proteccio_conf_src }}" | ||
| proteccio_client_crt_src: "{{ cifmw_hsm_proteccio_client_crt_src }}" | ||
| proteccio_client_key_src: "{{ cifmw_hsm_proteccio_client_key_src }}" | ||
| proteccio_server_crt_src: "{{ cifmw_hsm_proteccio_server_crt_src }}" | ||
| proteccio_password: "{{ cifmw_hsm_password }}" | ||
| kubeconfig_path: "{{ cifmw_openshift_kubeconfig }}" | ||
| oc_dir: "{{ cifmw_path }}" | ||
| proteccio_data_secret: "{{ cifmw_hsm_proteccio_client_data_secret | default('barbican-proteccio-client-data', true) }}" | ||
| proteccio_data_secret_namespace: "{{ cifmw_hsm_proteccio_client_data_secret_namespace }}" | ||
| login_secret: "{{ cifmw_hsm_login_secret | default('barbican-proteccio-login', true) }}" | ||
| login_secret_field: "{{ cifmw_hsm_login_secret_field | default('PKCS11Pin') }}" | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.