Add gnocchi ansible role

Partially-Implements: blueprint ansible-gnocchi

Change-Id: I8dd0460bd21ac0a233fab0142ec7b6079459bdc2
This commit is contained in:
zhubingbing 2016-08-01 05:17:43 +00:00
parent 48ade16227
commit 89392f4f6a
31 changed files with 606 additions and 2 deletions

View File

@ -122,6 +122,8 @@ congress_api_port: "1789"
iscsi_port: "3260" iscsi_port: "3260"
gnocchi_api_port: "8041"
mariadb_port: "{{ database_port }}" mariadb_port: "{{ database_port }}"
mariadb_wsrep_port: "4567" mariadb_wsrep_port: "4567"
mariadb_ist_port: "4568" mariadb_ist_port: "4568"
@ -230,6 +232,7 @@ enable_ceph_rgw: "no"
enable_cinder: "no" enable_cinder: "no"
enable_cinder_backend_lvm: "no" enable_cinder_backend_lvm: "no"
enable_congress: "no" enable_congress: "no"
enable_gnocchi: "no"
enable_heat: "yes" enable_heat: "yes"
enable_horizon: "yes" enable_horizon: "yes"
enable_ironic: "no" enable_ironic: "no"

View File

@ -84,6 +84,9 @@ control
[manila:children] [manila:children]
control control
[gnocchi:children]
control
[ceilometer:children] [ceilometer:children]
control control
@ -256,6 +259,16 @@ aodh
[aodh-notifier:children] [aodh-notifier:children]
aodh aodh
# Gnocchi
[gnocchi-api:children]
gnocchi
[gnocchi-statsd:children]
gnocchi
[gnocchi-metricd:children]
gnocchi
# Ceilometer # Ceilometer
[ceilometer-api:children] [ceilometer-api:children]
ceilometer ceilometer

View File

@ -110,6 +110,9 @@ control
[congress:children] [congress:children]
control control
[gnocchi:children]
control
# Tempest # Tempest
[tempest:children] [tempest:children]
control control
@ -299,6 +302,16 @@ congress
[congress-policy-engine:children] [congress-policy-engine:children]
congress congress
# Gnocchi
[gnocchi-api:children]
gnocchi
[gnocchi-statsd:children]
gnocchi
[gnocchi-metricd:children]
gnocchi
# Multipathd # Multipathd
[multipathd:children] [multipathd:children]
compute compute

View File

@ -28,6 +28,7 @@
- { name: "aodh", enabled: "{{ enable_aodh }}" } - { name: "aodh", enabled: "{{ enable_aodh }}" }
- { name: "elasticsearch", enabled: "{{ enable_central_logging }}" } - { name: "elasticsearch", enabled: "{{ enable_central_logging }}" }
- { name: "global", enabled: "yes" } - { name: "global", enabled: "yes" }
- { name: "gnocchi", enabled: "{{ enable_gnocchi }}" }
- { name: "haproxy", enabled: "{{ enable_haproxy }}" } - { name: "haproxy", enabled: "{{ enable_haproxy }}" }
- { name: "horizon", enabled: "{{ enable_horizon }}" } - { name: "horizon", enabled: "{{ enable_horizon }}" }
- { name: "keepalived", enabled: "{{ enable_haproxy }}" } - { name: "keepalived", enabled: "{{ enable_haproxy }}" }
@ -71,6 +72,7 @@
- "cinder" - "cinder"
- "glance" - "glance"
- "global" - "global"
- "gnocchi"
- "haproxy" - "haproxy"
- "heat" - "heat"
- "keepalived" - "keepalived"

View File

@ -0,0 +1,3 @@
"/var/log/kolla/gnocchi/*.log"
{
}

View File

@ -1,5 +1,5 @@
{% set cron_cmd = 'cron -f' if kolla_base_distro in ['ubuntu', 'debian'] else 'crond -s -n' %} {% set cron_cmd = 'cron -f' if kolla_base_distro in ['ubuntu', 'debian'] else 'crond -s -n' %}
{% set services = ["ansible", "aodh", "cinder", "glance", "haproxy", "heat", "keepalived", "keystone", "magnum", "manila", "mariadb", "mistral", "murano", "neutron", "nova", "rabbitmq", "swift"] %} {% set services = ["ansible", "aodh", "cinder", "glance", "gnocchi", "haproxy", "heat", "keepalived", "keystone", "magnum", "manila", "mariadb", "mistral", "murano", "neutron", "nova", "rabbitmq", "swift"] %}
{ {
"command": "{{ cron_cmd }}", "command": "{{ cron_cmd }}",
"config_files": [ "config_files": [

View File

@ -0,0 +1,13 @@
[gnocchi_apache_log_decoder]
type = "SandboxDecoder"
filename = "lua_decoders/os_gnocchi_apache_log.lua"
[gnocchi_apache_log_decoder.config]
apache_log_pattern = '%{X-Forwarded-For}i %l %u %t \"%r\" %>s %b %D \"%{Referer}i\" \"%{User-Agent}i\"'
[gnocchi_apache_logstreamer_input]
type = "LogstreamerInput"
decoder = "gnocchi_apache_log_decoder"
log_directory = "/var/log/kolla"
file_match = 'gnocchi/gnocchi-apache-(?P<Service>.+)-access\.log\.?(?P<Seq>\d*)$'
priority = ["^Seq"]
differentiator = ["gnocchi-apache-", "Service"]

View File

@ -0,0 +1,39 @@
---
project_name: "gnocchi"
####################
# Database
####################
gnocchi_database_name: "gnocchi"
gnocchi_database_user: "gnocchi"
gnocchi_database_address: "{{ kolla_internal_fqdn }}:{{ database_port }}"
####################
# Docker
####################
gnocchi_api_image: "{{ docker_registry ~ '/' if docker_registry else '' }}{{ docker_namespace }}/{{ kolla_base_distro }}-{{ kolla_install_type }}-gnocchi-api"
gnocchi_api_tag: "{{ openstack_release }}"
gnocchi_api_image_full: "{{ gnocchi_api_image }}:{{ gnocchi_api_tag }}"
gnocchi_statsd_image: "{{ docker_registry ~ '/' if docker_registry else '' }}{{ docker_namespace }}/{{ kolla_base_distro }}-{{ kolla_install_type }}-gnocchi-statsd"
gnocchi_statsd_tag: "{{ openstack_release }}"
gnocchi_statsd_image_full: "{{ gnocchi_statsd_image }}:{{ gnocchi_statsd_tag }}"
gnocchi_metricd_image: "{{ docker_registry ~ '/' if docker_registry else '' }}{{ docker_namespace }}/{{ kolla_base_distro }}-{{ kolla_install_type }}-gnocchi-metricd"
gnocchi_metricd_tag: "{{ openstack_release }}"
gnocchi_metricd_image_full: "{{ gnocchi_metricd_image }}:{{ gnocchi_metricd_tag }}"
####################
# OpenStack
####################
gnocchi_admin_endpoint: "{{ admin_protocol }}://{{ kolla_internal_fqdn }}:{{ gnocchi_api_port }}"
gnocchi_internal_endpoint: "{{ internal_protocol }}://{{ kolla_internal_fqdn }}:{{ gnocchi_api_port }}"
gnocchi_public_endpoint: "{{ public_protocol }}://{{ kolla_external_fqdn }}:{{ gnocchi_api_port }}"
gnocchi_logging_debug: "{{ openstack_logging_debug }}"
gnocchi_keystone_user: "gnocchi"
openstack_gnocchi_auth: "{'auth_url':'{{ openstack_auth.auth_url }}','username':'{{ openstack_auth.username }}','password':'{{ openstack_auth.password }}','project_name':'{{ openstack_auth.project_name }}','domain_name':'default'}"

View File

@ -0,0 +1,3 @@
---
dependencies:
- { role: common }

View File

@ -0,0 +1,41 @@
---
- name: Creating gnocchi database
command: docker exec -t kolla_toolbox /usr/bin/ansible localhost
-m mysql_db
-a "login_host='{{ database_address }}'
login_port='{{ database_port }}'
login_user='{{ database_user }}'
login_password='{{ database_password }}'
name='{{ gnocchi_database_name }}'"
register: database
changed_when: "{{ database.stdout.find('localhost | SUCCESS => ') != -1 and
(database.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed }}"
failed_when: database.stdout.split()[2] != 'SUCCESS'
run_once: True
delegate_to: "{{ groups['gnocchi-api'][0] }}"
- name: Reading json from variable
set_fact:
database_created: "{{ (database.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed }}"
- name: Creating gnocchi database user and setting permissions
command: docker exec -t kolla_toolbox /usr/bin/ansible localhost
-m mysql_user
-a "login_host='{{ database_address }}'
login_port='{{ database_port }}'
login_user='{{ database_user }}'
login_password='{{ database_password }}'
name='{{ gnocchi_database_name }}'
password='{{ gnocchi_database_password }}'
host='%'
priv='{{ gnocchi_database_name }}.*:ALL'
append_privs='yes'"
register: database_user_create
changed_when: "{{ database_user_create.stdout.find('localhost | SUCCESS => ') != -1 and
(database_user_create.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed }}"
failed_when: database_user_create.stdout.split()[2] != 'SUCCESS'
run_once: True
delegate_to: "{{ groups['gnocchi-api'][0] }}"
- include: bootstrap_service.yml
when: database_created

View File

@ -0,0 +1,21 @@
---
- name: Running gnocchi bootstrap container
kolla_docker:
action: "start_container"
common_options: "{{ docker_common_options }}"
detach: False
environment:
KOLLA_BOOTSTRAP:
KOLLA_CONFIG_STRATEGY: "{{ config_strategy }}"
image: "{{ gnocchi_api_image_full }}"
labels:
BOOTSTRAP:
name: "bootstrap_gnocchi"
restart_policy: "never"
volumes:
- "{{ node_config_directory }}/gnocchi-api/:{{ container_config_directory }}/:ro"
- "/etc/localtime:/etc/localtime:ro"
- "gnocchi:/var/lib/gnocchi/"
- "kolla_logs:/var/log/kolla/"
run_once: True
delegate_to: "{{ groups['gnocchi-api'][0] }}"

View File

@ -0,0 +1,51 @@
---
- name: Ensuring config directories exist
file:
path: "{{ node_config_directory }}/{{ item }}"
state: "directory"
recurse: yes
with_items:
- "gnocchi-api"
- "gnocchi-statsd"
- "gnocchi-metricd"
- name: Copying over config.json files for services
template:
src: "{{ item }}.json.j2"
dest: "{{ node_config_directory }}/{{ item }}/config.json"
with_items:
- "gnocchi-api"
- "gnocchi-metricd"
- "gnocchi-statsd"
- name: Copying over api-paste.ini files for services
template:
src: "gnocchi-api-paste.ini.j2"
dest: "{{ node_config_directory }}/{{ item }}/gnocchi-api-paste.ini"
with_items:
- "gnocchi-api"
- name: Copying over gnocchi.conf
merge_configs:
vars:
service_name: "{{ item }}"
sources:
- "{{ role_path }}/templates/gnocchi.conf.j2"
- "{{ node_custom_config }}/global.conf"
- "{{ node_custom_config }}/database.conf"
- "{{ node_custom_config }}/messaging.conf"
- "{{ node_custom_config }}/gnocchi.conf"
- "{{ node_custom_config }}/gnocchi/{{ item }}.conf"
- "{{ node_custom_config }}/gnocchi/{{ inventory_hostname }}/gnocchi.conf"
dest: "{{ node_config_directory }}/{{ item }}/gnocchi.conf"
with_items:
- "gnocchi-api"
- "gnocchi-statsd"
- "gnocchi-metricd"
- name: Copying over wsgi-gnocchi.conf
template:
src: "wsgi-gnocchi.conf.j2"
dest: "{{ node_config_directory }}/{{ item }}/wsgi-gnocchi.conf"
with_items:
- "gnocchi-api"

View File

@ -0,0 +1,16 @@
---
- include: register.yml
when: inventory_hostname in groups['gnocchi-api']
- include: config.yml
when: inventory_hostname in groups['gnocchi-statsd'] or
inventory_hostname in groups['gnocchi-api'] or
inventory_hostname in groups['gnocchi-metricd']
- include: bootstrap.yml
when: inventory_hostname in groups['gnocchi-api']
- include: start.yml
when: inventory_hostname in groups['gnocchi-statsd'] or
inventory_hostname in groups['gnocchi-api'] or
inventory_hostname in groups['gnocchi-metricd']

View File

@ -0,0 +1,74 @@
---
- name: Ensuring the containers up
kolla_docker:
name: "{{ item.name }}"
action: "get_container_state"
register: container_state
failed_when: container_state.Running == false
when: inventory_hostname in groups[item.group]
with_items:
- { name: gnocchi_api, group: gnocchi-api }
- { name: gnocchi_metricd, group: gnocchi-metricd }
- { name: gnocchi_statsd, group: gnocchi-statsd }
- include: config.yml
- name: Check the configs
command: docker exec {{ item.name }} /usr/local/bin/kolla_set_configs --check
changed_when: false
failed_when: false
register: check_results
when: inventory_hostname in groups[item.group]
with_items:
- { name: gnocchi_api, group: gnocchi-api }
- { name: gnocchi_metricd, group: gnocchi-metricd }
- { name: gnocchi_statsd, group: gnocchi-statsd }
# NOTE(jeffrey4l): when config_strategy == 'COPY_ALWAYS'
# and container env['KOLLA_CONFIG_STRATEGY'] == 'COPY_ONCE',
# just remove the container and start again
- name: Containers config strategy
kolla_docker:
name: "{{ item.name }}"
action: "get_container_env"
register: container_envs
when: inventory_hostname in groups[item.group]
with_items:
- { name: gnocchi_api, group: gnocchi-api }
- { name: gnocchi_metricd, group: gnocchi-metricd }
- { name: gnocchi_statsd, group: gnocchi-statsd }
- name: Remove the containers
kolla_docker:
name: "{{ item[0]['name'] }}"
action: "remove_container"
register: remove_containers
when:
- inventory_hostname in groups[item[0]['group']]
- config_strategy == "COPY_ONCE" or item[1]['KOLLA_CONFIG_STRATEGY'] == 'COPY_ONCE'
- item[2]['rc'] == 1
with_together:
- [{ name: gnocchi_api, group: gnocchi-api },
{ name: gnocchi_metricd, group: gnocchi-metricd },
{ name: gnocchi_statsd, group: gnocchi-statsd }]
- "{{ container_envs.results }}"
- "{{ check_results.results }}"
- include: start.yml
when: remove_containers.changed
- name: Restart containers
kolla_docker:
name: "{{ item[0]['name'] }}"
action: "restart_container"
when:
- inventory_hostname in groups[item[0]['group']]
- config_strategy == 'COPY_ALWAYS'
- item[1]['KOLLA_CONFIG_STRATEGY'] != 'COPY_ONCE'
- item[2]['rc'] == 1
with_together:
- [{ name: gnocchi_api, group: gnocchi-api },
{ name: gnocchi_metricd, group: gnocchi-metricd },
{ name: gnocchi_statsd, group: gnocchi-statsd }]
- "{{ container_envs.results }}"
- "{{ check_results.results }}"

View File

@ -0,0 +1,2 @@
---
- include: "{{ action }}.yml"

View File

@ -0,0 +1,21 @@
---
- name: Pulling gnocchi-api image
kolla_docker:
action: "pull_image"
common_options: "{{ docker_common_options }}"
image: "{{ gnocchi_api_image_full }}"
when: inventory_hostname in groups['gnocchi-api']
- name: Pulling gnocchi-metricd image
kolla_docker:
action: "pull_image"
common_options: "{{ docker_common_options }}"
image: "{{ gnocchi_metricd_image_full }}"
when: inventory_hostname in groups['gnocchi-metricd']
- name: Pulling gnocchi-statsd image
kolla_docker:
action: "pull_image"
common_options: "{{ docker_common_options }}"
image: "{{ gnocchi_statsd_image_full }}"
when: inventory_hostname in groups['gnocchi-statsd']

View File

@ -0,0 +1,6 @@
---
- include: do_reconfigure.yml
serial: "30%"
when: inventory_hostname in groups['gnocchi-api']
or inventory_hostname in groups['gnocchi-metricd']
or inventory_hostname in groups['gnocchi-statsd']

View File

@ -0,0 +1,40 @@
---
- name: Creating the gnocchi service and endpoint
command: docker exec -t kolla_toolbox /usr/bin/ansible localhost
-m kolla_keystone_service
-a "service_name=gnocchi
service_type=metric
description='OpenStack Metric Service'
endpoint_region={{ openstack_region_name }}
url='{{ item.url }}'
interface='{{ item.interface }}'
region_name={{ openstack_region_name }}
auth={{ '{{ openstack_gnocchi_auth }}' }}"
-e "{'openstack_gnocchi_auth':{{ openstack_gnocchi_auth }}}"
register: gnocchi_endpoint
changed_when: "{{ gnocchi_endpoint.stdout.find('localhost | SUCCESS => ') != -1 and (gnocchi_endpoint.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed }}"
until: gnocchi_endpoint.stdout.split()[2] == 'SUCCESS'
retries: 10
delay: 5
run_once: True
with_items:
- {'interface': 'admin', 'url': '{{ gnocchi_admin_endpoint }}'}
- {'interface': 'internal', 'url': '{{ gnocchi_internal_endpoint }}'}
- {'interface': 'public', 'url': '{{ gnocchi_public_endpoint }}'}
- name: Creating the gnocchi project, user, and role
command: docker exec -t kolla_toolbox /usr/bin/ansible localhost
-m kolla_keystone_user
-a "project=service
user=gnocchi
password={{ gnocchi_keystone_password }}
role=admin
region_name={{ openstack_region_name }}
auth={{ '{{ openstack_gnocchi_auth }}' }}"
-e "{'openstack_gnocchi_auth':{{ openstack_gnocchi_auth }}}"
register: gnocchi_user
changed_when: "{{ gnocchi_user.stdout.find('localhost | SUCCESS => ') != -1 and (gnocchi_user.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed }}"
until: gnocchi_user.stdout.split()[2] == 'SUCCESS'
retries: 10
delay: 5
run_once: True

View File

@ -0,0 +1,34 @@
---
- name: Starting gnocchi-api container
kolla_docker:
action: "start_container"
common_options: "{{ docker_common_options }}"
image: "{{ gnocchi_api_image_full }}"
name: "gnocchi_api"
volumes:
- "{{ node_config_directory }}/gnocchi-api/:{{ container_config_directory }}/:ro"
- "gnocchi:/var/lib/gnocchi/"
- "kolla_logs:/var/log/kolla/"
when: inventory_hostname in groups['gnocchi-api']
- name: Starting gnocchi-metricd container
kolla_docker:
action: "start_container"
common_options: "{{ docker_common_options }}"
image: "{{ gnocchi_metricd_image_full }}"
name: "gnocchi_metricd"
volumes:
- "{{ node_config_directory }}/gnocchi-metricd/:{{ container_config_directory }}/:ro"
- "kolla_logs:/var/log/kolla/"
when: inventory_hostname in groups['gnocchi-metricd']
- name: Starting gnocchi-statsd container
kolla_docker:
action: "start_container"
common_options: "{{ docker_common_options }}"
image: "{{ gnocchi_statsd_image_full }}"
name: "gnocchi_statsd"
volumes:
- "{{ node_config_directory }}/gnocchi-statsd/:{{ container_config_directory }}/:ro"
- "kolla_logs:/var/log/kolla/"
when: inventory_hostname in groups['gnocchi-statsd']

View File

@ -0,0 +1,38 @@
# Use gnocchi+noauth in the pipeline if you don't want keystone authentication
[pipeline:main]
pipeline = gnocchi+auth
[composite:gnocchi+noauth]
use = egg:Paste#urlmap
/ = gnocchiversions
/v1 = gnocchiv1
[composite:gnocchi+auth]
use = egg:Paste#urlmap
/ = gnocchiversions
/v1 = gnocchiv1+auth
[pipeline:gnocchiv1+auth]
pipeline = healthcheck keystone_authtoken gnocchiv1
[app:gnocchiversions]
paste.app_factory = gnocchi.rest.app:app_factory
root = gnocchi.rest.VersionsController
[app:gnocchiv1]
paste.app_factory = gnocchi.rest.app:app_factory
root = gnocchi.rest.V1Controller
[filter:healthcheck]
paste.filter_factory = oslo_middleware:Healthcheck.factory
path = /status
backends = disable_by_file
[filter:keystone_authtoken]
paste.filter_factory = keystonemiddleware.auth_token:filter_factory
oslo_config_project = gnocchi
[filter:cors]
paste.filter_factory = oslo_middleware.cors:filter_factory
oslo_config_project = gnocchi

View File

@ -0,0 +1,20 @@
{% set gnocchi_cmd = 'apache2' if kolla_base_distro in ['ubuntu', 'debian'] else 'httpd' %}
{% set gnocchi_dir = 'apache2/conf-enabled' if kolla_base_distro in ['ubuntu', 'debian'] else 'httpd/conf.d' %}
{
"command": "{{ gnocchi_cmd }} -DFOREGROUND",
"config_files": [
{
"source": "{{ container_config_directory }}/gnocchi.conf",
"dest": "/etc/gnocchi/gnocchi.conf",
"owner": "gnocchi",
"perm": "0600"
},
{
"source": "{{ container_config_directory }}/wsgi-gnocchi.conf",
"dest": "/etc/{{ gnocchi_dir }}/wsgi-gnocchi.conf",
"owner": "gnocchi",
"perm": "0644"
}
]
}

View File

@ -0,0 +1,11 @@
{
"command": "gnocchi-metricd --logfile /var/log/kolla/gnocchi/gnocchi-metricd.log",
"config_files": [
{
"source": "{{ container_config_directory }}/gnocchi.conf",
"dest": "/etc/gnocchi/gnocchi.conf",
"owner": "gnocchi",
"perm": "0600"
}
]
}

View File

@ -0,0 +1,11 @@
{
"command": "gnocchi-statsd --logfile /var/log/kolla/gnocchi/gnocchi-statsd.log",
"config_files": [
{
"source": "{{ container_config_directory }}/gnocchi.conf",
"dest": "/etc/gnocchi/gnocchi.conf",
"owner": "gnocchi",
"perm": "0600"
}
]
}

View File

@ -0,0 +1,48 @@
[DEFAULT]
debug = {{ gnocchi_logging_debug }}
log_dir = /var/log/kolla/gnocchi
[api]
port = {{ gnocchi_api_port }}
host = {{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }}
middlewares = keystonemiddleware.auth_token.AuthProtocol
[database]
connection = mysql+pymysql://{{ gnocchi_database_user }}:{{ gnocchi_database_password }}@{{ gnocchi_database_address }}/{{ gnocchi_database_name }}
max_pool_size = 50
max_overflow = 1000
max_retries = -1
[statsd]
resource_id = {{ gnocchi_resource_id }}
user_id = {{ gnocchi_user_id }}
project_id = {{ gnocchi_project_id }}
archive_policy_name = low
flush_delay=10
[indexer]
url = mysql+pymysql://{{ gnocchi_database_user }}:{{ gnocchi_database_password }}@{{ gnocchi_database_address }}/{{ gnocchi_database_name }}
[keystone_authtoken]
auth_uri = {{ internal_protocol }}://{{ kolla_internal_fqdn }}:{{ keystone_public_port }}/v3
project_domain_id = default
project_name = service
user_domain_id = default
username = {{ gnocchi_keystone_user }}
password = {{ gnocchi_keystone_password }}
auth_url = {{ admin_protocol }}://{{ kolla_internal_fqdn }}:{{ keystone_admin_port }}
auth_type = password
memcache_security_strategy = ENCRYPT
memcache_secret_key = {{ memcache_secret_key }}
memcached_servers = {% for host in groups['memcached'] %}{{ hostvars[host]['ansible_' + hostvars[host]['api_interface']]['ipv4']['address'] }}:{{ memcached_port }}{% if not loop.last %},{% endif %}{% endfor %}
[storage]
driver = file
file_basepath = /var/lib/gnocchi

View File

@ -0,0 +1,25 @@
{% set python_path = '/usr/lib/python2.7/site-packages' if kolla_install_type == 'binary' else '/var/lib/kolla/venv/lib/python2.7/site-packages' %}
Listen {{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }}:{{ gnocchi_api_port }}
<VirtualHost *:{{ gnocchi_api_port }}>
## Vhost docroot
DocumentRoot "/var/www/cgi-bin/gnocchi"
## Directories, there should at least be a declaration for /var/www/cgi-bin/gnocchi
<Directory "/var/www/cgi-bin/gnocchi">
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Require all granted
</Directory>
## Logging
ErrorLog "/var/log/kolla/gnocchi/gnocchi_wsgi_error.log"
ServerSignature Off
CustomLog "/var/log/kolla/gnocchi/gnocchi_wsgi_access.log" combined
WSGIApplicationGroup %{GLOBAL}
WSGIDaemonProcess gnocchi group=gnocchi processes=2 threads=2 user=gnocchi
WSGIProcessGroup gnocchi
WSGIScriptAlias / "/var/www/cgi-bin/gnocchi/app"
</VirtualHost>

View File

@ -392,6 +392,22 @@ listen kibana_external
{% endif %} {% endif %}
{% endif %} {% endif %}
{% if enable_gnocchi | bool %}
listen gnocchi_api
bind {{ kolla_internal_vip_address }}:{{ gnocchi_api_port }}
{% for host in groups['gnocchi-api'] %}
server {{ hostvars[host]['ansible_hostname'] }} {{ hostvars[host]['ansible_' + hostvars[host]['api_interface']]['ipv4']['address'] }}:{{ gnocchi_api_port }} check inter 2000 rise 2 fall 5
{% endfor %}
{% if haproxy_enable_external_vip | bool %}
listen gnocchi_api_external
bind {{ kolla_external_vip_address }}:{{ gnocchi_api_port }} {{ tls_bind_info }}
{% for host in groups['gnocchi-api'] %}
server {{ hostvars[host]['ansible_hostname'] }} {{ hostvars[host]['ansible_' + hostvars[host]['api_interface']]['ipv4']['address'] }}:{{ gnocchi_api_port }} check inter 2000 rise 2 fall 5
{% endfor %}
{% endif %}
{% endif %}
{% if enable_elasticsearch | bool %} {% if enable_elasticsearch | bool %}
listen elasticsearch listen elasticsearch
option dontlog-normal option dontlog-normal

View File

@ -39,6 +39,22 @@
state: stopped state: stopped
when: inventory_hostname in groups['glance-registry'] when: inventory_hostname in groups['glance-registry']
- name: Checking free port for Gnocchi API
wait_for:
host: "{{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }}"
port: "{{ gnocchi_api_port }}"
connect_timeout: 1
state: stopped
when: inventory_hostname in groups['gnocchi-api']
- name: Checking free port for Gnocchi API HAProxy
wait_for:
host: "{{ kolla_internal_vip_address }}"
port: "{{ gnocchi_api_port }}"
connect_timeout: 1
state: stopped
when: inventory_hostname in groups['haproxy']
- name: Checking free port for Glance Registry HAProxy - name: Checking free port for Glance Registry HAProxy
wait_for: wait_for:
host: "{{ kolla_internal_vip_address }}" host: "{{ kolla_internal_vip_address }}"

View File

@ -216,6 +216,15 @@
tags: manila, tags: manila,
when: enable_manila | bool } when: enable_manila | bool }
- hosts:
- gnocchi-api
- gnocchi-metricd
- gnocchi-statsd
roles:
- { role: gnocchi,
tags: gnocchi,
when: enable_gnocchi | bool }
- hosts: - hosts:
- ceilometer - ceilometer
- compute - compute

View File

@ -30,6 +30,9 @@ keystone_database_password:
glance_database_password: glance_database_password:
glance_keystone_password: glance_keystone_password:
gnocchi_database_password:
gnocchi_keystone_password:
nova_database_password: nova_database_password:
nova_api_database_password: nova_api_database_password:
nova_keystone_password: nova_keystone_password:
@ -95,6 +98,13 @@ bifrost_ssh_key:
private_key: private_key:
public_key: public_key:
####################
# Gnocchi options
####################
gnocchi_project_id:
gnocchi_resource_id:
gnocchi_user_id:
#################### ####################
# RabbitMQ options # RabbitMQ options
#################### ####################

View File

@ -40,7 +40,9 @@ def main():
passwords_file = os.path.expanduser(args.passwords) passwords_file = os.path.expanduser(args.passwords)
# These keys should be random uuids # These keys should be random uuids
uuid_keys = ['ceph_cluster_fsid', 'rbd_secret_uuid'] uuid_keys = ['ceph_cluster_fsid', 'rbd_secret_uuid',
'gnocchi_project_id', 'gnocchi_resource_id',
'gnocchi_user_id']
# SSH key pair # SSH key pair
ssh_keys = ['kolla_ssh_key', 'nova_ssh_key', ssh_keys = ['kolla_ssh_key', 'nova_ssh_key',

View File

@ -0,0 +1,3 @@
---
features:
- Implement Gnocchi ansible role