Merge "[goal] Deprecate the JSON formatted policy file"

This commit is contained in:
Zuul 2021-04-06 16:44:16 +00:00 committed by Gerrit Code Review
commit 67cbe597ac
2 changed files with 27 additions and 9 deletions

View File

@ -28,6 +28,15 @@
- "Restart cinder services"
- "venv changed"
# NOTE (noonedeadpunk): Remove this task after Xena release
- name: Remove obsoleted policy.json file
file:
path: "/etc/cinder/policy.json"
state: absent
listen:
- Restart cinder services
- venv changed
- name: Start services
service:
name: "{{ item.service_name }}"

View File

@ -63,20 +63,29 @@
- cinder-config
- cinder-post-install
- name: Implement policy.json if there are overrides configured
copy:
content: "{{ cinder_policy_overrides | to_nice_json }}"
dest: "/etc/cinder/policy.json"
notify:
- Manage LB
- Restart cinder services
- Restart uwsgi services
- name: Implement policy.yaml if there are overrides configured
config_template:
content: "{{ cinder_policy_overrides }}"
dest: "/etc/cinder/policy.yaml"
owner: "root"
group: "{{ cinder_system_group_name }}"
mode: "0640"
config_type: yaml
when:
- cinder_policy_overrides != {}
- cinder_policy_overrides | length > 0
tags:
- cinder-config
- cinder-policy-override
- name: Remove legacy policy.yaml file
file:
path: "/etc/cinder/policy.yaml"
state: absent
when:
- cinder_policy_overrides | length == 0
tags:
- cinder-policy-override
# NOTE(cloudnull): This is using "cp" instead of copy with a remote_source
# because we only want to copy the original files once. and we
# don't want to need multiple tasks.