2015-07-12 03:02:33 +00:00
|
|
|
---
|
2015-12-18 19:40:48 +00:00
|
|
|
- name: Ensuring config directories exist
|
2016-08-23 22:34:21 +07:00
|
|
|
become: true
|
2015-12-18 19:40:48 +00:00
|
|
|
file:
|
2016-12-06 17:12:20 +08:00
|
|
|
path: "{{ node_config_directory }}/{{ item.key }}"
|
2015-12-18 19:40:48 +00:00
|
|
|
state: "directory"
|
2016-08-23 22:34:21 +07:00
|
|
|
owner: "{{ config_owner_user }}"
|
|
|
|
group: "{{ config_owner_group }}"
|
|
|
|
mode: "0770"
|
2024-03-30 22:22:43 +01:00
|
|
|
with_dict: "{{ nova_services | select_services_enabled_and_mapped_to_host }}"
|
2015-12-18 19:40:48 +00:00
|
|
|
|
2018-01-08 11:21:12 +07:00
|
|
|
- name: Check if policies shall be overwritten
|
2019-11-19 09:34:23 +00:00
|
|
|
stat:
|
|
|
|
path: "{{ item }}"
|
|
|
|
delegate_to: localhost
|
2018-01-08 11:21:12 +07:00
|
|
|
run_once: True
|
|
|
|
register: nova_policy
|
|
|
|
with_first_found:
|
|
|
|
- files: "{{ supported_policy_format_list }}"
|
|
|
|
paths:
|
|
|
|
- "{{ node_custom_config }}/nova/"
|
|
|
|
skip: true
|
|
|
|
|
|
|
|
- name: Set nova policy file
|
|
|
|
set_fact:
|
|
|
|
nova_policy_file: "{{ nova_policy.results.0.stat.path | basename }}"
|
|
|
|
nova_policy_file_path: "{{ nova_policy.results.0.stat.path }}"
|
|
|
|
when:
|
|
|
|
- nova_policy.results
|
|
|
|
|
2021-10-04 17:00:56 +02:00
|
|
|
- name: Check for vendordata file
|
|
|
|
stat:
|
|
|
|
path: "{{ node_custom_config }}/nova/vendordata.json"
|
|
|
|
delegate_to: localhost
|
|
|
|
run_once: True
|
|
|
|
register: vendordata_file
|
|
|
|
|
|
|
|
- name: Set vendordata file path
|
|
|
|
set_fact:
|
|
|
|
vendordata_file_path: "{{ vendordata_file.stat.path }}"
|
|
|
|
when:
|
|
|
|
- vendordata_file.stat.exists
|
|
|
|
|
2020-04-10 13:53:19 -07:00
|
|
|
- include_tasks: copy-certs.yml
|
2019-12-18 15:49:28 -08:00
|
|
|
when:
|
2020-04-30 22:43:37 -07:00
|
|
|
- kolla_copy_ca_into_containers | bool or nova_enable_tls_backend | bool
|
2019-12-18 15:49:28 -08:00
|
|
|
|
2015-12-18 19:40:48 +00:00
|
|
|
- name: Copying over config.json files for services
|
2016-08-23 22:34:21 +07:00
|
|
|
become: true
|
2015-08-28 18:42:18 -04:00
|
|
|
template:
|
2016-12-06 17:12:20 +08:00
|
|
|
src: "{{ item.key }}.json.j2"
|
|
|
|
dest: "{{ node_config_directory }}/{{ item.key }}/config.json"
|
2019-03-22 19:18:45 +00:00
|
|
|
mode: "0660"
|
2024-03-30 22:22:43 +01:00
|
|
|
with_dict: "{{ nova_services | select_services_enabled_and_mapped_to_host }}"
|
2016-12-06 17:12:20 +08:00
|
|
|
notify:
|
|
|
|
- "Restart {{ item.key }} container"
|
2015-12-18 19:40:48 +00:00
|
|
|
|
|
|
|
- name: Copying over nova.conf
|
2016-08-23 22:34:21 +07:00
|
|
|
become: true
|
2016-12-06 17:12:20 +08:00
|
|
|
vars:
|
2017-06-12 09:18:20 +08:00
|
|
|
service_name: "{{ item.key }}"
|
2015-12-18 19:40:48 +00:00
|
|
|
merge_configs:
|
|
|
|
sources:
|
|
|
|
- "{{ role_path }}/templates/nova.conf.j2"
|
2016-05-19 02:39:37 -04:00
|
|
|
- "{{ node_custom_config }}/global.conf"
|
|
|
|
- "{{ node_custom_config }}/nova.conf"
|
2016-12-06 17:12:20 +08:00
|
|
|
- "{{ node_custom_config }}/nova/{{ item.key }}.conf"
|
2016-05-19 02:39:37 -04:00
|
|
|
- "{{ node_custom_config }}/nova/{{ inventory_hostname }}/nova.conf"
|
2016-12-06 17:12:20 +08:00
|
|
|
dest: "{{ node_config_directory }}/{{ item.key }}/nova.conf"
|
2016-08-23 22:34:21 +07:00
|
|
|
mode: "0660"
|
2024-03-30 22:22:43 +01:00
|
|
|
with_dict: "{{ nova_services | select_services_enabled_and_mapped_to_host }}"
|
2016-12-06 17:12:20 +08:00
|
|
|
notify:
|
|
|
|
- "Restart {{ item.key }} container"
|
2015-12-18 19:40:48 +00:00
|
|
|
|
2018-01-08 11:21:12 +07:00
|
|
|
- name: Copying over existing policy file
|
2016-08-23 22:34:21 +07:00
|
|
|
become: true
|
2016-10-27 10:36:35 +02:00
|
|
|
template:
|
2018-01-08 11:21:12 +07:00
|
|
|
src: "{{ nova_policy_file_path }}"
|
|
|
|
dest: "{{ node_config_directory }}/{{ item.key }}/{{ nova_policy_file }}"
|
2019-03-22 19:18:45 +00:00
|
|
|
mode: "0660"
|
2016-12-06 17:12:20 +08:00
|
|
|
when:
|
2018-01-08 11:21:12 +07:00
|
|
|
- nova_policy_file is defined
|
2019-08-19 15:52:46 +01:00
|
|
|
- item.key in nova_services_require_policy_json
|
2024-03-30 22:22:43 +01:00
|
|
|
with_dict: "{{ nova_services | select_services_enabled_and_mapped_to_host }}"
|
2016-12-06 17:12:20 +08:00
|
|
|
notify:
|
|
|
|
- "Restart {{ item.key }} container"
|
|
|
|
|
2020-04-30 22:43:37 -07:00
|
|
|
- name: Copying over nova-api-wsgi.conf
|
2024-03-30 22:22:43 +01:00
|
|
|
vars:
|
|
|
|
service: "{{ nova_services['nova-api'] }}"
|
2020-04-30 22:43:37 -07:00
|
|
|
template:
|
|
|
|
src: "nova-api-wsgi.conf.j2"
|
|
|
|
dest: "{{ node_config_directory }}/nova-api/nova-api-wsgi.conf"
|
|
|
|
mode: "0660"
|
|
|
|
become: true
|
2024-03-30 22:22:43 +01:00
|
|
|
when: service | service_enabled_and_mapped_to_host
|
2020-04-30 22:43:37 -07:00
|
|
|
notify:
|
|
|
|
- "Restart nova-api container"
|
2021-10-04 17:00:56 +02:00
|
|
|
|
|
|
|
- name: Copying over vendordata file
|
|
|
|
vars:
|
|
|
|
service: "{{ nova_services['nova-api'] }}"
|
|
|
|
copy:
|
|
|
|
src: "{{ vendordata_file_path }}"
|
|
|
|
dest: "{{ node_config_directory }}/nova-api/vendordata.json"
|
|
|
|
mode: "0660"
|
|
|
|
become: True
|
|
|
|
when:
|
|
|
|
- vendordata_file_path is defined
|
2024-03-30 22:22:43 +01:00
|
|
|
- service | service_enabled_and_mapped_to_host
|
2021-10-04 17:00:56 +02:00
|
|
|
notify:
|
|
|
|
- "Restart nova-api container"
|