openstack-ansible/playbooks/os-ceilometer-install.yml
Travis Truman 75b36283fa Support multiple rabbitmq clusters
The rabbitmq-install play now supports a variable
inventory host group defined with *rabbitmq_host_group*.

This allows deployers to use the play to create multiple
RabbitMQ clusters using for example:

Typical infra cluster:

  openstack-ansible rabbitmq-install.yml

Second cluster for telemetry:

  openstack-ansible -e "rabbitmq_host_group=telemetry_rabbitmq_all" rabbitmq-install.yml

Many vars were moved from group-specific group_vars to the "all" group
as the ceilometer role/play requires the RabbitMQ details and telemetry enabled
state for all services that can potentially be monitored by ceilometer.

By default, the "telemetry cluster" and the "RPC" cluster are the same, but
deployers that wish to create multiple clusters are able to override the
*_rabbitmq_telemetry_* vars when choosing to run separate clusters.

Use case is more fully explained here:

http://trumant.github.io/openstack-ansible-multiple-rabbitmq-clusters.html

Change-Id: I737711085fc0e50c4c5a0ee7c2037927574f8448
Depends-On: Ib23c8829468bbb4ddae67e08a092240f54a6c729
Depends-On: Ifad921525897c5887f6ad6871c6d72c595d79fa6
Depends-On: I7cc5a5dac4299bd3d1bc810ea886f3888abaa2da
Depends-On: Ib3ee5b409dbc2fc2dc8d25990d4962ec49e21131
Depends-On: I397b56423d9ef6757bada27c92b7c9f0d5126cc9
Depends-On: I98cb273cbd8948072ef6e7fc5a15834093d70099
Depends-On: I89363b64ff3f41ee65d72ec51cb8062fc7bf08b0
Implements: blueprint multi-rabbitmq-clusters
2016-08-25 10:40:45 +00:00

57 lines
2.3 KiB
YAML

---
# Copyright 2014, 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.
- name: Install the ceilometer components
hosts: ceilometer_all
gather_facts: "{{ gather_facts | default(True) }}"
max_fail_percentage: 20
user: root
pre_tasks:
- include: common-tasks/rabbitmq-servers-sort.yml
vars:
sort_group_name: "ceilometer_all"
- include: common-tasks/os-lxc-container-setup.yml
- include: common-tasks/rabbitmq-vhost-user.yml
vars:
user: "{{ ceilometer_rabbitmq_userid }}"
password: "{{ ceilometer_rabbitmq_password }}"
vhost: "{{ ceilometer_rabbitmq_vhost }}"
_rabbitmq_host_group: "{{ ceilometer_rabbitmq_host_group }}"
when:
- inventory_hostname == groups['ceilometer_api'][0]
- groups[ceilometer_rabbitmq_host_group] | length > 0
- include: common-tasks/os-log-dir-setup.yml
vars:
log_dirs:
- src: "/openstack/log/{{ inventory_hostname }}-ceilometer"
dest: "/var/log/ceilometer"
- include: common-tasks/package-cache-proxy.yml
roles:
- role: "os_ceilometer"
ceilometer_venv_tag: "{{ openstack_release }}"
ceilometer_venv_download_url: "{{ openstack_repo_url }}/venvs/{{ openstack_release }}/{{ ansible_distribution | lower }}/ceilometer-{{ openstack_release }}-{{ ansible_architecture | lower }}.tgz"
tags:
- "os-ceilometer"
- { role: "openstack_openrc", tags: [ "openstack-openrc" ] }
- role: "rsyslog_client"
rsyslog_client_log_rotate_file: ceilometer_log_rotate
rsyslog_client_log_dir: "/var/log/ceilometer"
rsyslog_client_config_name: "99-ceilometer-rsyslog-client.conf"
tags:
- "ceilometer-rsyslog-client"
vars:
is_metal: "{{ properties.is_metal|default(false) }}"
pip_lock_to_internal_repo: "{{ (pip_links | length) >= 1 }}"