From 331d2f053f496a374846622bf67161d7899cd75f Mon Sep 17 00:00:00 2001 From: Mick Thompson Date: Thu, 24 Aug 2017 10:35:22 +0100 Subject: [PATCH] Add swift as gnocchi storage option - Uses swift if swift is enabled. - Uses ceph if ceph is enabled. - Defaults to file if swift and ceph are enabled. Explicitly set to swift or ceph when both are enabled. - Include swift client detail in storage section of gnocchi conf Change-Id: I78df9a2fbe546038e1d6df350d8db0fd9b6f6d49 --- ansible/group_vars/all.yml | 5 +++-- ansible/roles/gnocchi/defaults/main.yml | 7 +++++++ ansible/roles/gnocchi/templates/gnocchi.conf.j2 | 7 +++++++ .../notes/gnochhi_swift_storage-5d05dab0e20eb43d.yaml | 9 +++++++++ 4 files changed, 26 insertions(+), 2 deletions(-) create mode 100644 releasenotes/notes/gnochhi_swift_storage-5d05dab0e20eb43d.yaml diff --git a/ansible/group_vars/all.yml b/ansible/group_vars/all.yml index fa8159981f..5260015f88 100644 --- a/ansible/group_vars/all.yml +++ b/ansible/group_vars/all.yml @@ -658,8 +658,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 86c4c8193f..c997bbb2b3 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 4fe7517c2f..f9f3ca155f 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 0000000000..da03d7870c --- /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.