Drop default policy file location
With master version of Gnocchi[1], default policy file is no longer provided
since all policies are currently stored in code.
Moreover, it's long due to switch policy formats to YAML instead of
json.
[1] 6ad4bb8e62
Change-Id: Ie7923f3b1fa3fcf3f463b476f908be09533e103a
This commit is contained in:
parent
d44b25ebb8
commit
8c503a40c1
@ -215,14 +215,13 @@ gnocchi_memcached_servers: "{{ memcached_servers }}"
|
||||
# not exist then the default files will be sourced from the
|
||||
# service git repository.
|
||||
gnocchi_api_paste_default_file_path: "/etc/openstack_deploy/gnocchi/api-paste.ini"
|
||||
gnocchi_policy_default_file_path: "/etc/openstack_deploy/gnocchi/policy.json"
|
||||
gnocchi_policy_default_file_path: "/etc/openstack_deploy/gnocchi/policy.yaml"
|
||||
|
||||
# If the above-mentioned files do not exist, then these
|
||||
# paths will be used to find the files from the git config
|
||||
# lookup location.
|
||||
gnocchi_git_config_lookup_location: https://raw.githubusercontent.com/gnocchixyz/gnocchi/{{ gnocchi_git_install_branch }}/
|
||||
gnocchi_api_paste_git_file_path: "gnocchi/rest/api-paste.ini"
|
||||
gnocchi_policy_git_file_path: "gnocchi/rest/policy.json"
|
||||
|
||||
# Tunable var-based overrides
|
||||
# The contents of these are templated over the default files.
|
||||
|
@ -34,7 +34,7 @@
|
||||
- "cert installed"
|
||||
|
||||
# Note (odyssey4me):
|
||||
# The policy.json file is currently read continually by the services
|
||||
# The policy.yaml file is currently read continually by the services
|
||||
# and is not only read on service start. We therefore cannot template
|
||||
# directly to the file read by the service because the new policies
|
||||
# may not be valid until the service restarts. This is particularly
|
||||
@ -49,6 +49,7 @@
|
||||
group: "{{ gnocchi_system_group_name }}"
|
||||
mode: "0640"
|
||||
remote_src: yes
|
||||
when: gnocchi_policy_user_content | length > 0
|
||||
listen:
|
||||
- "Restart gnocchi services"
|
||||
- "venv changed"
|
||||
|
@ -0,0 +1,6 @@
|
||||
---
|
||||
upgrade:
|
||||
- |
|
||||
Default value of ``gnocchi_policy_default_file_path`` has changed to search
|
||||
for ``policy.yaml`` file under ``/etc/openstack_deploy/gnocchi/`` folder.
|
||||
Please ensure, that you use YAML format instead of JSON for the file.
|
@ -19,7 +19,6 @@
|
||||
return_content: yes
|
||||
with_items:
|
||||
- "{{ gnocchi_git_config_lookup_location }}/{{ gnocchi_api_paste_git_file_path }}"
|
||||
- "{{ gnocchi_git_config_lookup_location }}/{{ gnocchi_policy_git_file_path }}"
|
||||
register: _git_file_fetch
|
||||
|
||||
- name: Copy gnocchi configuration files
|
||||
@ -32,6 +31,7 @@
|
||||
mode: "{{ item.mode | default('0644') }}"
|
||||
config_overrides: "{{ item.config_overrides }}"
|
||||
config_type: "{{ item.config_type }}"
|
||||
when: item.condition | default(True)
|
||||
with_items:
|
||||
- src: "gnocchi.conf.j2"
|
||||
dest: "/etc/gnocchi/gnocchi.conf"
|
||||
@ -44,7 +44,8 @@
|
||||
- dest: "/etc/gnocchi/policy.yaml-{{ gnocchi_venv_tag }}"
|
||||
config_overrides: "{{ gnocchi_policy_overrides }}"
|
||||
config_type: "yaml"
|
||||
content: "{{ gnocchi_policy_user_content | default(gnocchi_policy_default_content, true) }}"
|
||||
content: "{{ gnocchi_policy_user_content }}"
|
||||
condition: "{{ gnocchi_policy_user_content | length > 0 }}"
|
||||
notify:
|
||||
- Restart gnocchi services
|
||||
- Restart uwsgi services
|
||||
|
@ -29,11 +29,6 @@ gnocchi_api_paste_default_content: |
|
||||
_git_file_fetch.results | selectattr(
|
||||
'item', 'equalto', gnocchi_git_config_lookup_location ~ '/' ~ gnocchi_api_paste_git_file_path) | map(attribute='content') | first
|
||||
}}
|
||||
gnocchi_policy_default_content: |
|
||||
{{
|
||||
_git_file_fetch.results | selectattr(
|
||||
'item', 'equalto', gnocchi_git_config_lookup_location ~ '/' ~ gnocchi_policy_git_file_path) | map(attribute='content') | first
|
||||
}}
|
||||
|
||||
# NOTE(noonedeadpunk): We prefer using ceph_alternative when storage driver is ceph.
|
||||
# However, if we define ceph_alternative here, gnocchi with setup.cfg
|
||||
|
Loading…
x
Reference in New Issue
Block a user