From 58f856fd00d4ef291d9043f008cb32fba6b2fda1 Mon Sep 17 00:00:00 2001 From: Pierre Riteau Date: Fri, 31 May 2019 16:32:16 +0100 Subject: [PATCH] Add support for custom Ceilometer configuration Change-Id: I0a9e1a3b878231f9ce7bf295b5526c9cfabbbf9e Story: 2005811 Task: 33551 --- ansible/kolla-openstack.yml | 2 ++ ansible/roles/kolla-openstack/defaults/main.yml | 9 +++++++++ .../molecule/enable-everything/molecule.yml | 4 ++++ ansible/roles/kolla-openstack/tasks/config.yml | 1 + .../roles/kolla-openstack/templates/ceilometer.conf.j2 | 9 +++++++++ ansible/roles/kolla-openstack/vars/main.yml | 5 +++++ doc/source/configuration/kolla-ansible.rst | 2 ++ ...port-for-custom-ceilometer-conf-66d907cf3c7ec29b.yaml | 3 +++ 8 files changed, 35 insertions(+) create mode 100644 ansible/roles/kolla-openstack/templates/ceilometer.conf.j2 create mode 100644 releasenotes/notes/add-support-for-custom-ceilometer-conf-66d907cf3c7ec29b.yaml diff --git a/ansible/kolla-openstack.yml b/ansible/kolla-openstack.yml index 8f3bbef1e..14a7d63a8 100644 --- a/ansible/kolla-openstack.yml +++ b/ansible/kolla-openstack.yml @@ -101,6 +101,7 @@ register: stat_result with_items: - { name: blazar, file: blazar.conf } + - { name: ceilometer, file: ceilometer.conf } - { name: ceph, file: ceph.conf } - { name: cinder, file: cinder.conf } - { name: designate, file: designate.conf } @@ -207,6 +208,7 @@ token: fake-token # Extra free-form user-provided configuration. kolla_extra_blazar: "{{ kolla_extra_config.blazar | default }}" + 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_designate: "{{ kolla_extra_config.designate | default }}" diff --git a/ansible/roles/kolla-openstack/defaults/main.yml b/ansible/roles/kolla-openstack/defaults/main.yml index d429b830d..ef9b92916 100644 --- a/ansible/roles/kolla-openstack/defaults/main.yml +++ b/ansible/roles/kolla-openstack/defaults/main.yml @@ -20,6 +20,15 @@ kolla_enable_blazar: # Free form extra configuration to append to blazar.conf. kolla_extra_blazar: +############################################################################### +# Ceilometer configuration. + +# Whether to enable Ceilometer. +kolla_enable_ceilometer: + +# Free form extra configuration to append to ceilometer.conf. +kolla_extra_ceilometer: + ############################################################################### # ceph configuration. diff --git a/ansible/roles/kolla-openstack/molecule/enable-everything/molecule.yml b/ansible/roles/kolla-openstack/molecule/enable-everything/molecule.yml index d780edddc..e667fa911 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_blazar: | [extra-blazar.conf] foo=bar + kolla_enable_ceilometer: true + kolla_extra_ceilometer: | + [extra-ceilometer.conf] + foo=bar kolla_enable_ceph: true kolla_extra_ceph: | [extra-ceph.conf] diff --git a/ansible/roles/kolla-openstack/tasks/config.yml b/ansible/roles/kolla-openstack/tasks/config.yml index 6b10668d2..a1e02686f 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: 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 }}" } - { src: cinder.conf.j2, dest: cinder.conf, enabled: "{{ kolla_enable_cinder }}" } - { src: designate.conf.j2, dest: designate.conf, enabled: "{{ kolla_enable_designate }}" } diff --git a/ansible/roles/kolla-openstack/templates/ceilometer.conf.j2 b/ansible/roles/kolla-openstack/templates/ceilometer.conf.j2 new file mode 100644 index 000000000..5a9187e19 --- /dev/null +++ b/ansible/roles/kolla-openstack/templates/ceilometer.conf.j2 @@ -0,0 +1,9 @@ +# {{ ansible_managed }} + +{% if kolla_extra_ceilometer %} +####################### +# Extra configuration +####################### + +{{ kolla_extra_ceilometer }} +{% endif %} diff --git a/ansible/roles/kolla-openstack/vars/main.yml b/ansible/roles/kolla-openstack/vars/main.yml index b6d1214f0..5d29f83a2 100644 --- a/ansible/roles/kolla-openstack/vars/main.yml +++ b/ansible/roles/kolla-openstack/vars/main.yml @@ -19,6 +19,11 @@ kolla_openstack_custom_config: dest: "{{ kolla_node_custom_config_path }}/blazar" patterns: "*" enabled: "{{ kolla_enable_blazar }}" + # Ceilometer. + - src: "{{ kolla_extra_config_path }}/ceilometer" + dest: "{{ kolla_node_custom_config_path }}/ceilometer" + patterns: "*" + enabled: "{{ kolla_enable_ceilometer }}" # Ceph. - src: "{{ kolla_extra_config_path }}/ceph" dest: "{{ kolla_node_custom_config_path }}/ceph" diff --git a/doc/source/configuration/kolla-ansible.rst b/doc/source/configuration/kolla-ansible.rst index b2adc7201..27a8fc23b 100644 --- a/doc/source/configuration/kolla-ansible.rst +++ b/doc/source/configuration/kolla-ansible.rst @@ -153,6 +153,8 @@ which files are supported. ``barbican/*`` Extended Barbican configuration. ``blazar.conf`` Blazar configuration. ``blazar/*`` Extended Blazar configuration. + ``ceilometer.conf`` Ceilometer configuration. + ``ceilometer/*`` Extended Ceilometer configuration. ``ceph.conf`` Ceph configuration. ``ceph/*`` Extended Ceph configuration. ``cinder.conf`` Cinder configuration. diff --git a/releasenotes/notes/add-support-for-custom-ceilometer-conf-66d907cf3c7ec29b.yaml b/releasenotes/notes/add-support-for-custom-ceilometer-conf-66d907cf3c7ec29b.yaml new file mode 100644 index 000000000..2c92f677f --- /dev/null +++ b/releasenotes/notes/add-support-for-custom-ceilometer-conf-66d907cf3c7ec29b.yaml @@ -0,0 +1,3 @@ +--- +features: + - Adds support for custom Ceilometer configuration.