diff --git a/handlers/main.yml b/handlers/main.yml index 3c7d5b01..60704077 100644 --- a/handlers/main.yml +++ b/handlers/main.yml @@ -60,6 +60,15 @@ - "Restart nova services" - "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 service: name: "{{ item.service_name }}" diff --git a/tasks/nova_post_install.yml b/tasks/nova_post_install.yml index eed3c8d2..710518ec 100644 --- a/tasks/nova_post_install.yml +++ b/tasks/nova_post_install.yml @@ -81,16 +81,26 @@ - nova-config - nova-post-install -- name: Implement policy.json if there are overrides configured - copy: - content: "{{ nova_policy_overrides | to_nice_json }}" - dest: "/etc/nova/policy.json" +- name: Implement policy.yaml if there are overrides configured + config_template: + content: "{{ nova_policy_overrides }}" + dest: "/etc/nova/policy.yaml" + owner: "root" + group: "{{ nova_system_group_name }}" + mode: "0640" + config_type: yaml when: - - nova_policy_overrides != {} - notify: - - Manage LB - - Restart nova services - - Restart uwsgi services + - nova_policy_overrides | length > 0 + tags: + - nova-config + - nova-policy-override + +- name: Remove legacy policy.yaml file + file: + path: "/etc/nova/policy.yaml" + state: absent + when: + - nova_policy_overrides | length == 0 tags: - nova-config - nova-policy-override