Introduce a playbook for deploying Gnocchi

As the next step in integrating Gnocchi, this playbook installs the
gnocchi role. The role is enabled for the gate by default, but can
be disabled consistent with other roles. It is also included in
the setup-openstack.yml playbook so that linters run on the
playbook.

Change-Id: I2e8b32f1cc6830c479da418b04896f273c5b2b86
Depends-On: I0eb60ef7a31d873ba70c353138da252284389f28
Partial-Blueprint: role-gnocchi
This commit is contained in:
Steve Lewis 2016-06-01 15:27:44 -07:00
parent 58f262d73d
commit 14f66504b2
12 changed files with 244 additions and 0 deletions

View File

@ -66,6 +66,10 @@
scm: git
src: https://git.openstack.org/openstack/openstack-ansible-os_glance
version: master
- name: os_gnocchi
src: https://git.openstack.org/openstack/openstack-ansible-os_gnocchi
scm: git
version: master
- name: os_heat
scm: git
src: https://git.openstack.org/openstack/openstack-ansible-os_heat

View File

@ -0,0 +1,19 @@
---
# Copyright 2015, 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.
metrics_hosts:
aio1:
ip: 172.29.236.100

View File

@ -67,6 +67,10 @@ glance_service_password:
glance_profiler_hmac_key:
glance_rabbitmq_password:
## Gnocchi Options:
gnocchi_galera_password:
gnocchi_service_password:
## Heat Options
heat_stack_domain_admin_password:
heat_container_mysql_password:

View File

@ -59,6 +59,12 @@ glance_git_install_branch: 8dd23d0b9c7ca9bb521f56407f6f601db84771f9 # HEAD of "m
glance_git_dest: "/opt/glance_{{ glance_git_install_branch | replace('/', '_') }}"
## Gnocchi service
gnocchi_git_repo: https://git.openstack.org/openstack/gnocchi
gnocchi_git_install_branch: 27e52986cf716111dded4761665f02983bc2b366 # HEAD of "master" as of 27.06.2016
gnocchi_git_dest: "/opt/gnocchi_{{ gnocchi_git_install_branch | replace('/', '_') }}"
## Heat service
heat_git_repo: https://git.openstack.org/openstack/heat
heat_git_install_branch: e4c09815e9557e5f93785e8a49db3c41be1d7892 # HEAD of "master" as of 02.06.2016

View File

@ -0,0 +1,41 @@
---
# Copyright 2015, 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.
component_skel:
gnocchi_api:
belongs_to:
- gnocchi_all
gnocchi_metricd:
belongs_to:
- gnocchi_all
container_skel:
gnocchi_container:
belongs_to:
- metrics_containers
contains:
- gnocchi_api
- gnocchi_metricd
properties:
service_name: gnocchi
physical_skel:
metrics_containers:
belongs_to:
- all_containers
metrics_hosts:
belongs_to:
- hosts

View File

@ -0,0 +1,22 @@
---
# Copyright 2016, 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.
gnocchi_service_port: 8041
gnocchi_service_proto: http
gnocchi_service_internaluri_proto: "{{ openstack_service_internaluri_proto | default(gnocchi_service_proto) }}"
gnocchi_service_internalurl: "{{ gnocchi_service_internaluri_proto }}://{{ internal_lb_vip_address }}:{{ gnocchi_service_port }}"
gnocchi_ssl_external: "{{ openstack_external_ssl }}"
gnocchi_service_region: "{{ service_region }}"

View File

@ -0,0 +1,123 @@
---
# 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 Gnocchi components
hosts: gnocchi_all
max_fail_percentage: 20
user: root
pre_tasks:
- name: Use the lxc-openstack aa profile
lxc_container:
name: "{{ container_name }}"
container_config:
- "lxc.aa_profile=lxc-openstack"
delegate_to: "{{ physical_host }}"
when: not is_metal | bool
register: container_config
tags:
- lxc-aa-profile
- name: Wait for container ssh
wait_for:
port: "22"
delay: "{{ ssh_delay }}"
search_regex: "OpenSSH"
host: "{{ ansible_ssh_host }}"
delegate_to: "{{ physical_host }}"
when: container_config is defined and container_config | changed
register: ssh_wait_check
until: ssh_wait_check | success
retries: 3
tags:
- ssh-wait
- name: Gnocchi extra lxc config
lxc_container:
name: "{{ container_name }}"
container_command: |
[[ ! -d "/var/lib/gnocchi" ]] && mkdir -p "/var/lib/gnocchi"
container_config:
- "lxc.mount.entry=/openstack/{{ container_name }} var/lib/gnocchi none bind 0 0"
delegate_to: "{{ physical_host }}"
when: >
(not is_metal | bool) and gnocchi_storage_driver is not defined or
(gnocchi_storage_driver == "file")
register: container_extra_config
tags:
-gnocchi-storage-dir
- name: Create log dir
file:
path: "{{ item.path }}"
state: directory
with_items:
- { path: "/openstack/log/{{ inventory_hostname }}-gnocchi" }
when: is_metal | bool
tags:
- gnocchi-logs
- gnocchi-log-dirs
- name: Create log aggregation links
file:
src: "/openstack/log/{{ inventory_hostname }}-gnocchi"
dest: "/var/log/gnocchi"
state: "link"
force: "yes"
when: is_metal | bool
tags:
- gnocchi-logs
- name: Create DB for service
mysql_db:
login_user: "{{ galera_root_user }}"
login_password: "{{ galera_root_password }}"
login_host: "{{ gnocchi_galera_address }}"
name: "{{ gnocchi_galera_database }}"
state: "present"
when: inventory_hostname == groups['gnocchi_all'][0]
delegate_to: "{{ groups['galera_all'][0] }}"
tags:
- mysql-db-setup
- name: Grant access to the DB for the service
mysql_user:
login_user: "{{ galera_root_user }}"
login_password: "{{ galera_root_password }}"
login_host: "{{ gnocchi_galera_address }}"
name: "{{ gnocchi_galera_user }}"
password: "{{ gnocchi_galera_password }}"
host: "{{ item }}"
state: "present"
priv: "{{ gnocchi_galera_database }}.*:ALL"
when: inventory_hostname == groups['gnocchi_all'][0]
delegate_to: "{{ groups['galera_all'][0] }}"
with_items:
- "localhost"
- "%"
tags:
- mysql-db-setup
roles:
- role: "os_gnocchi"
gnocchi_venv_tag: "{{ openstack_release }}"
gnocchi_venv_download_url: "{{ openstack_repo_url }}/venvs/{{ openstack_release }}/{{ ansible_distribution | lower }}/gnocchi-{{ openstack_release }}.tgz"
pip_lock_to_internal_repo: "{{ (pip_links | length) >= 1 }}"
tags:
- "os-gnocchi"
- { role: "openstack_openrc", tags: [ "openstack-openrc" ] }
- role: "rsyslog_client"
rsyslog_client_log_rotate_file: gnocchi_log_rotate
rsyslog_client_log_dir: "/var/log/gnocchi"
rsyslog_client_config_name: "99-gnocchi-rsyslog-client.conf"
tags:
- "gnocchi-rsyslog-client"
vars:
is_metal: "{{ properties.is_metal|default(false) }}"
gnocchi_galera_user: gnocchi
gnocchi_galera_database: gnocchi
gnocchi_galera_address: "{{ galera_address }}"

View File

@ -23,4 +23,5 @@
- include: os-ceilometer-install.yml
- include: os-aodh-install.yml
- include: os-swift-install.yml
- include: os-gnocchi-install.yml
- include: os-ironic-install.yml

View File

@ -132,6 +132,7 @@
- python-novaclient
- python-ironicclient
- python-swiftclient
- gnocchiclient
- python-memcached
- pycrypto
is_metal: "{{ properties.is_metal|default(false) }}"

View File

@ -55,6 +55,14 @@ haproxy_default_services:
- 192.168.0.0/16
- 172.16.0.0/12
- 10.0.0.0/8
- service:
haproxy_service_name: gnocchi
haproxy_backend_nodes: "{{ groups['gnocchi_all'] | default([]) }}"
haproxy_port: 8041
haproxy_ssl: "{{ haproxy_ssl }}"
haproxy_balance_type: http
haproxy_backend_options:
- "httpchk /healthcheck"
- service:
haproxy_service_name: heat_api_cfn
haproxy_backend_nodes: "{{ groups['heat_api_cfn'] | default([]) }}"

View File

@ -0,0 +1,9 @@
---
features:
- Gnocchi is available for deploy as a metrics storage
service. At this time it does not integrate with Aodh
or Ceilometer. To deploy Aodh or Ceilometer to use
Gnocchi as a storage / query API, each must be
configured appropriately with the use of overrides as
described in the configuration guides for each of
these services.

View File

@ -106,6 +106,10 @@ class TestAnsibleInventoryFormatConstraints(unittest.TestCase):
'glance_api',
'glance_container',
'glance_registry',
'gnocchi_all',
'gnocchi_api',
'gnocchi_container',
'gnocchi_metricd',
'haproxy',
'haproxy_all',
'haproxy_container',
@ -155,6 +159,8 @@ class TestAnsibleInventoryFormatConstraints(unittest.TestCase):
'metering-compute_hosts',
'metering-infra_containers',
'metering-infra_hosts',
'metrics_containers',
'metrics_hosts',
'network_all',
'network_containers',
'network_hosts',