Add deployment of the external libraries

Deployment of user libraries might be needed for interaction of PKCS#11 module
with external HSM solutions.

Change-Id: I0a0754052a0d48792322243341171593bbbd1a41
This commit is contained in:
Dmitriy Rabotyagov 2020-11-16 15:59:21 +02:00
parent c2765f387d
commit 3acae8f8c9
3 changed files with 37 additions and 0 deletions

View File

@ -81,6 +81,16 @@ barbican_services:
condition: "{{ barbican_retry_enable | bool }}"
start_order: 4
# With `barbican_user_libraries` you can deploy libraries, needed for barbican
# to interact with third party services like HSM
#barbican_user_libraries:
# - src: /etc/openstack_deploy/barbican/libCryptoki2.so
# dest: /opt/barbican/libs/libCryptoki2.so
# owner: root
# group: "{{ barbican_system_group_name }}"
barbican_user_libraries: []
## Service Type and Data
barbican_service_name: barbican
barbican_service_user_name: barbican

View File

@ -0,0 +1,6 @@
---
features:
- |
Added variable `barbican_user_libraries` for deploying custom lib files
from deploy host to barbican continers that might be required for PKCS#11
or other plugins.

View File

@ -48,3 +48,24 @@
notify:
- Restart barbican services
- Restart uwsgi services
- name: Copy user defined libraries
when: barbican_user_libraries | length > 0
block:
- name: Create library destination directories
file:
path: "{{ item.dest | dirname }}"
state: directory
owner: "{{ item.owner | default('root') }}"
group: "{{ item.group | default(barbican_system_group_name) }}"
mode: "0750"
with_items: "{{ barbican_user_libraries }}"
- name: Place user libraries
copy:
src: "{{ item.src }}"
dest: "{{ item.dest }}"
owner: "{{ item.owner | default('root') }}"
group: "{{ item.group | default(barbican_system_group_name) }}"
mode: "0640"
with_items: "{{ barbican_user_libraries }}"