[goal] Deprecate the JSON formatted policy file
As per the community goal of migrating the policy file the format from JSON to YAML[1], we need to replace policy.json to policy.yaml and remove deprecated policy.json. config_template has been choosen instead of the copy, since it can properly handle content that has been lookuped. We make a separate task not to restart service when it's not needed. [1]https://governance.openstack.org/tc/goals/selected/wallaby/migrate-policy-format-from-json-to-yaml.html Depends-On: https://review.opendev.org/c/openstack/heat/+/766861 Change-Id: I3d1c51a025f2c94cb02f7e0882472344dcb97fa4
This commit is contained in:
parent
2dc4709537
commit
5a8cd45701
@ -22,3 +22,12 @@
|
||||
with_items: "{{ filtered_heat_services }}"
|
||||
listen:
|
||||
- "venv changed"
|
||||
|
||||
# NOTE (noonedeadpunk): Remove this task after Xena release
|
||||
- name: Remove obsoleted policy.json
|
||||
file:
|
||||
path: "/etc/heat/policy.json"
|
||||
state: absent
|
||||
listen:
|
||||
- "Restart heat services"
|
||||
- "venv changed"
|
||||
|
@ -26,12 +26,27 @@
|
||||
- Restart heat services
|
||||
- Restart uwsgi services
|
||||
|
||||
- name: Implement policy.json if there are overrides configured
|
||||
copy:
|
||||
content: "{{ heat_policy_overrides | to_nice_json }}"
|
||||
dest: "/etc/heat/policy.json"
|
||||
- name: Implement policy.yaml if there are overrides configured
|
||||
config_template:
|
||||
content: "{{ heat_policy_overrides }}"
|
||||
dest: "/etc/heat/policy.yaml"
|
||||
owner: "root"
|
||||
group: "{{ heat_system_group_name }}"
|
||||
mode: "0640"
|
||||
config_type: yaml
|
||||
when:
|
||||
- heat_policy_overrides != {}
|
||||
- heat_policy_overrides | length > 0
|
||||
tags:
|
||||
- heat-policy-override
|
||||
|
||||
- name: Remove legacy policy.yaml file
|
||||
file:
|
||||
path: "/etc/heat/policy.yaml"
|
||||
state: absent
|
||||
when:
|
||||
- heat_policy_overrides | length == 0
|
||||
tags:
|
||||
- heat-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
|
||||
|
Loading…
Reference in New Issue
Block a user