diff --git a/ansible/group_vars/all.yml b/ansible/group_vars/all.yml index 00d94ff03c..fc9277d8c9 100644 --- a/ansible/group_vars/all.yml +++ b/ansible/group_vars/all.yml @@ -589,6 +589,9 @@ panko_database_type: "mysql" # Valid options are [file, ceph] gnocchi_backend_storage: "{{ 'ceph' if enable_ceph|bool else 'file' }}" +# Valid options are [redis, ''] +gnocchi_incoming_storage: "{{ 'redis' if enable_redis | bool else '' }}" + ################################# # Cinder options diff --git a/ansible/roles/gnocchi/templates/gnocchi.conf.j2 b/ansible/roles/gnocchi/templates/gnocchi.conf.j2 index 1b6438b8e5..705a2c0562 100644 --- a/ansible/roles/gnocchi/templates/gnocchi.conf.j2 +++ b/ansible/roles/gnocchi/templates/gnocchi.conf.j2 @@ -3,6 +3,10 @@ debug = {{ gnocchi_logging_debug }} log_dir = /var/log/kolla/gnocchi +{% if enable_redis | bool %} +coordination_url = redis://{% for host in groups['redis'] %}{% if host == groups['redis'][0] %}admin:{{ redis_master_password }}@{{ hostvars[host]['ansible_' + hostvars[host]['api_interface']]['ipv4']['address'] }}:{{ redis_sentinel_port }}?sentinel=kolla{% else %}&sentinel_fallback={{ hostvars[host]['ansible_' + hostvars[host]['api_interface']]['ipv4']['address'] }}:{{ redis_sentinel_port }}{% endif %}{% endfor %}&socket_timeout=60&retry_on_timeout=yes +{% endif %} + {% if service_name == 'gnocchi-api' %} # Force gnocchi-api.log or will use app.wsgi log_file = /var/log/kolla/gnocchi/gnocchi-api.log @@ -54,6 +58,12 @@ memcached_servers = {% for host in groups['memcached'] %}{{ hostvars[host]['ansi policy_file = {{ gnocchi_policy_file }} {% endif %} +[incoming] +{% if gnocchi_incoming_storage == 'redis' %} +driver = redis +redis_url = redis://{% for host in groups['redis'] %}{% if host == groups['redis'][0] %}admin:{{ redis_master_password }}@{{ hostvars[host]['ansible_' + hostvars[host]['api_interface']]['ipv4']['address'] }}:{{ redis_sentinel_port }}?sentinel=kolla{% else %}&sentinel_fallback={{ hostvars[host]['ansible_' + hostvars[host]['api_interface']]['ipv4']['address'] }}:{{ redis_sentinel_port }}{% endif %}{% endfor %}&db=0&socket_timeout=60&retry_on_timeout=yes +{% endif %} + [storage] {% if gnocchi_backend_storage == 'file' %} driver = file diff --git a/etc/kolla/globals.yml b/etc/kolla/globals.yml index 0ca0ad372c..fb3a7889d0 100644 --- a/etc/kolla/globals.yml +++ b/etc/kolla/globals.yml @@ -311,6 +311,8 @@ kolla_internal_vip_address: "10.10.10.254" # Valid options are [ file, ceph ] #gnocchi_backend_storage: "{{ 'ceph' if enable_ceph|bool else 'file' }}" +# Valid options are [redis, ''] +#gnocchi_incoming_storage: "{{ 'redis' if enable_redis | bool else '' }}" ################################ # Cinder - Block Storage Options