|
| 1 | +--- |
| 2 | +# Copyright Red Hat, Inc. |
| 3 | +# All Rights Reserved. |
| 4 | +# |
| 5 | +# Licensed under the Apache License, Version 2.0 (the "License"); you may |
| 6 | +# not use this file except in compliance with the License. You may obtain |
| 7 | +# a copy of the License at |
| 8 | +# |
| 9 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | +# |
| 11 | +# Unless required by applicable law or agreed to in writing, software |
| 12 | +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT |
| 13 | +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the |
| 14 | +# License for the specific language governing permissions and limitations |
| 15 | +# under the License. |
| 16 | + |
| 17 | +- name: Configure OSP 17.1 Barbican with Proteccio HSM |
| 18 | + hosts: "{{ cifmw_target_hook_host | default('localhost') }}" |
| 19 | + tasks: |
| 20 | + - name: Gather ansible_user_dir from undercloud |
| 21 | + delegate_to: "osp-undercloud-0" |
| 22 | + ansible.builtin.setup: |
| 23 | + gather_subset: |
| 24 | + - user_dir |
| 25 | + |
| 26 | + - name: Generate Barbican Proteccio Heat environment file |
| 27 | + delegate_to: "osp-undercloud-0" |
| 28 | + ansible.builtin.copy: |
| 29 | + mode: '0644' |
| 30 | + dest: "{{ ansible_user_dir }}/enable-barbican-proteccio.yaml" |
| 31 | + content: |- |
| 32 | + parameter_defaults: |
| 33 | + # Enable PKCS11 backend for Barbican |
| 34 | + BarbicanPkcs11CryptoEnabled: true |
| 35 | + BarbicanPkcs11CryptoGlobalDefault: true |
| 36 | + BarbicanSimpleCryptoGlobalDefault: false |
| 37 | +
|
| 38 | + # Proteccio HSM configuration |
| 39 | + BarbicanPkcs11CryptoLibraryPath: {{ cifmw_barbican_proteccio_library_path | default('/usr/lib64/libnethsm.so') }} |
| 40 | + BarbicanPkcs11CryptoTokenLabels: {{ cifmw_barbican_proteccio_partition }} |
| 41 | + BarbicanPkcs11CryptoMKEKLabel: {{ cifmw_barbican_proteccio_mkek_label }} |
| 42 | + BarbicanPkcs11CryptoHMACLabel: {{ cifmw_barbican_proteccio_hmac_label }} |
| 43 | + BarbicanPkcs11CryptoLogin: {{ cifmw_hsm_password }} |
| 44 | + BarbicanPkcs11CryptoSlotId: {{ cifmw_barbican_proteccio_slot_id | default('1') }} |
| 45 | +
|
| 46 | + # Encryption mechanisms |
| 47 | + BarbicanPkcs11CryptoEncryptionMechanism: CKM_AES_CBC |
| 48 | + BarbicanPkcs11CryptoHMACKeyType: CKK_GENERIC_SECRET |
| 49 | + BarbicanPkcs11CryptoHMACKeygenMechanism: CKM_GENERIC_SECRET_KEY_GEN |
| 50 | + BarbicanPkcs11CryptoMKEKLength: 32 |
| 51 | + BarbicanPkcs11AlwaysSetCkaSensitive: false |
| 52 | + BarbicanPkcs11CryptoOsLockingOk: true |
| 53 | + BarbicanPkcs11CryptoATOSEnabled: true |
| 54 | +
|
| 55 | + - name: Display generated file location |
| 56 | + ansible.builtin.debug: |
| 57 | + msg: "Generated Barbican Proteccio HSM configuration at: {{ ansible_user_dir }}/enable-barbican-proteccio.yaml" |
0 commit comments