[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 Change-Id: I3ff3ce4f150854ece690f1bcbd7183f511fccf2e
This commit is contained in:
parent
78657cee37
commit
da09cb83bb
@ -60,6 +60,15 @@
|
|||||||
- "Restart nova services"
|
- "Restart nova services"
|
||||||
- "venv changed"
|
- "venv changed"
|
||||||
|
|
||||||
|
# NOTE (noonedeadpunk): Remove this task after Xena release
|
||||||
|
- name: Remove obsoleted policy.json
|
||||||
|
file:
|
||||||
|
path: "/etc/nova/policy.json"
|
||||||
|
state: absent
|
||||||
|
listen:
|
||||||
|
- "Restart nova services"
|
||||||
|
- "venv changed"
|
||||||
|
|
||||||
- name: Start services
|
- name: Start services
|
||||||
service:
|
service:
|
||||||
name: "{{ item.service_name }}"
|
name: "{{ item.service_name }}"
|
||||||
|
@ -81,16 +81,26 @@
|
|||||||
- nova-config
|
- nova-config
|
||||||
- nova-post-install
|
- nova-post-install
|
||||||
|
|
||||||
- name: Implement policy.json if there are overrides configured
|
- name: Implement policy.yaml if there are overrides configured
|
||||||
copy:
|
config_template:
|
||||||
content: "{{ nova_policy_overrides | to_nice_json }}"
|
content: "{{ nova_policy_overrides }}"
|
||||||
dest: "/etc/nova/policy.json"
|
dest: "/etc/nova/policy.yaml"
|
||||||
|
owner: "root"
|
||||||
|
group: "{{ nova_system_group_name }}"
|
||||||
|
mode: "0640"
|
||||||
|
config_type: yaml
|
||||||
when:
|
when:
|
||||||
- nova_policy_overrides != {}
|
- nova_policy_overrides | length > 0
|
||||||
notify:
|
tags:
|
||||||
- Manage LB
|
- nova-config
|
||||||
- Restart nova services
|
- nova-policy-override
|
||||||
- Restart uwsgi services
|
|
||||||
|
- name: Remove legacy policy.yaml file
|
||||||
|
file:
|
||||||
|
path: "/etc/nova/policy.yaml"
|
||||||
|
state: absent
|
||||||
|
when:
|
||||||
|
- nova_policy_overrides | length == 0
|
||||||
tags:
|
tags:
|
||||||
- nova-config
|
- nova-config
|
||||||
- nova-policy-override
|
- nova-policy-override
|
||||||
|
Loading…
x
Reference in New Issue
Block a user