From 878fe5728bbc74b3d42ab63c2c61de6c4bbd01a1 Mon Sep 17 00:00:00 2001 From: Pierre Riteau Date: Mon, 17 Aug 2020 10:39:58 +0200 Subject: [PATCH] Add support for custom Aodh configuration Change-Id: I19ef5a46dccacc00db495993cc744938921996a1 Story: 2008019 Task: 40671 --- ansible/kolla-openstack.yml | 2 ++ ansible/roles/kolla-openstack/defaults/main.yml | 9 +++++++++ .../molecule/default/tests/test_default.py | 3 ++- .../molecule/enable-everything/molecule.yml | 4 ++++ .../molecule/enable-everything/tests/test_default.py | 6 ++++-- ansible/roles/kolla-openstack/tasks/config.yml | 1 + ansible/roles/kolla-openstack/templates/aodh.conf.j2 | 10 ++++++++++ ansible/roles/kolla-openstack/vars/main.yml | 5 +++++ doc/source/configuration/kolla-ansible.rst | 2 ++ ...-support-for-custom-aodh-conf-81a5a623f771d1c2.yaml | 3 +++ 10 files changed, 42 insertions(+), 3 deletions(-) create mode 100644 ansible/roles/kolla-openstack/templates/aodh.conf.j2 create mode 100644 releasenotes/notes/add-support-for-custom-aodh-conf-81a5a623f771d1c2.yaml diff --git a/ansible/kolla-openstack.yml b/ansible/kolla-openstack.yml index a77776ffd..1437b5da5 100644 --- a/ansible/kolla-openstack.yml +++ b/ansible/kolla-openstack.yml @@ -104,6 +104,7 @@ mime: False register: stat_result with_items: + - { name: aodh, file: aodh.conf } - { name: blazar, file: blazar.conf } - { name: ceilometer, file: ceilometer.conf } - { name: cinder, file: cinder.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_aodh: "{{ kolla_extra_config.aodh | 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 7e5017cbe..b2a4d41f5 100644 --- a/ansible/roles/kolla-openstack/defaults/main.yml +++ b/ansible/roles/kolla-openstack/defaults/main.yml @@ -11,6 +11,15 @@ kolla_node_custom_config_path: /etc/kolla/config # Free form extra configuration to append to global.conf. kolla_extra_global: +############################################################################### +# Aodh configuration. + +# Whether to enable Aodh. +kolla_enable_aodh: + +# Free form extra configuration to append to aodh.conf. +kolla_extra_aodh: + ############################################################################### # Barbican configuration. diff --git a/ansible/roles/kolla-openstack/molecule/default/tests/test_default.py b/ansible/roles/kolla-openstack/molecule/default/tests/test_default.py index 69a6c1d4f..b1bd3dec3 100644 --- a/ansible/roles/kolla-openstack/molecule/default/tests/test_default.py +++ b/ansible/roles/kolla-openstack/molecule/default/tests/test_default.py @@ -37,7 +37,8 @@ def test_service_config_directory(host, path): @pytest.mark.parametrize( 'path', - ['cinder', + ['aodh', + 'cinder', 'cloudkitty', 'designate', 'glance', diff --git a/ansible/roles/kolla-openstack/molecule/enable-everything/molecule.yml b/ansible/roles/kolla-openstack/molecule/enable-everything/molecule.yml index a9e68b759..1981d1b44 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_aodh: true + kolla_extra_aodh: | + [extra-aodh.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 d4bc9f2ea..873b1630d 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', - ['cinder', + ['aodh', + 'cinder', 'cloudkitty', 'designate', 'fluentd/filter', @@ -61,7 +62,8 @@ def test_service_config_directory(host, path): @pytest.mark.parametrize( 'path', - ['cinder.conf', + ['aodh.conf', + 'cinder.conf', 'cloudkitty.conf', 'designate.conf', 'galera.cnf', diff --git a/ansible/roles/kolla-openstack/tasks/config.yml b/ansible/roles/kolla-openstack/tasks/config.yml index 94ccd1822..a123252b2 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: aodh.conf.j2, dest: aodh.conf, enabled: "{{ kolla_enable_aodh }}" } - { 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/aodh.conf.j2 b/ansible/roles/kolla-openstack/templates/aodh.conf.j2 new file mode 100644 index 000000000..5d7d4c1e0 --- /dev/null +++ b/ansible/roles/kolla-openstack/templates/aodh.conf.j2 @@ -0,0 +1,10 @@ +# {{ ansible_managed }} + +{% if kolla_extra_aodh %} +####################### +# Extra configuration +####################### + +{{ kolla_extra_aodh }} +{% endif %} + diff --git a/ansible/roles/kolla-openstack/vars/main.yml b/ansible/roles/kolla-openstack/vars/main.yml index 4a98a8a62..207d3d9ad 100644 --- a/ansible/roles/kolla-openstack/vars/main.yml +++ b/ansible/roles/kolla-openstack/vars/main.yml @@ -9,6 +9,11 @@ # the destination, and will not be removed from the destination, even # if disabled or unexpected. kolla_openstack_custom_config: + # Aodh. + - src: "{{ kolla_extra_config_path }}/aodh" + dest: "{{ kolla_node_custom_config_path }}/aodh" + patterns: "*" + enabled: "{{ kolla_enable_aodh }}" # Barbican. - src: "{{ kolla_extra_config_path }}/barbican" dest: "{{ kolla_node_custom_config_path }}/barbican" diff --git a/doc/source/configuration/kolla-ansible.rst b/doc/source/configuration/kolla-ansible.rst index 0e94a6e7b..3ca225843 100644 --- a/doc/source/configuration/kolla-ansible.rst +++ b/doc/source/configuration/kolla-ansible.rst @@ -502,6 +502,8 @@ which files are supported. =============================== ======================================================= File Purpose =============================== ======================================================= + ``aodh.conf`` Aodh configuration. + ``aodh/*`` Extended Aodh configuration. ``backup.my.cnf`` Mariabackup configuration. ``barbican/*`` Extended Barbican configuration. ``blazar.conf`` Blazar configuration. diff --git a/releasenotes/notes/add-support-for-custom-aodh-conf-81a5a623f771d1c2.yaml b/releasenotes/notes/add-support-for-custom-aodh-conf-81a5a623f771d1c2.yaml new file mode 100644 index 000000000..3882de514 --- /dev/null +++ b/releasenotes/notes/add-support-for-custom-aodh-conf-81a5a623f771d1c2.yaml @@ -0,0 +1,3 @@ +--- +features: + - Adds support for custom Aodh configuration.