Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 57 additions & 0 deletions hooks/playbooks/barbican-osp17-proteccio-setup.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
---
# Copyright Red Hat, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.

- name: Configure OSP 17.1 Barbican with Proteccio HSM
hosts: "{{ cifmw_target_hook_host | default('localhost') }}"
tasks:
- name: Gather ansible_user_dir from undercloud
delegate_to: "osp-undercloud-0"
ansible.builtin.setup:
gather_subset:
- user_dir

- name: Generate Barbican Proteccio Heat environment file
delegate_to: "osp-undercloud-0"
ansible.builtin.copy:
mode: '0644'
dest: "{{ ansible_user_dir }}/enable-barbican-proteccio.yaml"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How does the framework know to use the file in doing the 17.1 deployment?

I see in your rdo-jobs patch, you key off of file name - though actually you appear to be looking for something called proteccio-heat-vars.yaml in that patch.

I think ultimately you are probably going to want to set some generic parameter extra_tripleo_template or somesuch - and set that to the filename here.

Or you could create a directory {{ansible_user_dir}}/extra-heat-templates or some such and include the file there - and modify the rdo-jobs to read all files in that directory and add to the THT deploy command.

content: |-
parameter_defaults:
# Enable PKCS11 backend for Barbican
BarbicanPkcs11CryptoEnabled: true
BarbicanPkcs11CryptoGlobalDefault: true
BarbicanSimpleCryptoGlobalDefault: false

# Proteccio HSM configuration
BarbicanPkcs11CryptoLibraryPath: {{ cifmw_barbican_proteccio_library_path | default('/usr/lib64/libnethsm.so') }}
BarbicanPkcs11CryptoTokenLabels: {{ cifmw_barbican_proteccio_partition }}
BarbicanPkcs11CryptoMKEKLabel: {{ cifmw_barbican_proteccio_mkek_label }}
BarbicanPkcs11CryptoHMACLabel: {{ cifmw_barbican_proteccio_hmac_label }}
BarbicanPkcs11CryptoLogin: {{ cifmw_hsm_password }}
BarbicanPkcs11CryptoSlotId: {{ cifmw_barbican_proteccio_slot_id | default('1') }}

# Encryption mechanisms
BarbicanPkcs11CryptoEncryptionMechanism: CKM_AES_CBC
BarbicanPkcs11CryptoHMACKeyType: CKK_GENERIC_SECRET
BarbicanPkcs11CryptoHMACKeygenMechanism: CKM_GENERIC_SECRET_KEY_GEN
BarbicanPkcs11CryptoMKEKLength: 32
BarbicanPkcs11AlwaysSetCkaSensitive: false
BarbicanPkcs11CryptoOsLockingOk: true
BarbicanPkcs11CryptoATOSEnabled: true

- name: Display generated file location
ansible.builtin.debug:
msg: "Generated Barbican Proteccio HSM configuration at: {{ ansible_user_dir }}/enable-barbican-proteccio.yaml"
11 changes: 11 additions & 0 deletions roles/adoption_osp_deploy/tasks/deploy_overcloud.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,17 @@
dest: "{{ _private_overcloud_conf_file }}"
mode: "0644"

- name: Check if Barbican Proteccio HSM env file exists
delegate_to: "osp-undercloud-0"
ansible.builtin.stat:
path: "{{ ansible_user_dir }}/enable-barbican-proteccio.yaml"
register: _barbican_proteccio_env_file

- name: Include Barbican Proteccio HSM environment file if exists
when: _barbican_proteccio_env_file.stat.exists
ansible.builtin.set_fact:
_overcloud_args: "{{ _overcloud_args }} -e {{ ansible_user_dir }}/enable-barbican-proteccio.yaml"

- name: Run overcloud deploy
delegate_to: "osp-undercloud-0"
vars:
Expand Down
13 changes: 13 additions & 0 deletions scenarios/adoption/barbican-proteccio.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
# OSP 17.1 deployment scenario for Barbican with Proteccio HSM
# Extends the base Barbican scenario with HSM configuration

undercloud:
config: []

stacks:
- stackname: overcloud
pre_oc_run:
- name: Configure Barbican with Proteccio HSM on OSP 17.1
type: playbook
source: barbican-osp17-proteccio-setup.yml
12 changes: 12 additions & 0 deletions scenarios/adoption/barbican.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
# Base OSP 17.1 deployment scenario for Barbican adoption
# This deploys Barbican with simple_crypto backend (no HSM)
# Can be extended with HSM-specific scenarios

undercloud:
config: []

stacks:
- stackname: overcloud
# No pre_oc_run hooks needed for basic Barbican
# It will use the default simple_crypto backend
Loading