
This is a prerequisite for patchset #745164 This fixes unwanted restarts during copying of certificates. By removing conditional statements from role handlers in #745164, copying certificates caused containers to restart, this is unwanted during the genconfig process. However, if we would remove handler notifiers from copying certificates, the container would never restart, since from #745164, containers will restart only if any of the files specified in config.json change. Certificates are now copied to intermediary location inside of the container, from which the script kolla_copy_cacerts will install them in the trust store. Depends-on: https://review.opendev.org/c/openstack/kolla/+/926882 Change-Id: Ib89048c7e0f250182c4bf57d8c8a1b5478e9b4ab Signed-off-by: Roman Krček <roman.krcek@tietoevry.com>
131 lines
4.5 KiB
YAML
131 lines
4.5 KiB
YAML
---
|
|
- name: Ensuring config directories exist
|
|
become: true
|
|
file:
|
|
path: "{{ node_config_directory }}/{{ item.key }}"
|
|
state: "directory"
|
|
owner: "{{ config_owner_user }}"
|
|
group: "{{ config_owner_group }}"
|
|
mode: "0770"
|
|
with_dict: "{{ horizon_services | select_services_enabled_and_mapped_to_host }}"
|
|
|
|
- name: Set empty custom policy
|
|
set_fact:
|
|
custom_policy: []
|
|
|
|
- include_tasks: policy_item.yml
|
|
vars:
|
|
project_name: "{{ item.name }}"
|
|
when: item.enabled | bool
|
|
with_items:
|
|
- { name: "ceilometer", enabled: "{{ enable_ceilometer_horizon_policy_file }}" }
|
|
- { name: "cinder", enabled: "{{ enable_cinder_horizon_policy_file }}" }
|
|
- { name: "cloudkitty", enabled: "{{ enable_horizon_cloudkitty }}" }
|
|
- { name: "designate", enabled: "{{ enable_horizon_designate }}" }
|
|
- { name: "glance", enabled: "{{ enable_glance_horizon_policy_file }}" }
|
|
- { name: "heat", enabled: "{{ enable_heat_horizon_policy_file }}" }
|
|
- { name: "ironic", enabled: "{{ enable_horizon_ironic }}" }
|
|
- { name: "keystone", enabled: "{{ enable_keystone_horizon_policy_file }}" }
|
|
- { name: "magnum", enabled: "{{ enable_horizon_magnum }}" }
|
|
- { name: "manila", enabled: "{{ enable_horizon_manila }}" }
|
|
- { name: "masakari", enabled: "{{ enable_horizon_masakari }}" }
|
|
- { name: "mistral", enabled: "{{ enable_horizon_mistral }}" }
|
|
- { name: "neutron", enabled: "{{ enable_neutron_horizon_policy_file }}" }
|
|
- { name: "nova", enabled: "{{ enable_nova_horizon_policy_file }}" }
|
|
- { name: "octavia", enabled: "{{ enable_horizon_octavia }}" }
|
|
- { name: "tacker", enabled: "{{ enable_horizon_tacker }}" }
|
|
- { name: "trove", enabled: "{{ enable_horizon_trove }}" }
|
|
- { name: "watcher", enabled: "{{ enable_horizon_watcher }}" }
|
|
|
|
- name: Copying over config.json files for services
|
|
become: true
|
|
vars:
|
|
service: "{{ horizon_services['horizon'] }}"
|
|
template:
|
|
src: "horizon.json.j2"
|
|
dest: "{{ node_config_directory }}/horizon/config.json"
|
|
mode: "0660"
|
|
when: service | service_enabled_and_mapped_to_host
|
|
notify:
|
|
- Restart horizon container
|
|
|
|
- name: Copying over horizon.conf
|
|
become: true
|
|
vars:
|
|
service: "{{ horizon_services['horizon'] }}"
|
|
template:
|
|
src: "{{ item }}"
|
|
dest: "{{ node_config_directory }}/horizon/horizon.conf"
|
|
mode: "0660"
|
|
with_first_found:
|
|
- "{{ node_custom_config }}/horizon/{{ inventory_hostname }}/horizon.conf"
|
|
- "{{ node_custom_config }}/horizon/horizon.conf"
|
|
- "horizon.conf.j2"
|
|
when: service | service_enabled_and_mapped_to_host
|
|
notify:
|
|
- Restart horizon container
|
|
|
|
- name: Copying over kolla-settings.py
|
|
become: true
|
|
vars:
|
|
service: "{{ horizon_services['horizon'] }}"
|
|
template:
|
|
src: "{{ item }}"
|
|
dest: "{{ node_config_directory }}/horizon/_9998-kolla-settings.py"
|
|
mode: "0660"
|
|
with_first_found:
|
|
- "{{ node_custom_config }}/horizon/{{ inventory_hostname }}/_9998-kolla-settings.py"
|
|
- "{{ node_custom_config }}/horizon/_9998-kolla-settings.py"
|
|
- "_9998-kolla-settings.py.j2"
|
|
when: service | service_enabled_and_mapped_to_host
|
|
notify:
|
|
- Restart horizon container
|
|
|
|
- name: Copying over custom-settings.py
|
|
become: true
|
|
vars:
|
|
service: "{{ horizon_services['horizon'] }}"
|
|
template:
|
|
src: "{{ item }}"
|
|
dest: "{{ node_config_directory }}/horizon/_9999-custom-settings.py"
|
|
mode: "0660"
|
|
with_first_found:
|
|
- "{{ node_custom_config }}/horizon/{{ inventory_hostname }}/_9999-custom-settings.py"
|
|
- "{{ node_custom_config }}/horizon/_9999-custom-settings.py"
|
|
- "_9999-custom-settings.py.j2"
|
|
when: service | service_enabled_and_mapped_to_host
|
|
notify:
|
|
- Restart horizon container
|
|
|
|
- name: Copying over existing policy file
|
|
become: true
|
|
vars:
|
|
service: "{{ horizon_services['horizon'] }}"
|
|
template:
|
|
src: "{{ item }}"
|
|
dest: "{{ node_config_directory }}/horizon/{{ item | basename }}"
|
|
mode: "0660"
|
|
when: service | service_enabled_and_mapped_to_host
|
|
with_items: "{{ custom_policy }}"
|
|
notify:
|
|
- Restart horizon container
|
|
|
|
- name: Copying over custom themes
|
|
become: true
|
|
vars:
|
|
service: "{{ horizon_services['horizon'] }}"
|
|
copy:
|
|
src: "{{ node_custom_config }}/horizon/themes/{{ item.name }}"
|
|
dest: "{{ node_config_directory }}/horizon/themes/"
|
|
mode: 0660
|
|
when:
|
|
- service | service_enabled_and_mapped_to_host
|
|
- horizon_custom_themes | length > 0
|
|
with_items: "{{ horizon_custom_themes }}"
|
|
notify:
|
|
- Restart horizon container
|
|
|
|
- include_tasks: copy-certs.yml
|
|
when:
|
|
- horizon_copy_certs
|