From 4bdc86e009eb88d5f2e8e400ae7c2cfeeee13e29 Mon Sep 17 00:00:00 2001 From: Kevin Carter Date: Wed, 18 Oct 2017 21:49:41 -0500 Subject: [PATCH] Fix Ceilometer deployments When deploying ceilometer and swift the both ceilometer and swift need access to a few shared variables. This change uses the established pattern which proxies the shared options through localhost hostvars which allows the respective roles and playbooks to inherited the required options. Change-Id: I4cb12cbf0063928e52657125b007bbeaf175de19 Signed-off-by: Kevin Carter --- group_vars/ceilometer_all.yml | 10 ++++++++-- group_vars/swift_all.yml | 12 ++++++++---- host_vars/localhost/ceilometer.yml | 17 +++++++++++++++++ host_vars/localhost/swift.yml | 19 +++++++++++++++++++ 4 files changed, 52 insertions(+), 6 deletions(-) create mode 100644 host_vars/localhost/ceilometer.yml create mode 100644 host_vars/localhost/swift.yml diff --git a/group_vars/ceilometer_all.yml b/group_vars/ceilometer_all.yml index 8a51b759e2..da880f2a3e 100644 --- a/group_vars/ceilometer_all.yml +++ b/group_vars/ceilometer_all.yml @@ -13,8 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. -ceilometer_service_user_name: ceilometer -ceilometer_service_tenant_name: service +ceilometer_service_user_name: "{{ hostvars['localhost']['ceilometer_service_user_name'] }}" +ceilometer_service_tenant_name: "{{ hostvars['localhost']['ceilometer_service_tenant_name'] }}" # These are here rather than in ceilometer_all because # both the os_ceilometer and os_swift roles require them @@ -46,3 +46,9 @@ ceilometer_venv_download_url: "{{ venv_base_download_url }}/ceilometer-{{ openst # locations for fetching the default files from the git source ceilometer_git_config_lookup_location: "{{ openstack_repo_url }}/openstackgit/ceilometer" + +# Swift vars used when swift is enabled +swift_system_user_name: "{{ hostvars['localhost']['swift_system_user_name'] }}" +swift_system_shell: "{{ hostvars['localhost']['swift_system_shell'] }}" +swift_system_comment: "{{ hostvars['localhost']['swift_system_comment'] }}" +swift_system_home_folder: "{{ hostvars['localhost']['swift_system_home_folder'] }}" diff --git a/group_vars/swift_all.yml b/group_vars/swift_all.yml index adc8b129d9..8e86a5bf78 100644 --- a/group_vars/swift_all.yml +++ b/group_vars/swift_all.yml @@ -14,10 +14,10 @@ # limitations under the License. swift_proxy_port: 8080 -swift_system_user_name: swift -swift_system_shell: /bin/bash -swift_system_comment: swift system user -swift_system_home_folder: "/var/lib/{{ swift_system_user_name }}" +swift_system_user_name: "{{ hostvars['localhost']['swift_system_user_name'] }}" +swift_system_shell: "{{ hostvars['localhost']['swift_system_shell'] }}" +swift_system_comment: "{{ hostvars['localhost']['swift_system_comment'] }}" +swift_system_home_folder: "{{ hostvars['localhost']['swift_system_home_folder'] }}" # Swift Telemetry notifications swift_rabbitmq_telemetry_userid: "swift" @@ -44,3 +44,7 @@ swift_gnocchi_enabled: "{{ (groups['gnocchi_all'] is defined and groups['gnocchi # venv fetch configuration swift_venv_tag: "{{ venv_tag }}" swift_venv_download_url: "{{ venv_base_download_url }}/swift-{{ openstack_release }}-{{ ansible_architecture | lower }}.tgz" + +# Ceilometer vars used when ceilometer is enabled +ceilometer_service_user_name: "{{ hostvars['localhost']['ceilometer_service_user_name'] }}" +ceilometer_service_tenant_name: "{{ hostvars['localhost']['ceilometer_service_tenant_name'] }}" diff --git a/host_vars/localhost/ceilometer.yml b/host_vars/localhost/ceilometer.yml new file mode 100644 index 0000000000..74d963f648 --- /dev/null +++ b/host_vars/localhost/ceilometer.yml @@ -0,0 +1,17 @@ +--- +# Copyright 2017, Rackspace US, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +ceilometer_service_user_name: ceilometer +ceilometer_service_tenant_name: service diff --git a/host_vars/localhost/swift.yml b/host_vars/localhost/swift.yml new file mode 100644 index 0000000000..50ca2aff1b --- /dev/null +++ b/host_vars/localhost/swift.yml @@ -0,0 +1,19 @@ +--- +# Copyright 2017, Rackspace US, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +swift_system_user_name: swift +swift_system_shell: /bin/bash +swift_system_comment: swift system user +swift_system_home_folder: "/var/lib/{{ swift_system_user_name }}"