diff --git a/defaults/main.yml b/defaults/main.yml index 6b72cad9..a7d683d6 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -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 diff --git a/tasks/glance_post_install.yml b/tasks/glance_post_install.yml index b54e8f29..e490c76f 100644 --- a/tasks/glance_post_install.yml +++ b/tasks/glance_post_install.yml @@ -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 diff --git a/vars/main.yml b/vars/main.yml index a9697b8e..7da19e6f 100644 --- a/vars/main.yml +++ b/vars/main.yml @@ -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 }}" diff --git a/vars/redhat.yml b/vars/redhat.yml index 110fe4ff..58cc0fa1 100644 --- a/vars/redhat.yml +++ b/vars/redhat.yml @@ -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"