Fix gnocchi auth issue

gnocchi use auth_mode option to load the proper middleware. So no need
to change the api-paste.ini file anymore.

Change-Id: Id69a3301225b49c94951f6c33376ebb8d5362efb
This commit is contained in:
Jeffrey Zhang 2017-02-02 20:55:24 +08:00 committed by Jeffrey Zhang
parent 57d9224702
commit 10f92bd828
5 changed files with 1 additions and 61 deletions

View File

@ -20,7 +20,6 @@
- config_json.changed | bool
or gnocchi_conf.changed | bool
or policy_json.changed | bool
or gnocchi_api_paste_ini.changed | bool
or gnocchi_wsgi_conf.changed | bool
or gnocchi_api_container.changed | bool

View File

@ -21,22 +21,6 @@
- Restart gnocchi-metricd container
- Restart gnocchi-statsd container
- name: Copying over api-paste.ini
vars:
service: "{{ gnocchi_services['gnocchi-api'] }}"
merge_configs:
sources:
- "{{ role_path }}/templates/api-paste.ini.j2"
- "{{ node_custom_config }}/gnocchi/api-paste.ini"
- "{{ node_custom_config }}/gnocchi/{{ inventory_hostname }}/api-paste.ini"
dest: "{{ node_config_directory }}/gnocchi-api/api-paste.ini"
register: gnocchi_api_paste_ini
when:
- inventory_hostname in groups['gnocchi-api']
- service.enabled | bool
notify:
- Restart gnocchi-api container
- name: Copying over gnocchi.conf
merge_configs:
vars:

View File

@ -1,38 +0,0 @@
# Use gnocchi+noauth in the pipeline if you don't want keystone authentication
[pipeline:main]
pipeline = gnocchi+auth
[composite:gnocchi+noauth]
use = egg:Paste#urlmap
/ = gnocchiversions
/v1 = gnocchiv1
[composite:gnocchi+auth]
use = egg:Paste#urlmap
/ = gnocchiversions
/v1 = gnocchiv1+auth
[pipeline:gnocchiv1+auth]
pipeline = healthcheck keystone_authtoken gnocchiv1
[app:gnocchiversions]
paste.app_factory = gnocchi.rest.app:app_factory
root = gnocchi.rest.VersionsController
[app:gnocchiv1]
paste.app_factory = gnocchi.rest.app:app_factory
root = gnocchi.rest.V1Controller
[filter:healthcheck]
paste.filter_factory = oslo_middleware:Healthcheck.factory
path = /status
backends = disable_by_file
[filter:keystone_authtoken]
paste.filter_factory = keystonemiddleware.auth_token:filter_factory
oslo_config_project = gnocchi
[filter:cors]
paste.filter_factory = oslo_middleware.cors:filter_factory
oslo_config_project = gnocchi

View File

@ -9,12 +9,6 @@
"owner": "gnocchi",
"perm": "0600"
},
{
"source": "{{ container_config_directory }}/api-paste.ini",
"dest": "/etc/gnocchi/api-paste.ini",
"owner": "gnocchi",
"perm": "0600"
},
{
"source": "{{ container_config_directory }}/wsgi-gnocchi.conf",
"dest": "/etc/{{ gnocchi_dir }}/wsgi-gnocchi.conf",

View File

@ -8,6 +8,7 @@ log_dir = /var/log/kolla/gnocchi
port = {{ gnocchi_api_port }}
host = {{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }}
middlewares = keystonemiddleware.auth_token.AuthProtocol
auth_mode = keystone
[database]