diff --git a/ansible/group_vars/all.yml b/ansible/group_vars/all.yml index 374cd38cff..9ce712f8a3 100644 --- a/ansible/group_vars/all.yml +++ b/ansible/group_vars/all.yml @@ -585,6 +585,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 1b57792752..ebb5e02751 100644 --- a/etc/kolla/globals.yml +++ b/etc/kolla/globals.yml @@ -309,6 +309,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