Add availability to define gnocchi_incoming_driver
Gnocchi supports having different storage and incoming drivers [1] which has been never implemented in role. We add `gnocchi_incoming_driver` variable and do incoming configuration only when it's not same as gnocchi_storage_driver. [1] https://gnocchi.osci.io/install.html#configuration-file Depends-On: https://review.opendev.org/c/openstack/ansible-role-python_venv_build/+/822901 Change-Id: If1442abd7978d44def2a4386f9d159b42c4939e3 Related-Bug: #1955676
This commit is contained in:
parent
60643fa21c
commit
84150e8fb1
|
@ -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
|
||||
|
|
|
@ -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
|
|
@ -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)
|
||||
|
|
|
@ -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() %}
|
||||
|
|
Loading…
Reference in New Issue