Do not remove policy.yaml file
oslo.policy can not handle policy file removal. As a result, if policy overrides were defined at some point, but then removed, causes service outage. While we could add a handler trigger to restart the service on policy removal, it's better to simplify the logic and always place an empty policy.yaml even if no overrides are defined. Change-Id: I96922df402be47be1f78d27798cfe929084d2689 Signed-off-by: Dmitriy Rabotyagov <dmitriy.rabotyagov@cleura.com>
This commit is contained in:
@@ -53,7 +53,7 @@
|
||||
- Restart glance services
|
||||
- Restart uwsgi services
|
||||
|
||||
- name: Implement policy.yaml if there are overrides configured
|
||||
- name: Place policy.yaml file
|
||||
openstack.config_template.config_template:
|
||||
dest: "{{ glance_etc_dir }}/{{ glance_policy_file }}"
|
||||
config_overrides: "{{ glance_policy_overrides }}"
|
||||
@@ -62,18 +62,6 @@
|
||||
group: "{{ glance_system_group_name }}"
|
||||
mode: "0640"
|
||||
content: "{{ glance_policy_content }}"
|
||||
when:
|
||||
- (glance_policy_overrides | length > 0) or (glance_policy_content | length > 0)
|
||||
tags:
|
||||
- glance-policy-override
|
||||
|
||||
- name: Remove legacy policy.yaml file
|
||||
ansible.builtin.file:
|
||||
path: "{{ glance_etc_dir }}/{{ glance_policy_file }}"
|
||||
state: absent
|
||||
when:
|
||||
- glance_policy_overrides | length == 0
|
||||
- glance_policy_content | length == 0
|
||||
tags:
|
||||
- glance-policy-override
|
||||
|
||||
|
||||
Reference in New Issue
Block a user