From 30dacdf8af90815d696ff6abca76736eb95ca6f6 Mon Sep 17 00:00:00 2001 From: Jesse Pretorius Date: Fri, 22 Jul 2016 13:18:21 +0100 Subject: [PATCH] Dynamically determine whether ceilometer should be enabled Currently each service requires a var to be set to enable the configuration of ceilometer for the service. This patch makes this setting dynamic based on whether there are any hosts in the ceilometer_all host group. This reduces the amount of configuration required for an environment, making OSA simpler to use. The 'rabbitmq_servers' group_var was previously a list of 'host:port' combinations. It is now only a set of hosts. The new 'transport_url' configuration option for oslo_messaging is not working with SSL enabled, so SSL transport for RabbitMQ has been temporarily disabled. Change-Id: Ia5ba4e26b9adcfd923a93c6ea5077cbec0c4478d --- etc/openstack_deploy/user_variables.yml | 10 ---------- playbooks/inventory/group_vars/all.yml | 6 ++++-- playbooks/inventory/group_vars/cinder_all.yml | 3 +++ playbooks/inventory/group_vars/glance_all.yml | 3 +++ playbooks/inventory/group_vars/heat_all.yml | 3 +++ playbooks/inventory/group_vars/keystone_all.yml | 3 +++ playbooks/inventory/group_vars/neutron_all.yml | 5 ++++- playbooks/inventory/group_vars/nova_all.yml | 3 +++ playbooks/inventory/group_vars/swift_all.yml | 3 +++ ...dynamic-ceilometer-enablement-18be0bb994ede62a.yaml | 7 +++++++ .../bootstrap-host/templates/user_variables.aio.yml.j2 | 7 ------- 11 files changed, 33 insertions(+), 20 deletions(-) create mode 100644 releasenotes/notes/dynamic-ceilometer-enablement-18be0bb994ede62a.yaml diff --git a/etc/openstack_deploy/user_variables.yml b/etc/openstack_deploy/user_variables.yml index c87bbb6b6d..b1d4a789f3 100644 --- a/etc/openstack_deploy/user_variables.yml +++ b/etc/openstack_deploy/user_variables.yml @@ -26,16 +26,6 @@ debug: false # ceilometer_db_ip: localhost # ceilometer_db_port: 27017 -## Common Override to enable Ceilometer for each service. -## By default all service are *not* enabled. -# swift_ceilometer_enabled: True -# heat_ceilometer_enabled: True -# cinder_ceilometer_enabled: True -# glance_ceilometer_enabled: True -# nova_ceilometer_enabled: True -# neutron_ceilometer_enabled: True -# keystone_ceilometer_enabled: True - ## Common Glance Overrides # Set glance_default_store to "swift" if using Cloud Files or swift backend # or "rbd" if using ceph backend; the latter will trigger ceph to get diff --git a/playbooks/inventory/group_vars/all.yml b/playbooks/inventory/group_vars/all.yml index c5a825201a..144fed3fcf 100644 --- a/playbooks/inventory/group_vars/all.yml +++ b/playbooks/inventory/group_vars/all.yml @@ -55,8 +55,10 @@ galera_root_user: "root" ## RabbitMQ rabbitmq_port: "{{ (rabbitmq_use_ssl | bool) | ternary(5671, 5672) }}" -rabbitmq_servers: "{% for host in groups['rabbitmq_all'] %}{{ hostvars[host]['ansible_ssh_host'] }}:{{ rabbitmq_port }}{% if not loop.last %},{% endif %}{% endfor %}" -rabbitmq_use_ssl: true +rabbitmq_servers: "{% for host in groups['rabbitmq_all'] %}{{ hostvars[host]['ansible_ssh_host'] }}{% if not loop.last %},{% endif %}{% endfor %}" +# TODO(odyssey4me) +# The new transport_url configuration option is not working with SSL enabled. Revisit this ASAP. +rabbitmq_use_ssl: false ## Enable external SSL handling for general OpenStack services openstack_external_ssl: true diff --git a/playbooks/inventory/group_vars/cinder_all.yml b/playbooks/inventory/group_vars/cinder_all.yml index f45b05d58d..44d98e4c95 100644 --- a/playbooks/inventory/group_vars/cinder_all.yml +++ b/playbooks/inventory/group_vars/cinder_all.yml @@ -19,3 +19,6 @@ cinder_service_region: "{{ service_region }}" cinder_service_in_ldap: "{{ service_ldap_backend_enabled }}" cinder_glance_api_servers: "{{ glance_api_servers }}" cinder_glance_api_version: "{{ (cinder_backends_rbd_inuse|bool and glance_default_store == 'rbd') | ternary('2','1') }}" + +# If there are any Ceilometer hosts in the environment, then enable its usage +cinder_ceilometer_enabled: "{{ (groups['ceilometer_all'] is defined) and (groups['ceilometer_all'] | length > 0) }}" diff --git a/playbooks/inventory/group_vars/glance_all.yml b/playbooks/inventory/group_vars/glance_all.yml index d3ab4cd3d9..ca8017f59d 100644 --- a/playbooks/inventory/group_vars/glance_all.yml +++ b/playbooks/inventory/group_vars/glance_all.yml @@ -15,3 +15,6 @@ glance_service_region: "{{ service_region }}" glance_service_in_ldap: "{{ service_ldap_backend_enabled }}" + +# If there are any Ceilometer hosts in the environment, then enable its usage +glance_ceilometer_enabled: "{{ (groups['ceilometer_all'] is defined) and (groups['ceilometer_all'] | length > 0) }}" diff --git a/playbooks/inventory/group_vars/heat_all.yml b/playbooks/inventory/group_vars/heat_all.yml index 6e8d15925f..05e4150463 100644 --- a/playbooks/inventory/group_vars/heat_all.yml +++ b/playbooks/inventory/group_vars/heat_all.yml @@ -15,3 +15,6 @@ heat_service_region: "{{ service_region }}" heat_service_in_ldap: "{{ service_ldap_backend_enabled }}" + +# If there are any Ceilometer hosts in the environment, then enable its usage +heat_ceilometer_enabled: "{{ (groups['ceilometer_all'] is defined) and (groups['ceilometer_all'] | length > 0) }}" diff --git a/playbooks/inventory/group_vars/keystone_all.yml b/playbooks/inventory/group_vars/keystone_all.yml index caf6347822..5e7fa438c2 100644 --- a/playbooks/inventory/group_vars/keystone_all.yml +++ b/playbooks/inventory/group_vars/keystone_all.yml @@ -18,3 +18,6 @@ keystone_external_ssl: "{{ openstack_external_ssl }}" keystone_cache_backend_argument: "url:{% for host in groups['memcached'] %}{{ hostvars[host]['container_address'] }}{% if not loop.last %},{% endif %}{% endfor %}:{{ memcached_port }}" keystone_memcached_servers: "{% for host in groups['keystone_all'] %}{{ hostvars[host]['container_address'] }}:{{ memcached_port }}{% if not loop.last %},{% endif %}{% endfor %}" keystone_service_in_ldap: "{{ service_ldap_backend_enabled }}" + +# If there are any Ceilometer hosts in the environment, then enable its usage +keystone_ceilometer_enabled: "{{ (groups['ceilometer_all'] is defined) and (groups['ceilometer_all'] | length > 0) }}" diff --git a/playbooks/inventory/group_vars/neutron_all.yml b/playbooks/inventory/group_vars/neutron_all.yml index 9e88ed9bae..5bf5c415b3 100644 --- a/playbooks/inventory/group_vars/neutron_all.yml +++ b/playbooks/inventory/group_vars/neutron_all.yml @@ -24,4 +24,7 @@ neutron_rabbitmq_userid: neutron neutron_rabbitmq_vhost: /neutron neutron_rabbitmq_port: "{{ rabbitmq_port }}" neutron_rabbitmq_servers: "{{ rabbitmq_servers }}" -neutron_rabbitmq_use_ssl: "{{ rabbitmq_use_ssl }}" \ No newline at end of file +neutron_rabbitmq_use_ssl: "{{ rabbitmq_use_ssl }}" + +# If there are any Ceilometer hosts in the environment, then enable its usage +neutron_ceilometer_enabled: "{{ (groups['ceilometer_all'] is defined) and (groups['ceilometer_all'] | length > 0) }}" diff --git a/playbooks/inventory/group_vars/nova_all.yml b/playbooks/inventory/group_vars/nova_all.yml index 6588f0c668..b4fc00b057 100644 --- a/playbooks/inventory/group_vars/nova_all.yml +++ b/playbooks/inventory/group_vars/nova_all.yml @@ -18,3 +18,6 @@ nova_ceph_client_uuid: '{{ cinder_ceph_client_uuid | default() }}' nova_dhcp_domain: "{{ dhcp_domain }}" nova_service_in_ldap: "{{ service_ldap_backend_enabled }}" nova_glance_api_servers: "{{ glance_api_servers }}" + +# If there are any Ceilometer hosts in the environment, then enable its usage +nova_ceilometer_enabled: "{{ (groups['ceilometer_all'] is defined) and (groups['ceilometer_all'] | length > 0) }}" diff --git a/playbooks/inventory/group_vars/swift_all.yml b/playbooks/inventory/group_vars/swift_all.yml index 1c52344323..ddfef42988 100644 --- a/playbooks/inventory/group_vars/swift_all.yml +++ b/playbooks/inventory/group_vars/swift_all.yml @@ -15,3 +15,6 @@ swift_service_region: "{{ service_region }}" swift_service_in_ldap: "{{ service_ldap_backend_enabled }}" + +# If there are any Ceilometer hosts in the environment, then enable its usage +swift_ceilometer_enabled: "{{ (groups['ceilometer_all'] is defined) and (groups['ceilometer_all'] | length > 0) }}" diff --git a/releasenotes/notes/dynamic-ceilometer-enablement-18be0bb994ede62a.yaml b/releasenotes/notes/dynamic-ceilometer-enablement-18be0bb994ede62a.yaml new file mode 100644 index 0000000000..77c6c72d61 --- /dev/null +++ b/releasenotes/notes/dynamic-ceilometer-enablement-18be0bb994ede62a.yaml @@ -0,0 +1,7 @@ +--- +features: + - Whether ceilometer should be enabled by default for each service + is now dynamically determined based on whether there are any + ceilometer hosts/containers deployed. This behaviour can still + be overridden by toggling ``_ceilometer_enabled`` in + ``/etc/openstack_deploy/user_variables.yml``. diff --git a/tests/roles/bootstrap-host/templates/user_variables.aio.yml.j2 b/tests/roles/bootstrap-host/templates/user_variables.aio.yml.j2 index 7a835df04e..eed60fd579 100644 --- a/tests/roles/bootstrap-host/templates/user_variables.aio.yml.j2 +++ b/tests/roles/bootstrap-host/templates/user_variables.aio.yml.j2 @@ -20,13 +20,6 @@ debug: True ceilometer_db_type: mongodb ceilometer_db_ip: {{ bootstrap_host_mongodb_address }} ceilometer_db_port: 27017 -cinder_ceilometer_enabled: True -glance_ceilometer_enabled: True -heat_ceilometer_enabled: True -neutron_ceilometer_enabled: True -nova_ceilometer_enabled: True -swift_ceilometer_enabled: False -keystone_ceilometer_enabled: True ## Aodh Options aodh_db_type: mongodb