Merge "Cloudkitty InfluxDB Storage backend via Kolla-ansible"

This commit is contained in:
Zuul 2019-07-04 03:45:40 +00:00 committed by Gerrit Code Review
commit 2ad7b50010
6 changed files with 79 additions and 2 deletions

View File

@ -573,7 +573,7 @@ enable_horizon_vitrage: "{{ enable_vitrage | bool }}"
enable_horizon_watcher: "{{ enable_watcher | bool }}"
enable_horizon_zun: "{{ enable_zun | bool }}"
enable_hyperv: "no"
enable_influxdb: "{{ enable_monasca | bool }}"
enable_influxdb: "{{ enable_monasca | bool or (cloudkitty_storage_backend is defined and cloudkitty_storage_backend == 'influxdb') }}"
enable_ironic: "no"
enable_ironic_ipxe: "no"
enable_ironic_neutron_agent: "{{ enable_neutron | bool and enable_ironic | bool }}"
@ -1034,3 +1034,8 @@ prometheus_elasticsearch_exporter_interval: "60s"
# Vitrage
############
enable_vitrage_prometheus_datasource: "{{ enable_prometheus | bool }}"
####################
# InfluxDB options
####################
influxdb_address: "{{ kolla_internal_fqdn }}"

View File

@ -96,3 +96,29 @@ cloudkitty_dev_repos_pull: "{{ kolla_dev_repos_pull }}"
cloudkitty_dev_mode: "{{ kolla_dev_mode }}"
cloudkitty_source_version: "{{ kolla_source_version }}"
cloudkitty_custom_metrics_yaml_file: "metrics.yml"
####################
# Storage backend
####################
# Valid options are 'sqlalchemy' or 'influxdb'. The default value in
# Kolla-ansible is 'sqlalchemy' (for backwards compatibility).
# When cloudkitty_storage_backend is define with "influxdb" as its value,
# we also trigger the deployment of Influxdb via Kolla-ansible.
# Also, when using 'influxdb' as the backend, we trigger the configuration/use
# of Cloudkitty storage backend version 2.
cloudkitty_storage_backend: "sqlalchemy"
# InfluxDB retention policy to use (defaults to autogen).
# cloudkitty_influxdb_retention_policy: "autogen"
# Set to true to use SSL for InfluxDB connections.
# cloudkitty_influxdb_use_ssl: false
# Path of the CA certificate to trust for HTTPS connections.
# cloudkitty_influxdb_cafile: "/full/qualified/path/to/CAs/certificates"
# Set to true to authorize insecure HTTPS connections to InfluxDB.
# This means, HTTPS connections without validating the certificate used by InfluxDB
# cloudkitty_influxdb_insecure_connections: false
cloudkitty_influxdb_name: "cloudkitty"

View File

@ -34,5 +34,15 @@
when:
- not use_preconfigured_databases | bool
- name: Creating Cloudkitty influxdb database
become: true
kolla_toolbox:
module_name: influxdb_database
module_args:
hostname: "{{ influxdb_address }}"
port: "{{ influxdb_http_port }}"
database_name: "{{ cloudkitty_influxdb_name }}"
when: cloudkitty_storage_backend == 'influxdb'
- include_tasks: bootstrap_service.yml
when: database.changed or use_preconfigured_databases | bool

View File

@ -62,3 +62,35 @@ port = {{ cloudkitty_api_port }}
coordination_url = mysql://{{ cloudkitty_database_user }}:{{ cloudkitty_database_password }}@{{ cloudkitty_database_address }}/{{ cloudkitty_database_name }}
max_workers = {{ openstack_service_workers }}
[storage]
backend = {{ cloudkitty_storage_backend }}
{% if cloudkitty_storage_backend == 'influxdb' %}
version = 2
{% endif %}
{% if cloudkitty_storage_backend == 'sqlalchemy' %}
version = 1
{% endif %}
{% if cloudkitty_storage_backend == 'influxdb' %}
[storage_influx]
database = {{ cloudkitty_influxdb_name }}
host = {{ influxdb_address }}
port = {{ influxdb_http_port }}
{% if cloudkitty_influxdb_retention_policy is defined %}
retention_policy = {{ cloudkitty_influxdb_retention_policy }}
{% endif %}
{% if cloudkitty_influxdb_use_ssl is defined %}
use_ssl = {{ cloudkitty_influxdb_use_ssl }}
{% endif %}
{% if cloudkitty_influxdb_insecure_connections is defined %}
insecure = {{ cloudkitty_influxdb_insecure_connections }}
{% endif %}
{% if cloudkitty_influxdb_cafile is defined %}
cafile = {{ cloudkitty_influxdb_cafile }}
{% endif %}
{% endif %}

View File

@ -171,7 +171,7 @@ monasca_database_address: "{{ database_address }}"
monasca_database_port: "{{ database_port }}"
monasca_influxdb_name: "monasca"
monasca_influxdb_address: "{{ kolla_internal_fqdn }}"
monasca_influxdb_address: "{{ influxdb_address }}"
monasca_influxdb_http_port: "{{ influxdb_http_port }}"
monasca_influxdb_retention_policy:
name: 'monasca_metrics'

View File

@ -0,0 +1,4 @@
---
features:
- |
Add support to Kolla-Ansible for Cloudkitty InfluxDB storage system deployment.