From 0f25900a43895f5154820292d44ec999cd1ec2ed Mon Sep 17 00:00:00 2001 From: Michal Nasiadka Date: Mon, 21 Sep 2020 11:00:35 +0200 Subject: [PATCH] Add missing barbican.conf support Story: 2008170 Task: 40925 Change-Id: I3014983f481a5dca7c93e140b3e10caa5d537669 --- ansible/kolla-openstack.yml | 2 ++ ansible/roles/kolla-openstack/defaults/main.yml | 3 +++ .../molecule/enable-everything/molecule.yml | 4 ++++ .../molecule/enable-everything/tests/test_default.py | 2 ++ ansible/roles/kolla-openstack/tasks/config.yml | 1 + ansible/roles/kolla-openstack/templates/barbican.conf.j2 | 9 +++++++++ doc/source/configuration/reference/kolla-ansible.rst | 1 + .../add-support-for-barbican-conf-c15f0ab4294281cf.yaml | 6 ++++++ 8 files changed, 28 insertions(+) create mode 100644 ansible/roles/kolla-openstack/templates/barbican.conf.j2 create mode 100644 releasenotes/notes/add-support-for-barbican-conf-c15f0ab4294281cf.yaml diff --git a/ansible/kolla-openstack.yml b/ansible/kolla-openstack.yml index 1437b5da5..8e4183eb4 100644 --- a/ansible/kolla-openstack.yml +++ b/ansible/kolla-openstack.yml @@ -105,6 +105,7 @@ register: stat_result with_items: - { name: aodh, file: aodh.conf } + - { name: barbican, file: barbican.conf } - { name: blazar, file: blazar.conf } - { name: ceilometer, file: ceilometer.conf } - { name: cinder, file: cinder.conf } @@ -214,6 +215,7 @@ endpoint_override: "http://{% raw %}{{ api_interface_address }}{% endraw %}:{{ inspector_store_port }}" # Extra free-form user-provided configuration. kolla_extra_aodh: "{{ kolla_extra_config.aodh | default }}" + 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_cinder: "{{ kolla_extra_config.cinder | default }}" diff --git a/ansible/roles/kolla-openstack/defaults/main.yml b/ansible/roles/kolla-openstack/defaults/main.yml index b2a4d41f5..ccae75eb7 100644 --- a/ansible/roles/kolla-openstack/defaults/main.yml +++ b/ansible/roles/kolla-openstack/defaults/main.yml @@ -26,6 +26,9 @@ kolla_extra_aodh: # 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 1981d1b44..9ac69ef36 100644 --- a/ansible/roles/kolla-openstack/molecule/enable-everything/molecule.yml +++ b/ansible/roles/kolla-openstack/molecule/enable-everything/molecule.yml @@ -18,6 +18,10 @@ provisioner: kolla_extra_aodh: | [extra-aodh.conf] foo=bar + 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 873b1630d..55c30179c 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 @@ -28,6 +28,7 @@ testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner( @pytest.mark.parametrize( 'path', ['aodh', + 'barbican', 'cinder', 'cloudkitty', 'designate', @@ -63,6 +64,7 @@ def test_service_config_directory(host, path): @pytest.mark.parametrize( 'path', ['aodh.conf', + 'barbican.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 a123252b2..afc7db1fd 100644 --- a/ansible/roles/kolla-openstack/tasks/config.yml +++ b/ansible/roles/kolla-openstack/tasks/config.yml @@ -14,6 +14,7 @@ mode: 0640 with_items: - { src: aodh.conf.j2, dest: aodh.conf, enabled: "{{ kolla_enable_aodh }}" } + - { 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: cinder.conf.j2, dest: cinder.conf, enabled: "{{ kolla_enable_cinder }}" } 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 000000000..2a33517a8 --- /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/reference/kolla-ansible.rst b/doc/source/configuration/reference/kolla-ansible.rst index 3ca225843..22c9ce9d0 100644 --- a/doc/source/configuration/reference/kolla-ansible.rst +++ b/doc/source/configuration/reference/kolla-ansible.rst @@ -505,6 +505,7 @@ which files are supported. ``aodh.conf`` Aodh configuration. ``aodh/*`` Extended Aodh configuration. ``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 000000000..57ebd64e5 --- /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.