commit 39ef7b5c08dee5362a15dd5a1af2d1be7f040677 Author: Michal Nasiadka Date: Mon Sep 21 11:00:35 2020 +0200 Add missing barbican.conf support Story: 2008170 Task: 40925 Change-Id: I3014983f481a5dca7c93e140b3e10caa5d537669 (cherry picked from commit 0f25900a43895f5154820292d44ec999cd1ec2ed) diff --git a/ansible/kolla-openstack.yml b/ansible/kolla-openstack.yml index 2d423b2..806a892 100644 --- a/ansible/kolla-openstack.yml +++ b/ansible/kolla-openstack.yml @@ -104,6 +104,7 @@ mime: False register: stat_result with_items: + - { name: barbican, file: barbican.conf } - { name: blazar, file: blazar.conf } - { name: ceilometer, file: ceilometer.conf } - { name: ceph, file: ceph.conf } @@ -212,6 +213,7 @@ auth_type: none endpoint_override: "http://{% raw %}{{ api_interface_address }}{% endraw %}:{{ inspector_store_port }}" # Extra free-form user-provided configuration. + kolla_extra_barbican: "{{ kolla_extra_config.barbican | default }}" kolla_extra_blazar: "{{ kolla_extra_config.blazar | default }}" kolla_extra_ceilometer: "{{ kolla_extra_config.ceilometer | default }}" kolla_extra_ceph: "{{ kolla_extra_config.ceph | default }}" diff --git a/ansible/roles/kolla-openstack/defaults/main.yml b/ansible/roles/kolla-openstack/defaults/main.yml index 7e14baf..98c89f5 100644 --- a/ansible/roles/kolla-openstack/defaults/main.yml +++ b/ansible/roles/kolla-openstack/defaults/main.yml @@ -17,6 +17,9 @@ kolla_extra_global: # Whether to enable Barbican. kolla_enable_barbican: +# Free form extra configuration to append to barbican.conf. +kolla_extra_barbican: + ############################################################################### # Blazar configuration. diff --git a/ansible/roles/kolla-openstack/molecule/enable-everything/molecule.yml b/ansible/roles/kolla-openstack/molecule/enable-everything/molecule.yml index 7d90228..76e6367 100644 --- a/ansible/roles/kolla-openstack/molecule/enable-everything/molecule.yml +++ b/ansible/roles/kolla-openstack/molecule/enable-everything/molecule.yml @@ -14,6 +14,10 @@ provisioner: group_vars: all: kolla_extra_config_path: + kolla_enable_barbican: true + kolla_extra_barbican: | + [extra-barbican.conf] + foo=bar kolla_enable_blazar: true kolla_extra_blazar: | [extra-blazar.conf] diff --git a/ansible/roles/kolla-openstack/molecule/enable-everything/tests/test_default.py b/ansible/roles/kolla-openstack/molecule/enable-everything/tests/test_default.py index 50c680f..cb135eb 100644 --- a/ansible/roles/kolla-openstack/molecule/enable-everything/tests/test_default.py +++ b/ansible/roles/kolla-openstack/molecule/enable-everything/tests/test_default.py @@ -27,7 +27,8 @@ testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner( @pytest.mark.parametrize( 'path', - ['ceph', + ['barbican', + 'ceph', 'cinder', 'cloudkitty', 'designate', @@ -61,7 +62,8 @@ def test_service_config_directory(host, path): @pytest.mark.parametrize( 'path', - ['ceph.conf', + ['barbican.conf', + 'ceph.conf', 'cinder.conf', 'cloudkitty.conf', 'designate.conf', diff --git a/ansible/roles/kolla-openstack/tasks/config.yml b/ansible/roles/kolla-openstack/tasks/config.yml index bf931b7..53dd5d0 100644 --- a/ansible/roles/kolla-openstack/tasks/config.yml +++ b/ansible/roles/kolla-openstack/tasks/config.yml @@ -13,6 +13,7 @@ dest: "{{ kolla_node_custom_config_path }}/{{ item.dest }}" mode: 0640 with_items: + - { src: barbican.conf.j2, dest: barbican.conf, enabled: "{{ kolla_enable_barbican }}" } - { src: blazar.conf.j2, dest: blazar.conf, enabled: "{{ kolla_enable_blazar }}" } - { src: ceilometer.conf.j2, dest: ceilometer.conf, enabled: "{{ kolla_enable_ceilometer }}" } - { src: ceph.conf.j2, dest: ceph.conf, enabled: "{{ kolla_enable_ceph }}" } diff --git a/ansible/roles/kolla-openstack/templates/barbican.conf.j2 b/ansible/roles/kolla-openstack/templates/barbican.conf.j2 new file mode 100644 index 0000000..2a33517 --- /dev/null +++ b/ansible/roles/kolla-openstack/templates/barbican.conf.j2 @@ -0,0 +1,9 @@ +# {{ ansible_managed }} + +{% if kolla_extra_barbican %} +####################### +# Extra configuration +####################### + +{{ kolla_extra_barbican }} +{% endif %} diff --git a/doc/source/configuration/kolla-ansible.rst b/doc/source/configuration/kolla-ansible.rst index 9a8de5f..f59904f 100644 --- a/doc/source/configuration/kolla-ansible.rst +++ b/doc/source/configuration/kolla-ansible.rst @@ -502,6 +502,7 @@ which files are supported. File Purpose =============================== ======================================================= ``backup.my.cnf`` Mariabackup configuration. + ``barbican.conf`` Barbican configuration. ``barbican/*`` Extended Barbican configuration. ``blazar.conf`` Blazar configuration. ``blazar/*`` Extended Blazar configuration. diff --git a/releasenotes/notes/add-support-for-barbican-conf-c15f0ab4294281cf.yaml b/releasenotes/notes/add-support-for-barbican-conf-c15f0ab4294281cf.yaml new file mode 100644 index 0000000..57ebd64 --- /dev/null +++ b/releasenotes/notes/add-support-for-barbican-conf-c15f0ab4294281cf.yaml @@ -0,0 +1,6 @@ +--- +fixes: + - | + Adds support for a custom Barbican configuration file (``barbican.conf``), + as only extended configuration stored under a ``barbican`` folder was + supported.