Merge "Allow to override zun policy files"

This commit is contained in:
Zuul 2021-04-21 23:16:35 +00:00 committed by Gerrit Code Review
commit f1c847b1df
3 changed files with 25 additions and 0 deletions

View File

@ -368,3 +368,4 @@ zun_compute_init_overrides: {}
zun_kuryr_init_overrides: {}
zun_docker_init_overrides: {}
zun_docker_cleanup_init_overrides: {}
zun_policy_overrides: {}

View File

@ -0,0 +1,5 @@
---
features:
- |
Added variable ``zun_policy_overrides`` that aims to allow deploying
policy.yaml file with provided overrides for Zun service.

View File

@ -60,6 +60,25 @@
- zun-config
- zun-post-install
- name: Implement policy.yaml if there are overrides configured
config_template:
content: "{{ zun_policy_overrides }}"
dest: "/etc/zun/policy.yaml"
config_type: yaml
when:
- zun_policy_overrides | length > 0
tags:
- zun-policy-override
- name: Remove legacy policy.yaml file
file:
path: "/etc/zun/policy.yaml"
state: absent
when:
- zun_policy_overrides | length == 0
tags:
- zun-policy-override
- name: Synchronize the zun DB schema
command: "{{ zun_bin }}/zun-db-manage --config-dir /etc/zun upgrade"
become: yes