From ffb7f96e16e57020130bddf2371d70966b572d4f Mon Sep 17 00:00:00 2001 From: Pierre Riteau Date: Sat, 27 Jul 2019 15:58:43 +0200 Subject: [PATCH] Add support for custom CloudKitty configuration Change-Id: I0c0589387da53458f41df280dff0179715448aaa Story: 2006292 Task: 36003 --- ansible/group_vars/all/kolla | 3 +++ ansible/kolla-openstack.yml | 2 ++ ansible/roles/kolla-openstack/defaults/main.yml | 9 +++++++++ .../molecule/default/tests/test_default.py | 1 + .../molecule/enable-everything/molecule.yml | 4 ++++ .../molecule/enable-everything/tests/test_default.py | 2 ++ ansible/roles/kolla-openstack/tasks/config.yml | 1 + .../roles/kolla-openstack/templates/cloudkitty.conf.j2 | 9 +++++++++ ansible/roles/kolla-openstack/vars/main.yml | 5 +++++ doc/source/configuration/kolla-ansible.rst | 2 ++ ...port-for-custom-cloudkitty-conf-af224caad9cd1ad4.yaml | 3 +++ 11 files changed, 41 insertions(+) create mode 100644 ansible/roles/kolla-openstack/templates/cloudkitty.conf.j2 create mode 100644 releasenotes/notes/add-support-for-custom-cloudkitty-conf-af224caad9cd1ad4.yaml diff --git a/ansible/group_vars/all/kolla b/ansible/group_vars/all/kolla index fc3a42e85..177f1b3fa 100644 --- a/ansible/group_vars/all/kolla +++ b/ansible/group_vars/all/kolla @@ -122,6 +122,8 @@ overcloud_container_image_regex_map: enabled: "{{ kolla_enable_ceph | bool }}" - regex: cinder enabled: "{{ kolla_enable_cinder | bool }}" + - regex: cloudkitty + enabled: "{{ kolla_enable_cloudkitty | bool }}" - regex: collectd enabled: "{{ kolla_enable_collectd | bool }}" - regex: cron @@ -343,6 +345,7 @@ kolla_enable_ceilometer: "no" # on the host. Setting this to true will disable NTP on the host. kolla_enable_chrony: "no" kolla_enable_cinder: "no" +kolla_enable_cloudkitty: "no" kolla_enable_collectd: "no" kolla_enable_designate: "no" kolla_enable_elasticsearch: "{{ 'yes' if kolla_enable_central_logging | bool or kolla_enable_freezer | bool or kolla_enable_osprofiler | bool or kolla_enable_skydive | bool or kolla_enable_monasca | bool else 'no' }}" diff --git a/ansible/kolla-openstack.yml b/ansible/kolla-openstack.yml index 58c05c575..3cddbabf4 100644 --- a/ansible/kolla-openstack.yml +++ b/ansible/kolla-openstack.yml @@ -106,6 +106,7 @@ - { name: ceilometer, file: ceilometer.conf } - { name: ceph, file: ceph.conf } - { name: cinder, file: cinder.conf } + - { name: cloudkitty, file: cloudkitty.conf } - { name: designate, file: designate.conf } - { name: glance, file: glance.conf } - { name: global, file: global.conf } @@ -215,6 +216,7 @@ kolla_extra_ceilometer: "{{ kolla_extra_config.ceilometer | default }}" kolla_extra_ceph: "{{ kolla_extra_config.ceph | default }}" kolla_extra_cinder: "{{ kolla_extra_config.cinder | default }}" + kolla_extra_cloudkitty: "{{ kolla_extra_config.cloudkitty | default }}" kolla_extra_designate: "{{ kolla_extra_config.designate | default }}" kolla_extra_glance: "{{ kolla_extra_config.glance | default }}" kolla_extra_global: "{{ kolla_extra_config.global | default }}" diff --git a/ansible/roles/kolla-openstack/defaults/main.yml b/ansible/roles/kolla-openstack/defaults/main.yml index 3e659a688..77828a6e0 100644 --- a/ansible/roles/kolla-openstack/defaults/main.yml +++ b/ansible/roles/kolla-openstack/defaults/main.yml @@ -53,6 +53,15 @@ kolla_enable_cinder: # Free form extra configuration to append to cinder.conf. kolla_extra_cinder: +############################################################################### +# CloudKitty configuration. + +# Whether to enable CloudKitty. +kolla_enable_cloudkitty: + +# Free form extra configuration to append to cloudkitty.conf. +kolla_extra_cloudkitty: + ############################################################################### # designate 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 093efafaa..113c35442 100644 --- a/ansible/roles/kolla-openstack/molecule/default/tests/test_default.py +++ b/ansible/roles/kolla-openstack/molecule/default/tests/test_default.py @@ -39,6 +39,7 @@ def test_service_config_directory(host, path): 'path', ['ceph', 'cinder', + 'cloudkitty', 'designate', 'glance', 'grafana', diff --git a/ansible/roles/kolla-openstack/molecule/enable-everything/molecule.yml b/ansible/roles/kolla-openstack/molecule/enable-everything/molecule.yml index badae664e..d550d5bc2 100644 --- a/ansible/roles/kolla-openstack/molecule/enable-everything/molecule.yml +++ b/ansible/roles/kolla-openstack/molecule/enable-everything/molecule.yml @@ -30,6 +30,10 @@ provisioner: kolla_extra_cinder: | [extra-cinder.conf] foo=bar + kolla_enable_cloudkitty: true + kolla_extra_cloudkitty: | + [extra-cloudkitty.conf] + foo=bar kolla_enable_designate: true kolla_extra_designate: | [extra-designate.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 a5e08b87c..48c0406de 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 @@ -29,6 +29,7 @@ testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner( 'path', ['ceph', 'cinder', + 'cloudkitty', 'designate', 'fluentd/filter', 'fluentd/input', @@ -62,6 +63,7 @@ def test_service_config_directory(host, path): 'path', ['ceph.conf', 'cinder.conf', + 'cloudkitty.conf', 'designate.conf', 'galera.cnf', 'glance.conf', diff --git a/ansible/roles/kolla-openstack/tasks/config.yml b/ansible/roles/kolla-openstack/tasks/config.yml index 513261ac4..82cf5a4f3 100644 --- a/ansible/roles/kolla-openstack/tasks/config.yml +++ b/ansible/roles/kolla-openstack/tasks/config.yml @@ -17,6 +17,7 @@ - { src: ceilometer.conf.j2, dest: ceilometer.conf, enabled: "{{ kolla_enable_ceilometer }}" } - { src: ceph.conf.j2, dest: ceph.conf, enabled: "{{ kolla_enable_ceph }}" } - { src: cinder.conf.j2, dest: cinder.conf, enabled: "{{ kolla_enable_cinder }}" } + - { src: cloudkitty.conf.j2, dest: cloudkitty.conf, enabled: "{{ kolla_enable_cloudkitty }}" } - { src: designate.conf.j2, dest: designate.conf, enabled: "{{ kolla_enable_designate }}" } - { src: galera.cnf.j2, dest: galera.cnf, enabled: "{{ kolla_enable_mariadb }}" } - { src: glance.conf.j2, dest: glance.conf, enabled: "{{ kolla_enable_glance }}" } diff --git a/ansible/roles/kolla-openstack/templates/cloudkitty.conf.j2 b/ansible/roles/kolla-openstack/templates/cloudkitty.conf.j2 new file mode 100644 index 000000000..75929ef15 --- /dev/null +++ b/ansible/roles/kolla-openstack/templates/cloudkitty.conf.j2 @@ -0,0 +1,9 @@ +# {{ ansible_managed }} + +{% if kolla_extra_cloudkitty %} +####################### +# Extra configuration +####################### + +{{ kolla_extra_cloudkitty }} +{% endif %} diff --git a/ansible/roles/kolla-openstack/vars/main.yml b/ansible/roles/kolla-openstack/vars/main.yml index 642ad1170..982f82232 100644 --- a/ansible/roles/kolla-openstack/vars/main.yml +++ b/ansible/roles/kolla-openstack/vars/main.yml @@ -34,6 +34,11 @@ kolla_openstack_custom_config: dest: "{{ kolla_node_custom_config_path }}/cinder" patterns: "*" enabled: "{{ kolla_enable_cinder }}" + # CloudKitty. + - src: "{{ kolla_extra_config_path }}/cloudkitty" + dest: "{{ kolla_node_custom_config_path }}/cloudkitty" + patterns: "*" + enabled: "{{ kolla_enable_cloudkitty }}" # Designate. - src: "{{ kolla_extra_config_path }}/designate" dest: "{{ kolla_node_custom_config_path }}/designate" diff --git a/doc/source/configuration/kolla-ansible.rst b/doc/source/configuration/kolla-ansible.rst index ad059b269..600a35a3a 100644 --- a/doc/source/configuration/kolla-ansible.rst +++ b/doc/source/configuration/kolla-ansible.rst @@ -159,6 +159,8 @@ which files are supported. ``ceph/*`` Extended Ceph configuration. ``cinder.conf`` Cinder configuration. ``cinder/*`` Extended Cinder configuration. + ``cloudkitty.conf`` CloudKitty configuration. + ``cloudkitty/*`` Extended CloudKitty configuration. ``designate.conf`` Designate configuration. ``designate/*`` Extended Designate configuration. ``fluentd/filter`` Fluentd filter configuration. diff --git a/releasenotes/notes/add-support-for-custom-cloudkitty-conf-af224caad9cd1ad4.yaml b/releasenotes/notes/add-support-for-custom-cloudkitty-conf-af224caad9cd1ad4.yaml new file mode 100644 index 000000000..3889a6608 --- /dev/null +++ b/releasenotes/notes/add-support-for-custom-cloudkitty-conf-af224caad9cd1ad4.yaml @@ -0,0 +1,3 @@ +--- +features: + - Adds support for custom CloudKitty configuration.