Fix glance policy.json deployment

Glance has dropped default policy.json [1] which
was used by "smart sources". We are fixing this by setting content
to empty dict, that way the only content deployed will be the one
provided by overrides, so that won't change current behaviour.
Additionally `glance_policy_content` has been introduced, which
eventually is going to replace `glance_policy_overrides` in the future.

[1] dd1975bd3e

Change-Id: I3f365684542b390ea02c08ab56f76a447f65a814
This commit is contained in:
Dmitriy Rabotyagov 2020-03-10 14:25:44 +02:00
parent c9d88043fa
commit 0f7971c9cb
4 changed files with 8 additions and 11 deletions

View File

@ -303,6 +303,7 @@ glance_glance_scrubber_conf_overrides: {}
glance_glance_scheme_json_overrides: {}
glance_glance_swift_store_conf_overrides: {}
glance_policy_overrides: {}
glance_policy_content: {}
glance_api_uwsgi_ini_overrides: {}
# Specify path on the local filesystem for glance-image-import.conf

View File

@ -41,7 +41,8 @@
- name: Deploy Glance configuration files
config_template:
src: "{{ item.src }}"
src: "{{ item.src | default(omit) }}"
content: "{{ item.content | default(omit) }}"
dest: "{{ item.dest }}"
owner: "root"
group: "{{ glance_system_group_name }}"
@ -79,6 +80,11 @@
dest: "{{ glance_etc_dir }}/schema-image.json"
config_overrides: "{{ glance_glance_scheme_json_overrides }}"
config_type: "json"
- dest: "{{ glance_etc_dir }}/policy.json"
config_overrides: "{{ glance_policy_overrides }}"
config_type: "json"
condition: "{{ (glance_policy_overrides) or (glance_policy_content) }}"
content: "{{ glance_policy_content }}"
notify:
- Manage LB
- Restart glance services

View File

@ -63,11 +63,6 @@ glance_mount_points: |-
{{ mps }}
glance_core_files:
- tmp_f: "/tmp/policy.json"
target_f: "{{ glance_etc_dir }}/policy.json"
config_overrides: "{{ glance_policy_overrides }}"
config_type: "json"
condition: true
- tmp_f: "/tmp/glance-registry-paste.ini"
target_f: "{{ glance_etc_dir }}/glance-registry-paste.ini"
config_overrides: "{{ glance_glance_registry_paste_ini_overrides }}"

View File

@ -34,11 +34,6 @@ glance_oslomsg_amqp1_distro_packages:
- cyrus-sasl-md5
glance_core_files:
- tmp_f: "/tmp/policy.json"
target_f: "{{ glance_etc_dir }}/policy.json"
config_overrides: "{{ glance_policy_overrides }}"
config_type: "json"
condition: true
- tmp_f: "/tmp/glance-registry-dist-paste.ini"
target_f: "{{ (glance_install_method == 'source') | ternary((glance_etc_dir ~ '/glance-registry-paste.ini'), '/usr/share/glance/glance-registry-dist-paste.ini') }}"
target_f_override: "{{ glance_etc_dir }}/glance-registry-paste.ini"