Merge "Add availability to define gnocchi_incoming_driver"

This commit is contained in:
Zuul 2022-03-16 15:22:53 +00:00 committed by Gerrit Code Review
commit 68ff6a169a
4 changed files with 77 additions and 3 deletions

View File

@ -78,11 +78,23 @@ gnocchi_galera_port: "{{ galera_port | default('3306') }}"
#: Storage info
gnocchi_storage_driver: file
gnocchi_storage_file_basepath: "{{ gnocchi_system_user_home }}"
gnocchi_storage_swift_container_prefix: "gnocchi"
gnocchi_coordination_url: "mysql://{{ gnocchi_galera_user }}:{{ gnocchi_container_mysql_password }}@{{ gnocchi_galera_address }}/{{ gnocchi_galera_database }}?charset=utf8&timeout=5{% if gnocchi_galera_use_ssl | bool %}&ssl_ca={{ gnocchi_galera_ssl_ca_cert }}{% endif %}"
# Incoming configuration
# Incoming configuration is not applied if driver is the same as storage one
gnocchi_incoming_driver: "{{ gnocchi_storage_driver }}"
gnocchi_incoming_file_basepath: "{{ gnocchi_storage_file_basepath }}"
gnocchi_incoming_swift_container_prefix: "{{ gnocchi_storage_swift_container_prefix }}"
#: Default Ceph parameters
gnocchi_ceph_pool: "metrics"
gnocchi_ceph_username: "gnocchi"
# If gnocchi_storage_driver == gnocchi_incoming_driver this would have no effect
gnocchi_ceph_incoming_pool: "{{ gnocchi_ceph_pool }}"
gnocchi_ceph_incoming_username: "{{ gnocchi_ceph_username }}"
#a System info
gnocchi_system_user_name: gnocchi
@ -152,11 +164,12 @@ gnocchi_pip_package_extras:
- "{{ (gnocchi_auth_mode == 'keystone') | ternary('keystone', '') }}"
- mysql
- "{{ gnocchi_storage_driver_pip_extra }}"
- "{{ gnocchi_incoming_driver_pip_extra }}"
#: Common pip packages
gnocchi_pip_packages:
- cryptography
- "git+{{ gnocchi_git_repo }}@{{ gnocchi_git_install_branch }}#egg=gnocchi[{{ gnocchi_pip_package_extras | reject('equalto', '') | join(',') }}]"
- "git+{{ gnocchi_git_repo }}@{{ gnocchi_git_install_branch }}#egg=gnocchi[{{ gnocchi_pip_package_extras | unique | reject('equalto', '') | join(',') }}]"
- gnocchiclient
- osprofiler
- pymemcache

View File

@ -0,0 +1,18 @@
---
features:
- |
Implemented possibility to natively define ``gnocchi_incoming_driver``
separately from ``gnocchi_storage_driver``. Default behaviour is that
``[incoming]`` is left unconfigured which means ``[storage]`` is used
when gnocchi_incoming_driver and gnocchi_storage_driver are equal.
Role will install incoming driver dependencies if required.
To implement that following variables introduced:
* gnocchi_storage_file_basepath
* gnocchi_storage_swift_container_prefix
* gnocchi_incoming_driver
* gnocchi_incoming_file_basepath
* gnocchi_incoming_swift_container_prefix
* gnocchi_ceph_incoming_pool
* gnocchi_ceph_incoming_username

View File

@ -48,7 +48,7 @@ driver = {{ gnocchi_storage_driver }}
############
## File Storage
############
file_basepath = /var/lib/gnocchi
file_basepath = {{ gnocchi_storage_file_basepath }}
file_basepath_tmp = ${file_basepath}/tmp
{% endif %}
{% if gnocchi_storage_driver == 'swift' %}
@ -64,7 +64,7 @@ swift_region_name: "{{ gnocchi_service_region }}"
swift_project_domain_id: "{{ gnocchi_service_project_domain_id }}"
swift_user_domain_id: "{{ gnocchi_service_user_domain_id }}"
swift_project_name: "{{ gnocchi_service_project_name }}"
swift_container_prefix: gnocchi
swift_container_prefix: "{{ gnocchi_storage_swift_container_prefix }}"
{% endif %}
{% if gnocchi_storage_driver == 'ceph' %}
############
@ -77,6 +77,43 @@ ceph_pool = {{ gnocchi_ceph_pool }}
ceph_username = {{ gnocchi_ceph_username }}
{% endif %}
{% if gnocchi_storage_driver != gnocchi_incoming_driver %}
[incoming]
driver = {{ gnocchi_incoming_driver }}
{% if gnocchi_incoming_driver == 'file' %}
################
## File Incoming
################
file_basepath = {{ gnocchi_incoming_file_basepath }}
file_basepath_tmp = ${file_basepath}/tmp
{% endif %}
{% if gnocchi_incoming_driver == 'swift' %}
#################
## Swift Incoming
#################
swift_auth_version: 3
swift_authurl: "{{ keystone_service_internalurl }}"
swift_endpoint_type: internalURL
swift_user: "{{ gnocchi_service_user_name }}"
swift_key: "{{ gnocchi_service_password }}"
swift_region_name: "{{ gnocchi_service_region }}"
swift_project_domain_id: "{{ gnocchi_service_project_domain_id }}"
swift_user_domain_id: "{{ gnocchi_service_user_domain_id }}"
swift_project_name: "{{ gnocchi_service_project_name }}"
swift_container_prefix: "{{ gnocchi_incoming_swift_container_prefix }}
{% endif %}
{% if gnocchi_incoming_driver == 'ceph' %}
################
## Ceph Incoming
################
# Ceph pool name to use. (string value)
ceph_pool = {{ gnocchi_ceph_incoming_pool }}
# Ceph username (ie: admin without "client." prefix).
ceph_username = {{ gnocchi_ceph_incoming_username }}
{% endif %}
{% endif %}
[metricd]
# Number of workers for Gnocchi metric daemons. By default the available number
# of CPU is used. (integer value)

View File

@ -35,6 +35,12 @@ gnocchi_storage_driver_pip_extra: |-
{% endif %}
{{ extra_package | default('') }}
gnocchi_incoming_driver_pip_extra: |-
{% if gnocchi_storage_driver != gnocchi_incoming_driver and gnocchi_incoming_driver not in ['ceph', 'file'] %}
{% set extra_package = gnocchi_storage_driver %}
{% endif %}
{{ extra_package | default('') }}
filtered_gnocchi_services: |-
{% set services = [] %}
{% for name, service in gnocchi_services.items() %}