diff --git a/ansible/group_vars/all.yml b/ansible/group_vars/all.yml index fe55a7a9ce24795dc671f5037228cdf574515e7e..d85a7a6d5b809b1c89723604484c0e51bd25d52d 100644 --- a/ansible/group_vars/all.yml +++ b/ansible/group_vars/all.yml @@ -660,8 +660,9 @@ panko_database_type: "mysql" ################# # Gnocchi options ################# -# Valid options are [file, ceph] -gnocchi_backend_storage: "{{ 'ceph' if enable_ceph|bool else 'file' }}" +# Valid options are [ file, ceph, swift ] +# Defaults to file if ceph and swift are enabled; explicitly set to either if required. +gnocchi_backend_storage: "{% if enable_ceph | bool and not enable_swift | bool %}ceph{% elif enable_swift | bool and not enable_ceph | bool %}swift{% else %}file{% endif %}" # Valid options are [redis, ''] gnocchi_incoming_storage: "{{ 'redis' if enable_redis | bool else '' }}" diff --git a/ansible/roles/gnocchi/defaults/main.yml b/ansible/roles/gnocchi/defaults/main.yml index 86c4c8193f804a403ea52344460f692cc76f4c4c..c997bbb2b33e0cf8f61031fcde84d53860745a78 100644 --- a/ansible/roles/gnocchi/defaults/main.yml +++ b/ansible/roles/gnocchi/defaults/main.yml @@ -59,6 +59,13 @@ ceph_client_gnocchi_keyring_caps: allow rwx pool={{ ceph_gnocchi_pool_name }}-cache +#################### +# Swift +#################### +swift_keystone_user: "swift" +swift_admin_tenant_name: "admin" + + #################### # Database #################### diff --git a/ansible/roles/gnocchi/templates/gnocchi.conf.j2 b/ansible/roles/gnocchi/templates/gnocchi.conf.j2 index 4fe7517c2fe5a0cf8cd22de831ee6257a3ffc04f..f9f3ca155f4b02a36035bebcdacd2d25dc3da202 100644 --- a/ansible/roles/gnocchi/templates/gnocchi.conf.j2 +++ b/ansible/roles/gnocchi/templates/gnocchi.conf.j2 @@ -76,6 +76,13 @@ ceph_pool = {{ gnocchi_pool_name }} ceph_username = gnocchi ceph_keyring = /etc/ceph/ceph.client.gnocchi.keyring ceph_conffile = /etc/ceph/ceph.conf +{% elif gnocchi_backend_storage == 'swift' %} +driver = swift +swift_authurl = {{ internal_protocol }}://{{ kolla_internal_fqdn }}:{{ keystone_public_port }}/v3 +swift_auth_version = 3 +swift_user = service:{{ swift_keystone_user }} +swift_key = {{ swift_keystone_password }} +swift_project_name = {{ swift_admin_tenant_name }} {% endif %} {% if enable_grafana | bool %} diff --git a/releasenotes/notes/gnochhi_swift_storage-5d05dab0e20eb43d.yaml b/releasenotes/notes/gnochhi_swift_storage-5d05dab0e20eb43d.yaml new file mode 100644 index 0000000000000000000000000000000000000000..da03d7870c1e681e17aec832ff6bafb4c1864709 --- /dev/null +++ b/releasenotes/notes/gnochhi_swift_storage-5d05dab0e20eb43d.yaml @@ -0,0 +1,9 @@ +--- +upgrade: + - | + Added swift as gnocchi storage option. + Here is the list of storage options for gnocchi- + a) Uses swift if swift is enabled. + b) Uses ceph if ceph is enabled. + c) Defaults to file if swift and ceph are enabled. + User has to explicitly set to swift or ceph if both enabled.