From 6bd8f3c17b1eba37f42a397c292a265ea33b02a6 Mon Sep 17 00:00:00 2001 From: Andy McCrae Date: Wed, 31 Aug 2016 16:16:35 +0100 Subject: [PATCH] Add vars for Swift telemetry settings Since adding the name spaced telemetry vars for swift in: https://review.openstack.org/#/c/363644/ We need to adjust the openstack-ansible repository to reflect these changes. Additionally, we need to add a task that will setup the rabbitmq user/vhost when using ceilometer with swift. Change-Id: I74d0d7dec19abb525837e65d1354091cdd3cd0f2 --- etc/openstack_deploy/user_secrets.yml | 2 ++ playbooks/inventory/group_vars/all.yml | 12 ++++++++++++ playbooks/inventory/group_vars/swift_all.yml | 3 --- playbooks/os-swift-install.yml | 10 ++++++++++ 4 files changed, 24 insertions(+), 3 deletions(-) diff --git a/etc/openstack_deploy/user_secrets.yml b/etc/openstack_deploy/user_secrets.yml index fb667a77ca..a48383db84 100644 --- a/etc/openstack_deploy/user_secrets.yml +++ b/etc/openstack_deploy/user_secrets.yml @@ -119,6 +119,8 @@ swift_dispersion_password: ### Once the swift cluster has been setup DO NOT change these hash values! swift_hash_path_suffix: swift_hash_path_prefix: +# Swift needs a telemetry password when using ceilometer +swift_rabbitmq_telemetry_password: ## haproxy stats password haproxy_stats_password: diff --git a/playbooks/inventory/group_vars/all.yml b/playbooks/inventory/group_vars/all.yml index e08d3edd0d..01bc0e77fe 100644 --- a/playbooks/inventory/group_vars/all.yml +++ b/playbooks/inventory/group_vars/all.yml @@ -379,6 +379,18 @@ swift_system_shell: /bin/bash swift_system_comment: swift system user swift_system_home_folder: "/var/lib/{{ swift_system_user_name }}" +# Swift Telemetry notifications +swift_rabbitmq_telemetry_userid: "swift" +swift_rabbitmq_telemetry_vhost: "/swift" +swift_rabbitmq_telemetry_servers: "{{ rabbitmq_servers }}" +# TODO: (andymccr) ceilometer with swift does not support SSL rabbitmq connections, so we are hard coding the port and use_ssl var +swift_rabbitmq_telemetry_port: "5672" +swift_rabbitmq_use_ssl: False +swift_rabbitmq_telemetry_host_group: "{{ rabbitmq_host_group }}" + +# If there are any Ceilometer and Swift hosts in the environment, then enable its usage +swift_ceilometer_enabled: "{{ (groups['ceilometer_all'] is defined) and (groups['swift_proxy'] is defined) and (groups['ceilometer_all'] | length > 0) and (groups['swift_proxy'] | length > 0) }}" + ## OpenStack Openrc openrc_os_auth_url: "{{ keystone_service_internalurl }}" openrc_os_password: "{{ keystone_auth_admin_password }}" diff --git a/playbooks/inventory/group_vars/swift_all.yml b/playbooks/inventory/group_vars/swift_all.yml index 8e54723a5b..5ada9bef4b 100644 --- a/playbooks/inventory/group_vars/swift_all.yml +++ b/playbooks/inventory/group_vars/swift_all.yml @@ -16,8 +16,5 @@ 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) }}" - # Ensure that the package state matches the global setting swift_package_state: "{{ package_state }}" diff --git a/playbooks/os-swift-install.yml b/playbooks/os-swift-install.yml index 93b93a4c8b..c013ad5533 100644 --- a/playbooks/os-swift-install.yml +++ b/playbooks/os-swift-install.yml @@ -99,6 +99,16 @@ - inventory_hostname in groups['swift_all'] - hostvars[inventory_hostname]['container_networks']['replication_address']['address'] is undefined - not is_metal | bool + # If we're using ceilometer then swift needs a rabbitmq/vhost & usera + - include: common-tasks/rabbitmq-vhost-user.yml + vars: + user: "{{ swift_rabbitmq_telemetry_userid }}" + password: "{{ swift_rabbitmq_telemetry_password }}" + vhost: "{{ swift_rabbitmq_telemetry_vhost }}" + _rabbitmq_host_group: "{{ swift_rabbitmq_telemetry_host_group }}" + when: + - swift_ceilometer_enabled | bool + - inventory_hostname == groups['swift_all'][0] roles: - role: "os_swift" swift_venv_tag: "{{ openstack_release }}"