Performance: use filters for service dicts

Most roles are not leveraging the jinja filters available.
According to [1] filtering the list of services makes the execution
faster than skipping the tasks.

This patchset also includes some cosmetic changes to genconfig.
Individual services are now also using a jinja filter. This has
no impact on performance, just makes the tasks look cleaner.

Naming of some vars in genconfig was changed to "service" to make
the tasks more uniform as some were previously using
the service name and some were using "service".

Three metrics from the deployment were taken and those were
- overall deployment time [s]
- time spent on the specific role [s]
- CPU usage (measured with perf) [-]
Overall genconfig time went down on avg. from 209s to 195s
Time spent on the loadbalancer role went down on avg. from 27s to 23s
Time spent on the neutron role went down on avg from 102s to 95s
Time spent on the nova-cell role went down on avg. from 54s to 52s
Also the average CPUs utilized reported by perf went down
from 3.31 to 3.15.
For details of how this was measured see the comments in gerrit.

[1] - https://github.com/stackhpc/ansible-scaling/blob/master/doc/skip.md

Change-Id: Ib0f00aadb6c7022de6e8b455ac4b9b8cd6be5b1b
Signed-off-by: Roman Krček <roman.krcek@tietoevry.com>
This commit is contained in:
Roman Krček 2024-03-30 22:22:43 +01:00
parent 6e88d3dc79
commit fb3a8f5fa9
126 changed files with 532 additions and 1449 deletions

View File

@ -9,9 +9,6 @@
volumes: "{{ item.value.volumes | reject('equalto', '') | list }}" volumes: "{{ item.value.volumes | reject('equalto', '') | list }}"
dimensions: "{{ item.value.dimensions }}" dimensions: "{{ item.value.dimensions }}"
healthcheck: "{{ item.value.healthcheck | default(omit) }}" healthcheck: "{{ item.value.healthcheck | default(omit) }}"
when: with_dict: "{{ aodh_services | select_services_enabled_and_mapped_to_host }}"
- inventory_hostname in groups[item.value.group]
- item.value.enabled | bool
with_dict: "{{ aodh_services }}"
notify: notify:
- "Restart {{ item.key }} container" - "Restart {{ item.key }} container"

View File

@ -7,10 +7,7 @@
group: "{{ config_owner_group }}" group: "{{ config_owner_group }}"
mode: "0770" mode: "0770"
become: true become: true
when: with_dict: "{{ aodh_services | select_services_enabled_and_mapped_to_host }}"
- item.value.enabled | bool
- inventory_hostname in groups[item.value.group]
with_dict: "{{ aodh_services }}"
- name: Check if policies shall be overwritten - name: Check if policies shall be overwritten
stat: stat:
@ -39,9 +36,7 @@
become: true become: true
when: when:
- aodh_policy_file is defined - aodh_policy_file is defined
- inventory_hostname in groups[item.value.group] with_dict: "{{ aodh_services | select_services_enabled_and_mapped_to_host }}"
- item.value.enabled | bool
with_dict: "{{ aodh_services }}"
notify: notify:
- "Restart {{ item.key }} container" - "Restart {{ item.key }} container"
@ -55,10 +50,7 @@
dest: "{{ node_config_directory }}/{{ item.key }}/config.json" dest: "{{ node_config_directory }}/{{ item.key }}/config.json"
mode: "0660" mode: "0660"
become: true become: true
when: with_dict: "{{ aodh_services | select_services_enabled_and_mapped_to_host }}"
- item.value.enabled | bool
- inventory_hostname in groups[item.value.group]
with_dict: "{{ aodh_services }}"
notify: notify:
- "Restart {{ item.key }} container" - "Restart {{ item.key }} container"
@ -75,10 +67,7 @@
dest: "{{ node_config_directory }}/{{ item.key }}/aodh.conf" dest: "{{ node_config_directory }}/{{ item.key }}/aodh.conf"
mode: "0660" mode: "0660"
become: true become: true
when: with_dict: "{{ aodh_services | select_services_enabled_and_mapped_to_host }}"
- item.value.enabled | bool
- inventory_hostname in groups[item.value.group]
with_dict: "{{ aodh_services }}"
notify: notify:
- "Restart {{ item.key }} container" - "Restart {{ item.key }} container"
@ -90,8 +79,6 @@
dest: "{{ node_config_directory }}/aodh-api/wsgi-aodh.conf" dest: "{{ node_config_directory }}/aodh-api/wsgi-aodh.conf"
mode: "0660" mode: "0660"
become: true become: true
when: when: service | service_enabled_and_mapped_to_host
- inventory_hostname in groups[service.group]
- service.enabled | bool
notify: notify:
- "Restart aodh-api container" - "Restart aodh-api container"

View File

@ -9,9 +9,6 @@
volumes: "{{ item.value.volumes | reject('equalto', '') | list }}" volumes: "{{ item.value.volumes | reject('equalto', '') | list }}"
dimensions: "{{ item.value.dimensions }}" dimensions: "{{ item.value.dimensions }}"
healthcheck: "{{ item.value.healthcheck | default(omit) }}" healthcheck: "{{ item.value.healthcheck | default(omit) }}"
when: with_dict: "{{ barbican_services | select_services_enabled_and_mapped_to_host }}"
- inventory_hostname in groups[item.value.group]
- item.value.enabled | bool
with_dict: "{{ barbican_services }}"
notify: notify:
- "Restart {{ item.key }} container" - "Restart {{ item.key }} container"

View File

@ -7,10 +7,7 @@
group: "{{ config_owner_group }}" group: "{{ config_owner_group }}"
mode: "0770" mode: "0770"
become: true become: true
when: with_dict: "{{ barbican_services | select_services_enabled_and_mapped_to_host }}"
- inventory_hostname in groups[item.value.group]
- item.value.enabled | bool
with_dict: "{{ barbican_services }}"
- name: Ensuring vassals config directories exist - name: Ensuring vassals config directories exist
vars: vars:
@ -22,9 +19,7 @@
group: "{{ config_owner_group }}" group: "{{ config_owner_group }}"
mode: "0770" mode: "0770"
become: true become: true
when: when: service | service_enabled_and_mapped_to_host
- inventory_hostname in groups[service.group]
- service.enabled | bool
with_items: with_items:
- "barbican-api/vassals" - "barbican-api/vassals"
@ -57,10 +52,7 @@
dest: "{{ node_config_directory }}/{{ item.key }}/config.json" dest: "{{ node_config_directory }}/{{ item.key }}/config.json"
mode: "0660" mode: "0660"
become: true become: true
when: with_dict: "{{ barbican_services | select_services_enabled_and_mapped_to_host }}"
- inventory_hostname in groups[item.value.group]
- item.value.enabled | bool
with_dict: "{{ barbican_services }}"
notify: notify:
- Restart {{ item.key }} container - Restart {{ item.key }} container
@ -75,9 +67,7 @@
dest: "{{ node_config_directory }}/barbican-api/vassals/barbican-api.ini" dest: "{{ node_config_directory }}/barbican-api/vassals/barbican-api.ini"
mode: "0660" mode: "0660"
become: true become: true
when: when: service | service_enabled_and_mapped_to_host
- inventory_hostname in groups[service.group]
- service.enabled | bool
notify: notify:
- Restart barbican-api container - Restart barbican-api container
@ -89,9 +79,7 @@
run_once: True run_once: True
delegate_to: localhost delegate_to: localhost
register: check_barbican_api_paste_ini register: check_barbican_api_paste_ini
when: when: service | service_enabled_and_mapped_to_host
- inventory_hostname in groups[service.group]
- service.enabled | bool
- name: Copying over barbican-api-paste.ini - name: Copying over barbican-api-paste.ini
vars: vars:
@ -102,8 +90,7 @@
mode: "0660" mode: "0660"
become: true become: true
when: when:
- inventory_hostname in groups[service.group] - service | service_enabled_and_mapped_to_host
- service.enabled | bool
- check_barbican_api_paste_ini.stat.exists - check_barbican_api_paste_ini.stat.exists
notify: notify:
- Restart barbican-api container - Restart barbican-api container
@ -121,10 +108,7 @@
dest: "{{ node_config_directory }}/{{ item.key }}/barbican.conf" dest: "{{ node_config_directory }}/{{ item.key }}/barbican.conf"
mode: "0660" mode: "0660"
become: true become: true
when: with_dict: "{{ barbican_services | select_services_enabled_and_mapped_to_host }}"
- item.value.enabled | bool
- inventory_hostname in groups[item.value.group]
with_dict: "{{ barbican_services }}"
notify: notify:
- Restart {{ item.key }} container - Restart {{ item.key }} container
@ -136,8 +120,6 @@
become: true become: true
when: when:
- barbican_policy_file is defined - barbican_policy_file is defined
- inventory_hostname in groups[item.value.group] with_dict: "{{ barbican_services | select_services_enabled_and_mapped_to_host }}"
- item.value.enabled | bool
with_dict: "{{ barbican_services }}"
notify: notify:
- Restart {{ item.key }} container - Restart {{ item.key }} container

View File

@ -9,9 +9,6 @@
volumes: "{{ item.value.volumes | reject('equalto', '') | list }}" volumes: "{{ item.value.volumes | reject('equalto', '') | list }}"
dimensions: "{{ item.value.dimensions }}" dimensions: "{{ item.value.dimensions }}"
healthcheck: "{{ item.value.healthcheck | default(omit) }}" healthcheck: "{{ item.value.healthcheck | default(omit) }}"
when: with_dict: "{{ blazar_services | select_services_enabled_and_mapped_to_host }}"
- inventory_hostname in groups[item.value.group]
- item.value.enabled | bool
with_dict: "{{ blazar_services }}"
notify: notify:
- "Restart {{ item.key }} container" - "Restart {{ item.key }} container"

View File

@ -7,10 +7,7 @@
group: "{{ config_owner_group }}" group: "{{ config_owner_group }}"
mode: "0770" mode: "0770"
become: true become: true
when: with_dict: "{{ blazar_services | select_services_enabled_and_mapped_to_host }}"
- inventory_hostname in groups[item.value.group]
- item.value.enabled | bool
with_dict: "{{ blazar_services }}"
- name: Check if policies shall be overwritten - name: Check if policies shall be overwritten
stat: stat:
@ -41,10 +38,7 @@
dest: "{{ node_config_directory }}/{{ item.key }}/config.json" dest: "{{ node_config_directory }}/{{ item.key }}/config.json"
mode: "0660" mode: "0660"
become: true become: true
when: with_dict: "{{ blazar_services | select_services_enabled_and_mapped_to_host }}"
- item.value.enabled | bool
- inventory_hostname in groups[item.value.group]
with_dict: "{{ blazar_services }}"
notify: notify:
- Restart {{ item.key }} container - Restart {{ item.key }} container
@ -61,10 +55,7 @@
dest: "{{ node_config_directory }}/{{ item.key }}/blazar.conf" dest: "{{ node_config_directory }}/{{ item.key }}/blazar.conf"
mode: "0660" mode: "0660"
become: true become: true
when: with_dict: "{{ blazar_services | select_services_enabled_and_mapped_to_host }}"
- item.value.enabled | bool
- inventory_hostname in groups[item.value.group]
with_dict: "{{ blazar_services }}"
notify: notify:
- Restart {{ item.key }} container - Restart {{ item.key }} container
@ -76,8 +67,6 @@
become: true become: true
when: when:
- blazar_policy_file is defined - blazar_policy_file is defined
- inventory_hostname in groups[item.value.group] with_dict: "{{ blazar_services | select_services_enabled_and_mapped_to_host }}"
- item.value.enabled | bool
with_dict: "{{ blazar_services }}"
notify: notify:
- Restart {{ item.key }} container - Restart {{ item.key }} container

View File

@ -10,9 +10,6 @@
volumes: "{{ item.value.volumes | reject('equalto', '') | list }}" volumes: "{{ item.value.volumes | reject('equalto', '') | list }}"
dimensions: "{{ item.value.dimensions }}" dimensions: "{{ item.value.dimensions }}"
healthcheck: "{{ item.value.healthcheck | default(omit) }}" healthcheck: "{{ item.value.healthcheck | default(omit) }}"
when: with_dict: "{{ ceilometer_services | select_services_enabled_and_mapped_to_host }}"
- inventory_hostname in groups[item.value.group]
- item.value.enabled | bool
with_dict: "{{ ceilometer_services }}"
notify: notify:
- "Restart {{ item.key }} container" - "Restart {{ item.key }} container"

View File

@ -7,10 +7,7 @@
group: "{{ config_owner_group }}" group: "{{ config_owner_group }}"
mode: "0770" mode: "0770"
become: true become: true
when: with_dict: "{{ ceilometer_services | select_services_enabled_and_mapped_to_host }}"
- inventory_hostname in groups[item.value.group]
- item.value.enabled | bool
with_dict: "{{ ceilometer_services }}"
- name: Check if the folder for custom meter definitions exist - name: Check if the folder for custom meter definitions exist
stat: stat:
@ -42,11 +39,9 @@
group: "{{ config_owner_group }}" group: "{{ config_owner_group }}"
mode: "0770" mode: "0770"
become: true become: true
with_dict: "{{ ceilometer_services }}" with_dict: "{{ ceilometer_services | select_services_enabled_and_mapped_to_host }}"
when: when:
- should_copy_custom_meter_definitions - should_copy_custom_meter_definitions
- inventory_hostname in groups[item.value.group]
- item.value.enabled | bool
- name: Copying custom meter definitions to Ceilometer - name: Copying custom meter definitions to Ceilometer
copy: copy:
@ -57,9 +52,7 @@
become: true become: true
when: when:
- should_copy_custom_meter_definitions - should_copy_custom_meter_definitions
- inventory_hostname in groups[item.value.group] with_dict: "{{ ceilometer_services | select_services_enabled_and_mapped_to_host }}"
- item.value.enabled | bool
with_dict: "{{ ceilometer_services }}"
notify: notify:
- "Restart {{ item.key }} container" - "Restart {{ item.key }} container"
@ -118,9 +111,7 @@
become: true become: true
when: when:
- ceilometer_polling_file.stat.exists - ceilometer_polling_file.stat.exists
- inventory_hostname in groups[item.value.group] with_dict: "{{ ceilometer_services | select_services_enabled_and_mapped_to_host }}"
- item.value.enabled | bool
with_dict: "{{ ceilometer_services }}"
notify: notify:
- "Restart {{ item.key }} container" - "Restart {{ item.key }} container"
@ -145,9 +136,7 @@
become: true become: true
when: when:
- ceilometer_gnocchi_resources_file.stat.exists - ceilometer_gnocchi_resources_file.stat.exists
- inventory_hostname in groups[item.value.group] with_dict: "{{ ceilometer_services | select_services_enabled_and_mapped_to_host }}"
- item.value.enabled | bool
with_dict: "{{ ceilometer_services }}"
notify: notify:
- "Restart {{ item.key }} container" - "Restart {{ item.key }} container"
@ -186,10 +175,7 @@
dest: "{{ node_config_directory }}/{{ item.key }}/config.json" dest: "{{ node_config_directory }}/{{ item.key }}/config.json"
mode: "0660" mode: "0660"
become: true become: true
when: with_dict: "{{ ceilometer_services | select_services_enabled_and_mapped_to_host }}"
- inventory_hostname in groups[item.value.group]
- item.value.enabled | bool
with_dict: "{{ ceilometer_services }}"
notify: notify:
- "Restart {{ item.key }} container" - "Restart {{ item.key }} container"
@ -206,10 +192,7 @@
dest: "{{ node_config_directory }}/{{ item.key }}/ceilometer.conf" dest: "{{ node_config_directory }}/{{ item.key }}/ceilometer.conf"
mode: "0660" mode: "0660"
become: true become: true
when: with_dict: "{{ ceilometer_services | select_services_enabled_and_mapped_to_host }}"
- item.value.enabled | bool
- inventory_hostname in groups[item.value.group]
with_dict: "{{ ceilometer_services }}"
notify: notify:
- "Restart {{ item.key }} container" - "Restart {{ item.key }} container"
@ -231,8 +214,7 @@
register: ceilometer_event_definitions_overwriting register: ceilometer_event_definitions_overwriting
when: when:
- ceilometer_event_definitions_file.stat.exists - ceilometer_event_definitions_file.stat.exists
- inventory_hostname in groups[service.group] - service | service_enabled_and_mapped_to_host
- service.enabled | bool
notify: notify:
- Restart ceilometer-notification container - Restart ceilometer-notification container
@ -246,8 +228,7 @@
become: true become: true
register: ceilometer_event_definitions register: ceilometer_event_definitions
when: when:
- inventory_hostname in groups[service.group] - service | service_enabled_and_mapped_to_host
- service.enabled | bool
- not ceilometer_event_definitions_file.stat.exists - not ceilometer_event_definitions_file.stat.exists
notify: notify:
- Restart ceilometer-notification container - Restart ceilometer-notification container
@ -263,9 +244,7 @@
dest: "{{ node_config_directory }}/ceilometer-notification/event_pipeline.yaml" dest: "{{ node_config_directory }}/ceilometer-notification/event_pipeline.yaml"
mode: "0660" mode: "0660"
become: true become: true
when: when: service | service_enabled_and_mapped_to_host
- inventory_hostname in groups[service.group]
- service.enabled | bool
notify: notify:
- Restart ceilometer-notification container - Restart ceilometer-notification container
@ -290,10 +269,8 @@
register: ceilometer_pipeline_overwriting register: ceilometer_pipeline_overwriting
when: when:
- ceilometer_pipeline_file.stat.exists - ceilometer_pipeline_file.stat.exists
- inventory_hostname in groups[item.value.group]
- item.value.enabled | bool
- item.key in services_require_pipeline - item.key in services_require_pipeline
with_dict: "{{ ceilometer_services }}" with_dict: "{{ ceilometer_services | select_services_enabled_and_mapped_to_host }}"
notify: notify:
- "Restart {{ item.key }} container" - "Restart {{ item.key }} container"
@ -309,11 +286,9 @@
mode: "0660" mode: "0660"
become: true become: true
when: when:
- inventory_hostname in groups[item.value.group]
- item.value.enabled | bool
- item.key in services_require_pipeline - item.key in services_require_pipeline
- not ceilometer_pipeline_file.stat.exists - not ceilometer_pipeline_file.stat.exists
with_dict: "{{ ceilometer_services }}" with_dict: "{{ ceilometer_services | select_services_enabled_and_mapped_to_host }}"
notify: notify:
- "Restart {{ item.key }} container" - "Restart {{ item.key }} container"
@ -328,8 +303,7 @@
when: when:
- nova_compute_virt_type == "vmware" - nova_compute_virt_type == "vmware"
- not vmware_vcenter_insecure | bool - not vmware_vcenter_insecure | bool
- inventory_hostname in groups[service.group] - service | service_enabled_and_mapped_to_host
- service.enabled | bool
notify: notify:
- Restart ceilometer-compute container - Restart ceilometer-compute container
@ -341,8 +315,6 @@
become: true become: true
when: when:
- ceilometer_policy_file is defined - ceilometer_policy_file is defined
- inventory_hostname in groups[item.value.group] with_dict: "{{ ceilometer_services | select_services_enabled_and_mapped_to_host }}"
- item.value.enabled | bool
with_dict: "{{ ceilometer_services }}"
notify: notify:
- "Restart {{ item.key }} container" - "Restart {{ item.key }} container"

View File

@ -12,9 +12,6 @@
healthcheck: "{{ item.value.healthcheck | default(omit) }}" healthcheck: "{{ item.value.healthcheck | default(omit) }}"
privileged: "{{ item.value.privileged | default(False) }}" privileged: "{{ item.value.privileged | default(False) }}"
ipc_mode: "{{ item.value.ipc_mode | default('') }}" ipc_mode: "{{ item.value.ipc_mode | default('') }}"
when: with_dict: "{{ cinder_services | select_services_enabled_and_mapped_to_host }}"
- inventory_hostname in groups[item.value.group]
- item.value.enabled | bool
with_dict: "{{ cinder_services }}"
notify: notify:
- "Restart {{ item.key }} container" - "Restart {{ item.key }} container"

View File

@ -7,10 +7,7 @@
group: "{{ config_owner_group }}" group: "{{ config_owner_group }}"
mode: "0770" mode: "0770"
become: true become: true
when: with_dict: "{{ cinder_services | select_services_enabled_and_mapped_to_host }}"
- inventory_hostname in groups[item.value.group]
- item.value.enabled | bool
with_dict: "{{ cinder_services }}"
- include_tasks: external_ceph.yml - include_tasks: external_ceph.yml
when: when:
@ -47,10 +44,7 @@
dest: "{{ node_config_directory }}/{{ item.key }}/config.json" dest: "{{ node_config_directory }}/{{ item.key }}/config.json"
mode: "0660" mode: "0660"
become: true become: true
when: with_dict: "{{ cinder_services | select_services_enabled_and_mapped_to_host }}"
- inventory_hostname in groups[item.value.group]
- item.value.enabled | bool
with_dict: "{{ cinder_services }}"
notify: notify:
- "Restart {{ item.key }} container" - "Restart {{ item.key }} container"
@ -66,9 +60,7 @@
- "{{ node_custom_config }}/cinder/{{ inventory_hostname }}/cinder-wsgi.conf" - "{{ node_custom_config }}/cinder/{{ inventory_hostname }}/cinder-wsgi.conf"
- "{{ node_custom_config }}/cinder/cinder-wsgi.conf" - "{{ node_custom_config }}/cinder/cinder-wsgi.conf"
- "cinder-wsgi.conf.j2" - "cinder-wsgi.conf.j2"
when: when: service | service_enabled_and_mapped_to_host
- inventory_hostname in groups[service.group]
- service.enabled | bool
notify: notify:
- Restart cinder-api container - Restart cinder-api container
@ -85,10 +77,7 @@
dest: "{{ node_config_directory }}/{{ item.key }}/cinder.conf" dest: "{{ node_config_directory }}/{{ item.key }}/cinder.conf"
mode: "0660" mode: "0660"
become: true become: true
when: with_dict: "{{ cinder_services | select_services_enabled_and_mapped_to_host }}"
- item.value.enabled | bool
- inventory_hostname in groups[item.value.group]
with_dict: "{{ cinder_services }}"
notify: notify:
- "Restart {{ item.key }} container" - "Restart {{ item.key }} container"
@ -101,9 +90,7 @@
dest: "{{ node_config_directory }}/cinder-volume/hostnqn" dest: "{{ node_config_directory }}/cinder-volume/hostnqn"
mode: "0660" mode: "0660"
become: true become: true
when: when: service | service_enabled_and_mapped_to_host
- inventory_hostname in groups[service.group]
- service.enabled | bool
notify: notify:
- Restart cinder-volume container - Restart cinder-volume container
@ -114,14 +101,14 @@
dest: "{{ node_config_directory }}/{{ item.key }}/{{ cinder_policy_file }}" dest: "{{ node_config_directory }}/{{ item.key }}/{{ cinder_policy_file }}"
mode: "0660" mode: "0660"
when: when:
- item.value.enabled | bool
- cinder_policy_file is defined - cinder_policy_file is defined
- inventory_hostname in groups[item.value.group] with_dict: "{{ cinder_services | select_services_enabled_and_mapped_to_host }}"
with_dict: "{{ cinder_services }}"
notify: notify:
- "Restart {{ item.key }} container" - "Restart {{ item.key }} container"
- name: Copying over nfs_shares files for cinder_volume - name: Copying over nfs_shares files for cinder_volume
vars:
service: "{{ cinder_services['cinder-volume'] }}"
become: true become: true
template: template:
src: "{{ item }}" src: "{{ item }}"
@ -138,6 +125,6 @@
- "{{ node_custom_config }}/cinder/cinder-volume/nfs_shares" - "{{ node_custom_config }}/cinder/cinder-volume/nfs_shares"
- "{{ node_custom_config }}/cinder/{{ inventory_hostname }}/nfs_shares" - "{{ node_custom_config }}/cinder/{{ inventory_hostname }}/nfs_shares"
skip: "{{ not enable_cinder_backend_nfs | bool and not enable_cinder_backend_hnas_nfs | bool }}" skip: "{{ not enable_cinder_backend_nfs | bool and not enable_cinder_backend_hnas_nfs | bool }}"
when: inventory_hostname in groups['cinder-volume'] when: service | service_enabled_and_mapped_to_host
notify: notify:
- Restart cinder-volume container - Restart cinder-volume container

View File

@ -9,9 +9,7 @@
group: "{{ config_owner_group }}" group: "{{ config_owner_group }}"
mode: "0770" mode: "0770"
become: true become: true
when: when: service | service_enabled_and_mapped_to_host
- inventory_hostname in groups[service.group]
- service.enabled | bool
with_items: with_items:
- "cinder-volume" - "cinder-volume"
- "cinder-backup" - "cinder-backup"
@ -32,8 +30,7 @@
mode: "0660" mode: "0660"
become: true become: true
when: when:
- service.enabled | bool - service | service_enabled_and_mapped_to_host
- inventory_hostname in groups[service.group]
- service_name in services_need_config - service_name in services_need_config
with_nested: with_nested:
- "{{ cinder_services | dict2items }}" - "{{ cinder_services | dict2items }}"
@ -44,6 +41,7 @@
- name: Copy over Ceph keyring files for cinder-volume - name: Copy over Ceph keyring files for cinder-volume
vars: vars:
keyring: "{{ item.cluster }}.{{ ceph_cinder_keyring }}" keyring: "{{ item.cluster }}.{{ ceph_cinder_keyring }}"
service: "{{ cinder_services['cinder-volume'] }}"
template: template:
src: "{{ node_custom_config }}/cinder/cinder-volume/{{ keyring }}" src: "{{ node_custom_config }}/cinder/cinder-volume/{{ keyring }}"
dest: "{{ node_config_directory }}/cinder-volume/ceph/{{ keyring }}" dest: "{{ node_config_directory }}/cinder-volume/ceph/{{ keyring }}"
@ -52,12 +50,13 @@
with_items: "{{ cinder_ceph_backends }}" with_items: "{{ cinder_ceph_backends }}"
when: when:
- external_ceph_cephx_enabled | bool - external_ceph_cephx_enabled | bool
- inventory_hostname in groups['cinder-volume'] - service | service_enabled_and_mapped_to_host
- cinder_services['cinder-volume'].enabled | bool
notify: notify:
- Restart cinder-volume container - Restart cinder-volume container
- name: Copy over Ceph keyring files for cinder-backup - name: Copy over Ceph keyring files for cinder-backup
vars:
service: "{{ cinder_services['cinder-backup'] }}"
template: template:
src: "{{ node_custom_config }}/cinder/cinder-backup/{{ item }}" src: "{{ node_custom_config }}/cinder/cinder-backup/{{ item }}"
dest: "{{ node_config_directory }}/cinder-backup/ceph/{{ item }}" dest: "{{ node_config_directory }}/cinder-backup/ceph/{{ item }}"
@ -69,8 +68,7 @@
- "{{ cinder_backup_ceph_backend.cluster }}.{{ ceph_cinder_backup_keyring }}" - "{{ cinder_backup_ceph_backend.cluster }}.{{ ceph_cinder_backup_keyring }}"
when: when:
- external_ceph_cephx_enabled | bool - external_ceph_cephx_enabled | bool
- inventory_hostname in groups['cinder-backup'] - service | service_enabled_and_mapped_to_host
- cinder_services['cinder-backup'].enabled | bool
notify: notify:
- Restart cinder-backup container - Restart cinder-backup container

View File

@ -9,9 +9,6 @@
volumes: "{{ item.value.volumes | reject('equalto', '') | list }}" volumes: "{{ item.value.volumes | reject('equalto', '') | list }}"
dimensions: "{{ item.value.dimensions }}" dimensions: "{{ item.value.dimensions }}"
healthcheck: "{{ item.value.healthcheck | default(omit) }}" healthcheck: "{{ item.value.healthcheck | default(omit) }}"
when: with_dict: "{{ cloudkitty_services | select_services_enabled_and_mapped_to_host }}"
- inventory_hostname in groups[item.value.group]
- item.value.enabled | bool
with_dict: "{{ cloudkitty_services }}"
notify: notify:
- "Restart {{ item.key }} container" - "Restart {{ item.key }} container"

View File

@ -7,10 +7,7 @@
group: "{{ config_owner_group }}" group: "{{ config_owner_group }}"
mode: "0770" mode: "0770"
become: true become: true
when: with_dict: "{{ cloudkitty_services | select_services_enabled_and_mapped_to_host }}"
- inventory_hostname in groups[item.value.group]
- item.value.enabled | bool
with_dict: "{{ cloudkitty_services }}"
- name: Check if policies shall be overwritten - name: Check if policies shall be overwritten
stat: stat:
@ -45,9 +42,7 @@
become: true become: true
when: when:
- cloudkitty_custom_metrics_file.stat.exists - cloudkitty_custom_metrics_file.stat.exists
- inventory_hostname in groups[item.value.group] with_dict: "{{ cloudkitty_services | select_services_enabled_and_mapped_to_host }}"
- item.value.enabled | bool
with_dict: "{{ cloudkitty_services }}"
notify: notify:
- "Restart {{ item.key }} container" - "Restart {{ item.key }} container"
@ -65,10 +60,7 @@
dest: "{{ node_config_directory }}/{{ item.key }}/config.json" dest: "{{ node_config_directory }}/{{ item.key }}/config.json"
mode: "0660" mode: "0660"
become: true become: true
when: with_dict: "{{ cloudkitty_services | select_services_enabled_and_mapped_to_host }}"
- item.value.enabled | bool
- inventory_hostname in groups[item.value.group]
with_dict: "{{ cloudkitty_services }}"
notify: notify:
- Restart {{ item.key }} container - Restart {{ item.key }} container
@ -85,10 +77,7 @@
dest: "{{ node_config_directory }}/{{ item.key }}/cloudkitty.conf" dest: "{{ node_config_directory }}/{{ item.key }}/cloudkitty.conf"
mode: "0660" mode: "0660"
become: true become: true
when: with_dict: "{{ cloudkitty_services | select_services_enabled_and_mapped_to_host }}"
- inventory_hostname in groups[item.value.group]
- item.value.enabled | bool
with_dict: "{{ cloudkitty_services }}"
notify: notify:
- Restart {{ item.key }} container - Restart {{ item.key }} container
@ -100,9 +89,7 @@
dest: "{{ node_config_directory }}/cloudkitty-api/wsgi-cloudkitty.conf" dest: "{{ node_config_directory }}/cloudkitty-api/wsgi-cloudkitty.conf"
mode: "0660" mode: "0660"
become: true become: true
when: when: service | service_enabled_and_mapped_to_host
- inventory_hostname in groups[service.group]
- service.enabled | bool
notify: notify:
- Restart cloudkitty-api container - Restart cloudkitty-api container
@ -114,8 +101,6 @@
become: true become: true
when: when:
- cloudkitty_policy_file is defined - cloudkitty_policy_file is defined
- inventory_hostname in groups[item.value.group] with_dict: "{{ cloudkitty_services | select_services_enabled_and_mapped_to_host }}"
- item.value.enabled | bool
with_dict: "{{ cloudkitty_services }}"
notify: notify:
- Restart {{ item.key }} container - Restart {{ item.key }} container

View File

@ -9,9 +9,6 @@
privileged: "{{ item.value.privileged | default(False) }}" privileged: "{{ item.value.privileged | default(False) }}"
volumes: "{{ item.value.volumes }}" volumes: "{{ item.value.volumes }}"
dimensions: "{{ item.value.dimensions }}" dimensions: "{{ item.value.dimensions }}"
when: with_dict: "{{ collectd_services | select_services_enabled_and_mapped_to_host }}"
- inventory_hostname in groups[item.value.group]
- item.value.enabled | bool
with_dict: "{{ collectd_services }}"
notify: notify:
- "Restart {{ item.key }} container" - "Restart {{ item.key }} container"

View File

@ -7,10 +7,7 @@
group: "{{ config_owner_group }}" group: "{{ config_owner_group }}"
mode: "0770" mode: "0770"
become: true become: true
when: with_dict: "{{ collectd_services | select_services_enabled_and_mapped_to_host }}"
- inventory_hostname in groups[item.value.group]
- item.value.enabled | bool
with_dict: "{{ collectd_services }}"
- name: Ensuring Plugin directory exist - name: Ensuring Plugin directory exist
file: file:
@ -20,10 +17,7 @@
group: "{{ config_owner_group }}" group: "{{ config_owner_group }}"
mode: "0770" mode: "0770"
become: true become: true
when: with_dict: "{{ collectd_services | select_services_enabled_and_mapped_to_host }}"
- inventory_hostname in groups[item.value.group]
- item.value.enabled | bool
with_dict: "{{ collectd_services }}"
- name: Copying over config.json files for services - name: Copying over config.json files for services
template: template:
@ -31,10 +25,7 @@
dest: "{{ node_config_directory }}/{{ item.key }}/config.json" dest: "{{ node_config_directory }}/{{ item.key }}/config.json"
mode: "0660" mode: "0660"
become: true become: true
when: with_dict: "{{ collectd_services | select_services_enabled_and_mapped_to_host }}"
- inventory_hostname in groups[item.value.group]
- item.value.enabled | bool
with_dict: "{{ collectd_services }}"
notify: notify:
- Restart collectd container - Restart collectd container
@ -51,8 +42,6 @@
- "{{ node_custom_config }}/collectd/collectd.conf" - "{{ node_custom_config }}/collectd/collectd.conf"
- "{{ node_custom_config }}/collectd.conf" - "{{ node_custom_config }}/collectd.conf"
- "collectd.conf.j2" - "collectd.conf.j2"
when: when: service | service_enabled_and_mapped_to_host
- inventory_hostname in groups[service.group]
- service.enabled | bool
notify: notify:
- Restart collectd container - Restart collectd container

View File

@ -10,8 +10,6 @@
dimensions: "{{ item.value.dimensions }}" dimensions: "{{ item.value.dimensions }}"
privileged: "{{ item.value.privileged | default(False) }}" privileged: "{{ item.value.privileged | default(False) }}"
environment: "{{ item.value.environment }}" environment: "{{ item.value.environment }}"
when: with_dict: "{{ common_services | select_services_enabled_and_mapped_to_host }}"
- item.value | service_enabled_and_mapped_to_host
with_dict: "{{ common_services }}"
notify: notify:
- "Restart {{ item.key }} container" - "Restart {{ item.key }} container"

View File

@ -96,8 +96,7 @@
dest: "{{ node_config_directory }}/{{ item.key }}/config.json" dest: "{{ node_config_directory }}/{{ item.key }}/config.json"
mode: "0660" mode: "0660"
become: true become: true
when: item.value | service_enabled_and_mapped_to_host with_dict: "{{ common_services | select_services_enabled_and_mapped_to_host }}"
with_dict: "{{ common_services }}"
notify: notify:
- "Restart {{ item.key }} container" - "Restart {{ item.key }} container"
@ -289,9 +288,8 @@
mode: "0770" mode: "0770"
ignore_errors: "{{ ansible_check_mode }}" ignore_errors: "{{ ansible_check_mode }}"
when: when:
- item.value | service_enabled_and_mapped_to_host
- item.key != "kolla-toolbox" - item.key != "kolla-toolbox"
with_dict: "{{ common_services }}" with_dict: "{{ common_services | select_services_enabled_and_mapped_to_host }}"
- name: Copy rabbitmq-env.conf to kolla toolbox - name: Copy rabbitmq-env.conf to kolla toolbox
template: template:

View File

@ -10,9 +10,6 @@
volumes: "{{ item.value.volumes }}" volumes: "{{ item.value.volumes }}"
dimensions: "{{ item.value.dimensions }}" dimensions: "{{ item.value.dimensions }}"
healthcheck: "{{ item.value.healthcheck | default(omit) }}" healthcheck: "{{ item.value.healthcheck | default(omit) }}"
when: with_dict: "{{ cyborg_services | select_services_enabled_and_mapped_to_host }}"
- inventory_hostname in groups[item.value.group]
- item.value.enabled | bool
with_dict: "{{ cyborg_services }}"
notify: notify:
- Restart {{ item.key }} container - Restart {{ item.key }} container

View File

@ -7,10 +7,7 @@
group: "{{ config_owner_group }}" group: "{{ config_owner_group }}"
mode: "0770" mode: "0770"
become: true become: true
when: with_dict: "{{ cyborg_services | select_services_enabled_and_mapped_to_host }}"
- item.value.enabled | bool
- inventory_hostname in groups[item.value.group]
with_dict: "{{ cyborg_services }}"
- name: Check if policies shall be overwritten - name: Check if policies shall be overwritten
stat: stat:
@ -39,9 +36,7 @@
become: true become: true
when: when:
- cyborg_policy_file is defined - cyborg_policy_file is defined
- inventory_hostname in groups[item.value.group] with_dict: "{{ cyborg_services | select_services_enabled_and_mapped_to_host }}"
- item.value.enabled | bool
with_dict: "{{ cyborg_services }}"
notify: notify:
- Restart {{ item.key }} container - Restart {{ item.key }} container
@ -55,10 +50,7 @@
dest: "{{ node_config_directory }}/{{ item.key }}/config.json" dest: "{{ node_config_directory }}/{{ item.key }}/config.json"
mode: "0660" mode: "0660"
become: true become: true
when: with_dict: "{{ cyborg_services | select_services_enabled_and_mapped_to_host }}"
- item.value.enabled | bool
- inventory_hostname in groups[item.value.group]
with_dict: "{{ cyborg_services }}"
notify: notify:
- Restart {{ item.key }} container - Restart {{ item.key }} container
@ -75,10 +67,7 @@
dest: "{{ node_config_directory }}/{{ item.key }}/cyborg.conf" dest: "{{ node_config_directory }}/{{ item.key }}/cyborg.conf"
mode: "0660" mode: "0660"
become: true become: true
when: with_dict: "{{ cyborg_services | select_services_enabled_and_mapped_to_host }}"
- item.value.enabled | bool
- inventory_hostname in groups[item.value.group]
with_dict: "{{ cyborg_services }}"
notify: notify:
- Restart {{ item.key }} container - Restart {{ item.key }} container
@ -92,8 +81,6 @@
dest: "{{ node_config_directory }}/cyborg-api/api-paste.ini" dest: "{{ node_config_directory }}/cyborg-api/api-paste.ini"
mode: "0660" mode: "0660"
become: true become: true
when: when: service | service_enabled_and_mapped_to_host
- inventory_hostname in groups['cyborg-api']
- service.enabled | bool
notify: notify:
- Restart cyborg-api container - Restart cyborg-api container

View File

@ -8,9 +8,7 @@
when: when:
- designate_backend_external == 'bind9' - designate_backend_external == 'bind9'
- item.key in [ "designate-worker" ] - item.key in [ "designate-worker" ]
- inventory_hostname in groups[item.value.group] with_dict: "{{ designate_services | select_services_enabled_and_mapped_to_host }}"
- item.value.enabled | bool
with_dict: "{{ designate_services }}"
notify: notify:
- Restart {{ item.key }} container - Restart {{ item.key }} container
@ -23,8 +21,6 @@
when: when:
- designate_backend_external == 'bind9' - designate_backend_external == 'bind9'
- item.key in [ "designate-worker" ] - item.key in [ "designate-worker" ]
- inventory_hostname in groups[item.value.group] with_dict: "{{ designate_services | select_services_enabled_and_mapped_to_host }}"
- item.value.enabled | bool
with_dict: "{{ designate_services }}"
notify: notify:
- Restart {{ item.key }} container - Restart {{ item.key }} container

View File

@ -9,9 +9,6 @@
volumes: "{{ item.value.volumes | reject('equalto', '') | list }}" volumes: "{{ item.value.volumes | reject('equalto', '') | list }}"
dimensions: "{{ item.value.dimensions }}" dimensions: "{{ item.value.dimensions }}"
healthcheck: "{{ item.value.healthcheck | default(omit) }}" healthcheck: "{{ item.value.healthcheck | default(omit) }}"
when: with_dict: "{{ designate_services | select_services_enabled_and_mapped_to_host }}"
- inventory_hostname in groups[item.value.group]
- item.value.enabled | bool
with_dict: "{{ designate_services }}"
notify: notify:
- "Restart {{ item.key }} container" - "Restart {{ item.key }} container"

View File

@ -7,10 +7,7 @@
group: "{{ config_owner_group }}" group: "{{ config_owner_group }}"
mode: "0770" mode: "0770"
become: true become: true
when: with_dict: "{{ designate_services | select_services_enabled_and_mapped_to_host }}"
- inventory_hostname in groups[item.value.group]
- item.value.enabled | bool
with_dict: "{{ designate_services }}"
- name: Check if policies shall be overwritten - name: Check if policies shall be overwritten
stat: stat:
@ -41,10 +38,7 @@
dest: "{{ node_config_directory }}/{{ item.key }}/config.json" dest: "{{ node_config_directory }}/{{ item.key }}/config.json"
mode: "0660" mode: "0660"
become: true become: true
when: with_dict: "{{ designate_services | select_services_enabled_and_mapped_to_host }}"
- inventory_hostname in groups[item.value.group]
- item.value.enabled | bool
with_dict: "{{ designate_services }}"
notify: notify:
- Restart {{ item.key }} container - Restart {{ item.key }} container
@ -61,10 +55,7 @@
dest: "{{ node_config_directory }}/{{ item.key }}/designate.conf" dest: "{{ node_config_directory }}/{{ item.key }}/designate.conf"
mode: "0660" mode: "0660"
become: true become: true
when: with_dict: "{{ designate_services | select_services_enabled_and_mapped_to_host }}"
- inventory_hostname in groups[item.value.group]
- item.value.enabled | bool
with_dict: "{{ designate_services }}"
notify: notify:
- Restart {{ item.key }} container - Restart {{ item.key }} container
@ -76,9 +67,7 @@
dest: "{{ node_config_directory }}/designate-worker/pools.yaml" dest: "{{ node_config_directory }}/designate-worker/pools.yaml"
mode: "0660" mode: "0660"
become: true become: true
when: when: service | service_enabled_and_mapped_to_host
- inventory_hostname in groups[service.group]
- service.enabled | bool
with_first_found: with_first_found:
- "{{ node_custom_config }}/designate/pools.yaml" - "{{ node_custom_config }}/designate/pools.yaml"
- "{{ role_path }}/templates/pools.yaml.j2" - "{{ role_path }}/templates/pools.yaml.j2"
@ -95,8 +84,7 @@
become: true become: true
when: when:
- designate_backend == 'bind9' - designate_backend == 'bind9'
- inventory_hostname in groups[service.group] - service | service_enabled_and_mapped_to_host
- service.enabled | bool
with_first_found: with_first_found:
- "{{ node_custom_config }}/designate/designate-backend-bind9/{{ inventory_hostname }}/named.conf" - "{{ node_custom_config }}/designate/designate-backend-bind9/{{ inventory_hostname }}/named.conf"
- "{{ node_custom_config }}/designate/designate-backend-bind9/named.conf" - "{{ node_custom_config }}/designate/designate-backend-bind9/named.conf"
@ -114,9 +102,7 @@
when: when:
- designate_backend == 'bind9' and designate_backend_external == 'no' - designate_backend == 'bind9' and designate_backend_external == 'no'
- item.key in [ "designate-backend-bind9", "designate-worker" ] - item.key in [ "designate-backend-bind9", "designate-worker" ]
- inventory_hostname in groups[item.value.group] with_dict: "{{ designate_services | select_services_enabled_and_mapped_to_host }}"
- item.value.enabled | bool
with_dict: "{{ designate_services }}"
notify: notify:
- Restart {{ item.key }} container - Restart {{ item.key }} container
@ -129,9 +115,7 @@
when: when:
- designate_backend == 'bind9' and designate_backend_external == 'no' - designate_backend == 'bind9' and designate_backend_external == 'no'
- item.key in [ "designate-backend-bind9", "designate-worker" ] - item.key in [ "designate-backend-bind9", "designate-worker" ]
- inventory_hostname in groups[item.value.group] with_dict: "{{ designate_services | select_services_enabled_and_mapped_to_host }}"
- item.value.enabled | bool
with_dict: "{{ designate_services }}"
notify: notify:
- Restart {{ item.key }} container - Restart {{ item.key }} container
@ -146,8 +130,6 @@
become: true become: true
when: when:
- designate_policy_file is defined - designate_policy_file is defined
- inventory_hostname in groups[item.value.group] with_dict: "{{ designate_services | select_services_enabled_and_mapped_to_host }}"
- item.value.enabled | bool
with_dict: "{{ designate_services }}"
notify: notify:
- Restart {{ item.key }} container - Restart {{ item.key }} container

View File

@ -9,9 +9,6 @@
volumes: "{{ item.value.volumes }}" volumes: "{{ item.value.volumes }}"
dimensions: "{{ item.value.dimensions }}" dimensions: "{{ item.value.dimensions }}"
environment: "{{ item.value.environment }}" environment: "{{ item.value.environment }}"
when: with_dict: "{{ etcd_services | select_services_enabled_and_mapped_to_host }}"
- item.value.enabled | bool
- inventory_hostname in groups[item.value.group]
with_dict: "{{ etcd_services }}"
notify: notify:
- "Restart {{ item.key }} container" - "Restart {{ item.key }} container"

View File

@ -7,10 +7,7 @@
group: "{{ config_owner_group }}" group: "{{ config_owner_group }}"
mode: "0770" mode: "0770"
become: true become: true
when: with_dict: "{{ etcd_services | select_services_enabled_and_mapped_to_host }}"
- item.value.enabled | bool
- inventory_hostname in groups[item.value.group]
with_dict: "{{ etcd_services }}"
- name: Copying over config.json files for services - name: Copying over config.json files for services
template: template:
@ -18,10 +15,7 @@
dest: "{{ node_config_directory }}/{{ item.key }}/config.json" dest: "{{ node_config_directory }}/{{ item.key }}/config.json"
mode: "0660" mode: "0660"
become: true become: true
when: with_dict: "{{ etcd_services | select_services_enabled_and_mapped_to_host }}"
- item.value.enabled | bool
- inventory_hostname in groups[item.value.group]
with_dict: "{{ etcd_services }}"
notify: notify:
- Restart {{ item.key }} container - Restart {{ item.key }} container

View File

@ -11,9 +11,6 @@
volumes: "{{ item.value.volumes | reject('equalto', '') | list }}" volumes: "{{ item.value.volumes | reject('equalto', '') | list }}"
dimensions: "{{ item.value.dimensions }}" dimensions: "{{ item.value.dimensions }}"
healthcheck: "{{ item.value.healthcheck | default(omit) }}" healthcheck: "{{ item.value.healthcheck | default(omit) }}"
when: with_dict: "{{ glance_services | select_services_enabled_and_mapped_to_host }}"
- item.value.host_in_groups | bool
- item.value.enabled | bool
with_dict: "{{ glance_services }}"
notify: notify:
- "Restart {{ item.key }} container" - "Restart {{ item.key }} container"

View File

@ -7,10 +7,7 @@
group: "{{ config_owner_group }}" group: "{{ config_owner_group }}"
mode: "0770" mode: "0770"
become: true become: true
when: with_dict: "{{ glance_services | select_services_enabled_and_mapped_to_host }}"
- item.value.host_in_groups | bool
- item.value.enabled | bool
with_dict: "{{ glance_services }}"
- include_tasks: external_ceph.yml - include_tasks: external_ceph.yml
when: when:
@ -41,7 +38,7 @@
- name: Creating TLS backend PEM File - name: Creating TLS backend PEM File
vars: vars:
glance_tls_proxy: "{{ glance_services['glance-tls-proxy'] }}" service: "{{ glance_services['glance-tls-proxy'] }}"
assemble: assemble:
src: "{{ node_config_directory }}/glance-tls-proxy/" src: "{{ node_config_directory }}/glance-tls-proxy/"
dest: "{{ node_config_directory }}/glance-tls-proxy/glance-cert-and-key.pem" dest: "{{ node_config_directory }}/glance-tls-proxy/glance-cert-and-key.pem"
@ -49,9 +46,7 @@
regexp: "^glance-(cert|key)\\.pem$" regexp: "^glance-(cert|key)\\.pem$"
remote_src: true remote_src: true
become: true become: true
when: when: service | service_enabled_and_mapped_to_host
- glance_tls_proxy.enabled | bool
- glance_tls_proxy.host_in_groups | bool
- name: Copying over config.json files for services - name: Copying over config.json files for services
template: template:
@ -59,16 +54,13 @@
dest: "{{ node_config_directory }}/{{ item.key }}/config.json" dest: "{{ node_config_directory }}/{{ item.key }}/config.json"
mode: "0660" mode: "0660"
become: true become: true
when: with_dict: "{{ glance_services | select_services_enabled_and_mapped_to_host }}"
- item.value.enabled | bool
- item.value.host_in_groups | bool
with_dict: "{{ glance_services }}"
notify: notify:
- Restart {{ item.key }} container - Restart {{ item.key }} container
- name: Copying over glance-api.conf - name: Copying over glance-api.conf
vars: vars:
glance_api: "{{ glance_services['glance-api'] }}" service: "{{ glance_services['glance-api'] }}"
merge_configs: merge_configs:
sources: sources:
- "{{ role_path }}/templates/glance-api.conf.j2" - "{{ role_path }}/templates/glance-api.conf.j2"
@ -79,15 +71,13 @@
dest: "{{ node_config_directory }}/glance-api/glance-api.conf" dest: "{{ node_config_directory }}/glance-api/glance-api.conf"
mode: "0660" mode: "0660"
become: true become: true
when: when: service | service_enabled_and_mapped_to_host
- glance_api.enabled | bool
- glance_api.host_in_groups | bool
notify: notify:
- Restart glance-api container - Restart glance-api container
- name: Copying over glance-cache.conf for glance_api - name: Copying over glance-cache.conf for glance_api
vars: vars:
glance_api: "{{ glance_services['glance-api'] }}" service: "{{ glance_services['glance-api'] }}"
merge_configs: merge_configs:
sources: sources:
- "{{ role_path }}/templates/glance-cache.conf.j2" - "{{ role_path }}/templates/glance-cache.conf.j2"
@ -98,15 +88,14 @@
mode: "0660" mode: "0660"
become: true become: true
when: when:
- glance_api.enabled | bool - service | service_enabled_and_mapped_to_host
- glance_api.host_in_groups | bool
- enable_glance_image_cache | bool - enable_glance_image_cache | bool
notify: notify:
- Restart glance-api container - Restart glance-api container
- name: Copying over glance-swift.conf for glance_api - name: Copying over glance-swift.conf for glance_api
vars: vars:
glance_api: "{{ glance_services['glance-api'] }}" service: "{{ glance_services['glance-api'] }}"
merge_configs: merge_configs:
sources: sources:
- "{{ role_path }}/templates/glance-swift.conf.j2" - "{{ role_path }}/templates/glance-swift.conf.j2"
@ -117,45 +106,42 @@
mode: "0660" mode: "0660"
become: true become: true
when: when:
- glance_api.enabled | bool - service | service_enabled_and_mapped_to_host
- glance_api.host_in_groups | bool
- glance_backend_swift | bool - glance_backend_swift | bool
notify: notify:
- Restart glance-api container - Restart glance-api container
- name: Copying over glance-image-import.conf - name: Copying over glance-image-import.conf
vars: vars:
glance_api: "{{ glance_services['glance-api'] }}" service: "{{ glance_services['glance-api'] }}"
copy: copy:
src: "{{ node_custom_config }}/glance/glance-image-import.conf" src: "{{ node_custom_config }}/glance/glance-image-import.conf"
dest: "{{ node_config_directory }}/glance-api/glance-image-import.conf" dest: "{{ node_config_directory }}/glance-api/glance-image-import.conf"
mode: "0660" mode: "0660"
become: true become: true
when: when:
- glance_api.enabled | bool - service | service_enabled_and_mapped_to_host
- inventory_hostname in groups[glance_api.group]
- glance_enable_interoperable_image_import | bool - glance_enable_interoperable_image_import | bool
notify: notify:
- Restart glance-api container - Restart glance-api container
- name: Copying over property-protections-rules.conf - name: Copying over property-protections-rules.conf
vars: vars:
glance_api: "{{ glance_services['glance-api'] }}" service: "{{ glance_services['glance-api'] }}"
copy: copy:
src: "{{ node_custom_config }}/glance/property-protections-rules.conf" src: "{{ node_custom_config }}/glance/property-protections-rules.conf"
dest: "{{ node_config_directory }}/glance-api/property-protections-rules.conf" dest: "{{ node_config_directory }}/glance-api/property-protections-rules.conf"
mode: "0660" mode: "0660"
become: true become: true
when: when:
- glance_api.enabled | bool - service | service_enabled_and_mapped_to_host
- inventory_hostname in groups[glance_api.group]
- glance_enable_property_protection | bool - glance_enable_property_protection | bool
notify: notify:
- Restart glance-api container - Restart glance-api container
- name: Copying over existing policy file - name: Copying over existing policy file
vars: vars:
glance_api: "{{ glance_services['glance-api'] }}" service: "{{ glance_services['glance-api'] }}"
template: template:
src: "{{ glance_policy_file_path }}" src: "{{ glance_policy_file_path }}"
dest: "{{ node_config_directory }}/glance-api/{{ glance_policy_file }}" dest: "{{ node_config_directory }}/glance-api/{{ glance_policy_file }}"
@ -163,14 +149,13 @@
become: true become: true
when: when:
- glance_policy_file is defined - glance_policy_file is defined
- glance_api.host_in_groups | bool - service | service_enabled_and_mapped_to_host
- glance_api.enabled | bool
notify: notify:
- Restart glance-api container - Restart glance-api container
- name: Copying over glance-haproxy-tls.cfg - name: Copying over glance-haproxy-tls.cfg
vars: vars:
glance_tls_proxy: "{{ glance_services['glance-tls-proxy'] }}" service: "{{ glance_services['glance-tls-proxy'] }}"
template: template:
src: "{{ item }}" src: "{{ item }}"
dest: "{{ node_config_directory }}/glance-tls-proxy/glance-tls-proxy.cfg" dest: "{{ node_config_directory }}/glance-tls-proxy/glance-tls-proxy.cfg"
@ -180,8 +165,6 @@
- "{{ node_custom_config }}/glance/{{ inventory_hostname }}/glance-tls-proxy.cfg" - "{{ node_custom_config }}/glance/{{ inventory_hostname }}/glance-tls-proxy.cfg"
- "{{ node_custom_config }}/glance/glance-tls-proxy.cfg" - "{{ node_custom_config }}/glance/glance-tls-proxy.cfg"
- "glance-tls-proxy.cfg.j2" - "glance-tls-proxy.cfg.j2"
when: when: service | service_enabled_and_mapped_to_host
- glance_tls_proxy.enabled | bool
- glance_tls_proxy.host_in_groups | bool
notify: notify:
- Restart glance-tls-proxy container - Restart glance-tls-proxy container

View File

@ -9,9 +9,7 @@
group: "{{ config_owner_group }}" group: "{{ config_owner_group }}"
mode: "0770" mode: "0770"
become: true become: true
when: when: service | service_enabled_and_mapped_to_host
- inventory_hostname in groups[service.group]
- service.enabled | bool
- name: Copy over multiple ceph configs for Glance - name: Copy over multiple ceph configs for Glance
merge_configs: merge_configs:

View File

@ -14,6 +14,8 @@
register: container_facts register: container_facts
- name: Checking free port for Glance API - name: Checking free port for Glance API
vars:
service: "{{ glance_services['glance-api'] }}"
wait_for: wait_for:
host: "{{ api_interface_address }}" host: "{{ api_interface_address }}"
port: "{{ glance_api_listen_port }}" port: "{{ glance_api_listen_port }}"
@ -21,8 +23,7 @@
timeout: 1 timeout: 1
state: stopped state: stopped
when: when:
- glance_services['glance-api'].host_in_groups | bool - service | service_enabled_and_mapped_to_host
- glance_services['glance-api'].enabled | bool
- container_facts['glance_api'] is not defined - container_facts['glance_api'] is not defined
- name: Check if S3 configurations are defined - name: Check if S3 configurations are defined

View File

@ -1,12 +1,10 @@
--- ---
- name: Stop glance service - name: Stop glance service
vars: vars:
glance_api: "{{ glance_services['glance-api'] }}" service: "{{ glance_services['glance-api'] }}"
become: true become: true
kolla_container: kolla_container:
action: "stop_container" action: "stop_container"
common_options: "{{ docker_common_options }}" common_options: "{{ docker_common_options }}"
name: "{{ glance_api.container_name }}" name: "{{ service.container_name }}"
when: when: service | service_enabled_and_mapped_to_host
- glance_api.host_in_groups | bool
- glance_api.enabled | bool

View File

@ -9,9 +9,6 @@
volumes: "{{ item.value.volumes }}" volumes: "{{ item.value.volumes }}"
dimensions: "{{ item.value.dimensions }}" dimensions: "{{ item.value.dimensions }}"
healthcheck: "{{ item.value.healthcheck | default(omit) }}" healthcheck: "{{ item.value.healthcheck | default(omit) }}"
when: with_dict: "{{ gnocchi_services | select_services_enabled_and_mapped_to_host }}"
- inventory_hostname in groups[item.value.group]
- item.value.enabled | bool
with_dict: "{{ gnocchi_services }}"
notify: notify:
- "Restart {{ item.key }} container" - "Restart {{ item.key }} container"

View File

@ -7,10 +7,7 @@
group: "{{ config_owner_group }}" group: "{{ config_owner_group }}"
mode: "0770" mode: "0770"
become: true become: true
when: with_dict: "{{ gnocchi_services | select_services_enabled_and_mapped_to_host }}"
- inventory_hostname in groups[item.value.group]
- item.value.enabled | bool
with_dict: "{{ gnocchi_services }}"
- include_tasks: external_ceph.yml - include_tasks: external_ceph.yml
when: when:
@ -45,10 +42,7 @@
dest: "{{ node_config_directory }}/{{ item.key }}/config.json" dest: "{{ node_config_directory }}/{{ item.key }}/config.json"
mode: "0660" mode: "0660"
become: true become: true
when: with_dict: "{{ gnocchi_services | select_services_enabled_and_mapped_to_host }}"
- item.value.enabled | bool
- inventory_hostname in groups[item.value.group]
with_dict: "{{ gnocchi_services }}"
notify: notify:
- Restart {{ item.key }} container - Restart {{ item.key }} container
@ -65,10 +59,7 @@
dest: "{{ node_config_directory }}/{{ item.key }}/gnocchi.conf" dest: "{{ node_config_directory }}/{{ item.key }}/gnocchi.conf"
mode: "0660" mode: "0660"
become: true become: true
when: with_dict: "{{ gnocchi_services | select_services_enabled_and_mapped_to_host }}"
- item.value.enabled | bool
- inventory_hostname in groups[item.value.group]
with_dict: "{{ gnocchi_services }}"
notify: notify:
- Restart {{ item.key }} container - Restart {{ item.key }} container
@ -80,9 +71,7 @@
dest: "{{ node_config_directory }}/{{ item }}/wsgi-gnocchi.conf" dest: "{{ node_config_directory }}/{{ item }}/wsgi-gnocchi.conf"
mode: "0660" mode: "0660"
become: true become: true
when: when: service | service_enabled_and_mapped_to_host
- inventory_hostname in groups['gnocchi-api']
- service.enabled | bool
with_items: with_items:
- "gnocchi-api" - "gnocchi-api"
notify: notify:
@ -96,8 +85,6 @@
become: true become: true
when: when:
- gnocchi_policy_file is defined - gnocchi_policy_file is defined
- inventory_hostname in groups[item.value.group] with_dict: "{{ gnocchi_services | select_services_enabled_and_mapped_to_host }}"
- item.value.enabled | bool
with_dict: "{{ gnocchi_services }}"
notify: notify:
- Restart {{ item.key }} container - Restart {{ item.key }} container

View File

@ -7,10 +7,7 @@
group: "{{ config_owner_group }}" group: "{{ config_owner_group }}"
mode: "0770" mode: "0770"
become: true become: true
with_dict: "{{ gnocchi_services }}" with_dict: "{{ gnocchi_services | select_services_enabled_and_mapped_to_host }}"
when:
- inventory_hostname in groups[item.value.group]
- item.value.enabled | bool
- name: Copy over ceph config for Gnocchi - name: Copy over ceph config for Gnocchi
merge_configs: merge_configs:
@ -20,10 +17,7 @@
dest: "{{ node_config_directory }}/{{ item.key }}/ceph/{{ gnocchi_ceph_cluster }}.conf" dest: "{{ node_config_directory }}/{{ item.key }}/ceph/{{ gnocchi_ceph_cluster }}.conf"
mode: "0660" mode: "0660"
become: true become: true
when: with_dict: "{{ gnocchi_services | select_services_enabled_and_mapped_to_host }}"
- inventory_hostname in groups[item.value.group]
- item.value.enabled | bool
with_dict: "{{ gnocchi_services }}"
notify: notify:
- Restart {{ item.key }} container - Restart {{ item.key }} container
@ -33,10 +27,7 @@
dest: "{{ node_config_directory }}/{{ item.key }}/ceph/{{ gnocchi_ceph_cluster }}.{{ ceph_gnocchi_keyring }}" dest: "{{ node_config_directory }}/{{ item.key }}/ceph/{{ gnocchi_ceph_cluster }}.{{ ceph_gnocchi_keyring }}"
mode: "0660" mode: "0660"
become: true become: true
with_dict: "{{ gnocchi_services }}" with_dict: "{{ gnocchi_services | select_services_enabled_and_mapped_to_host }}"
when:
- inventory_hostname in groups[item.value.group]
- item.value.enabled | bool
notify: notify:
- Restart {{ item.key }} container - Restart {{ item.key }} container
@ -47,7 +38,4 @@
recurse: yes recurse: yes
owner: "{{ config_owner_user }}" owner: "{{ config_owner_user }}"
group: "{{ config_owner_group }}" group: "{{ config_owner_group }}"
when: with_dict: "{{ gnocchi_services | select_services_enabled_and_mapped_to_host }}"
- inventory_hostname in groups[item.value.group]
- item.value.enabled | bool
with_dict: "{{ gnocchi_services }}"

View File

@ -8,9 +8,6 @@
image: "{{ item.value.image }}" image: "{{ item.value.image }}"
volumes: "{{ item.value.volumes }}" volumes: "{{ item.value.volumes }}"
dimensions: "{{ item.value.dimensions }}" dimensions: "{{ item.value.dimensions }}"
when: with_dict: "{{ grafana_services | select_services_enabled_and_mapped_to_host }}"
- inventory_hostname in groups[item.value.group]
- item.value.enabled | bool
with_dict: "{{ grafana_services }}"
notify: notify:
- "Restart {{ item.key }} container" - "Restart {{ item.key }} container"

View File

@ -7,10 +7,7 @@
group: "{{ config_owner_group }}" group: "{{ config_owner_group }}"
mode: "0770" mode: "0770"
become: true become: true
when: with_dict: "{{ grafana_services | select_services_enabled_and_mapped_to_host }}"
- inventory_hostname in groups[item.value.group]
- item.value.enabled | bool
with_dict: "{{ grafana_services }}"
- name: Check if extra configuration file exists - name: Check if extra configuration file exists
find: find:
@ -30,10 +27,7 @@
dest: "{{ node_config_directory }}/{{ item.key }}/config.json" dest: "{{ node_config_directory }}/{{ item.key }}/config.json"
mode: "0660" mode: "0660"
become: true become: true
when: with_dict: "{{ grafana_services | select_services_enabled_and_mapped_to_host }}"
- inventory_hostname in groups[item.value.group]
- item.value.enabled | bool
with_dict: "{{ grafana_services }}"
notify: notify:
- Restart {{ item.key }} container - Restart {{ item.key }} container
@ -48,10 +42,7 @@
dest: "{{ node_config_directory }}/grafana/grafana.ini" dest: "{{ node_config_directory }}/grafana/grafana.ini"
mode: "0660" mode: "0660"
become: true become: true
when: with_dict: "{{ grafana_services | select_services_enabled_and_mapped_to_host }}"
- inventory_hostname in groups[item.value.group]
- item.value.enabled | bool
with_dict: "{{ grafana_services }}"
notify: notify:
- Restart {{ item.key }} container - Restart {{ item.key }} container
@ -94,8 +85,7 @@
mode: "0660" mode: "0660"
become: true become: true
when: when:
- inventory_hostname in groups[service.group] - service | service_enabled_and_mapped_to_host
- service.enabled | bool
- enable_prometheus | bool - enable_prometheus | bool
with_first_found: with_first_found:
- "{{ node_custom_config }}/grafana/{{ inventory_hostname }}/prometheus.yaml" - "{{ node_custom_config }}/grafana/{{ inventory_hostname }}/prometheus.yaml"
@ -112,9 +102,7 @@
dest: "{{ node_config_directory }}/grafana/provisioning.yaml" dest: "{{ node_config_directory }}/grafana/provisioning.yaml"
mode: "0660" mode: "0660"
become: true become: true
when: when: service | service_enabled_and_mapped_to_host
- inventory_hostname in groups[service.group]
- service.enabled | bool
with_first_found: with_first_found:
- "{{ node_custom_config }}/grafana/{{ inventory_hostname }}/provisioning.yaml" - "{{ node_custom_config }}/grafana/{{ inventory_hostname }}/provisioning.yaml"
- "{{ node_custom_config }}/grafana/provisioning.yaml" - "{{ node_custom_config }}/grafana/provisioning.yaml"
@ -136,9 +124,7 @@
file: file:
state: absent state: absent
path: "{{ node_config_directory }}/grafana/dashboards/" path: "{{ node_config_directory }}/grafana/dashboards/"
when: when: service | service_enabled_and_mapped_to_host
- inventory_hostname in groups[service.group]
- service.enabled | bool
- name: Copying over custom dashboards - name: Copying over custom dashboards
vars: vars:
@ -151,7 +137,6 @@
when: when:
- grafana_custom_dashboards_folder.stat.exists - grafana_custom_dashboards_folder.stat.exists
- grafana_custom_dashboards_folder.stat.isdir - grafana_custom_dashboards_folder.stat.isdir
- inventory_hostname in groups[service.group] - service | service_enabled_and_mapped_to_host
- service.enabled | bool
notify: notify:
- Restart grafana container - Restart grafana container

View File

@ -10,7 +10,7 @@
- name: Ensure remote node is added - name: Ensure remote node is added
vars: vars:
pacemaker_service: "{{ hacluster_services['hacluster-pacemaker'] }}" pacemaker_service: "{{ hacluster_services['hacluster-pacemaker'] }}"
pacemaker_remote_service: "{{ hacluster_services['hacluster-pacemaker-remote'] }}" service: "{{ hacluster_services['hacluster-pacemaker-remote'] }}"
shell: > shell: >
{{ kolla_container_engine }} exec {{ pacemaker_service.container_name }} {{ kolla_container_engine }} exec {{ pacemaker_service.container_name }}
cibadmin --modify --scope resources -X ' cibadmin --modify --scope resources -X '
@ -27,6 +27,4 @@
' '
become: true become: true
delegate_to: "{{ groups[pacemaker_service.group][0] }}" delegate_to: "{{ groups[pacemaker_service.group][0] }}"
when: when: service | service_enabled_and_mapped_to_host
- inventory_hostname in groups[pacemaker_remote_service.group]
- pacemaker_remote_service.enabled | bool

View File

@ -7,10 +7,7 @@
owner: "{{ config_owner_user }}" owner: "{{ config_owner_user }}"
group: "{{ config_owner_group }}" group: "{{ config_owner_group }}"
mode: "0770" mode: "0770"
when: with_dict: "{{ hacluster_services | select_services_enabled_and_mapped_to_host }}"
- inventory_hostname in groups[item.value.group]
- item.value.enabled | bool
with_dict: "{{ hacluster_services }}"
- name: Copying over config.json files for services - name: Copying over config.json files for services
become: true become: true
@ -19,10 +16,7 @@
dest: "{{ node_config_directory }}/{{ item.key }}/config.json" dest: "{{ node_config_directory }}/{{ item.key }}/config.json"
mode: "0660" mode: "0660"
register: config_jsons register: config_jsons
when: with_dict: "{{ hacluster_services | select_services_enabled_and_mapped_to_host }}"
- inventory_hostname in groups[item.value.group]
- item.value.enabled | bool
with_dict: "{{ hacluster_services }}"
notify: notify:
- "Restart {{ item.key }} container" - "Restart {{ item.key }} container"
@ -34,9 +28,7 @@
dest: "{{ node_config_directory }}/hacluster-corosync/corosync.conf" dest: "{{ node_config_directory }}/hacluster-corosync/corosync.conf"
mode: "0660" mode: "0660"
become: true become: true
when: when: service | service_enabled_and_mapped_to_host
- inventory_hostname in groups[service.group]
- service.enabled | bool
with_first_found: with_first_found:
- "{{ node_custom_config }}/hacluster-corosync/{{ inventory_hostname }}/corosync.conf" - "{{ node_custom_config }}/hacluster-corosync/{{ inventory_hostname }}/corosync.conf"
- "{{ node_custom_config }}/hacluster-corosync/corosync.conf" - "{{ node_custom_config }}/hacluster-corosync/corosync.conf"
@ -52,9 +44,7 @@
dest: "{{ node_config_directory }}/hacluster-corosync/authkey" dest: "{{ node_config_directory }}/hacluster-corosync/authkey"
mode: "0600" mode: "0600"
become: true become: true
when: when: service | service_enabled_and_mapped_to_host
- inventory_hostname in groups[service.group]
- service.enabled | bool
with_first_found: with_first_found:
- "{{ node_custom_config }}/hacluster-corosync/{{ inventory_hostname }}/authkey" - "{{ node_custom_config }}/hacluster-corosync/{{ inventory_hostname }}/authkey"
- "{{ node_custom_config }}/hacluster-corosync/authkey" - "{{ node_custom_config }}/hacluster-corosync/authkey"
@ -69,9 +59,7 @@
dest: "{{ node_config_directory }}//hacluster-pacemaker/authkey" dest: "{{ node_config_directory }}//hacluster-pacemaker/authkey"
mode: "0600" mode: "0600"
become: true become: true
when: when: service | service_enabled_and_mapped_to_host
- inventory_hostname in groups[service.group]
- service.enabled | bool
with_first_found: with_first_found:
- "{{ node_custom_config }}/hacluster-pacemaker/{{ inventory_hostname }}/authkey" - "{{ node_custom_config }}/hacluster-pacemaker/{{ inventory_hostname }}/authkey"
- "{{ node_custom_config }}/hacluster-pacemaker/authkey" - "{{ node_custom_config }}/hacluster-pacemaker/authkey"
@ -86,9 +74,7 @@
dest: "{{ node_config_directory }}/hacluster-pacemaker-remote/authkey" dest: "{{ node_config_directory }}/hacluster-pacemaker-remote/authkey"
mode: "0600" mode: "0600"
become: true become: true
when: when: service | service_enabled_and_mapped_to_host
- inventory_hostname in groups[service.group]
- service.enabled | bool
with_first_found: with_first_found:
- "{{ node_custom_config }}/hacluster-pacemaker/{{ inventory_hostname }}/authkey" - "{{ node_custom_config }}/hacluster-pacemaker/{{ inventory_hostname }}/authkey"
- "{{ node_custom_config }}/hacluster-pacemaker/authkey" - "{{ node_custom_config }}/hacluster-pacemaker/authkey"

View File

@ -9,9 +9,6 @@
volumes: "{{ item.value.volumes | reject('equalto', '') | list }}" volumes: "{{ item.value.volumes | reject('equalto', '') | list }}"
dimensions: "{{ item.value.dimensions }}" dimensions: "{{ item.value.dimensions }}"
healthcheck: "{{ item.value.healthcheck | default(omit) }}" healthcheck: "{{ item.value.healthcheck | default(omit) }}"
when: with_dict: "{{ heat_services | select_services_enabled_and_mapped_to_host }}"
- inventory_hostname in groups[item.value.group]
- item.value.enabled | bool
with_dict: "{{ heat_services }}"
notify: notify:
- "Restart {{ item.key }} container" - "Restart {{ item.key }} container"

View File

@ -7,10 +7,7 @@
owner: "{{ config_owner_user }}" owner: "{{ config_owner_user }}"
group: "{{ config_owner_group }}" group: "{{ config_owner_group }}"
mode: "0770" mode: "0770"
when: with_dict: "{{ heat_services | select_services_enabled_and_mapped_to_host }}"
- inventory_hostname in groups[item.value.group]
- item.value.enabled | bool
with_dict: "{{ heat_services }}"
- name: Check if policies shall be overwritten - name: Check if policies shall be overwritten
stat: stat:
@ -41,10 +38,7 @@
src: "{{ item.key }}.json.j2" src: "{{ item.key }}.json.j2"
dest: "{{ node_config_directory }}/{{ item.key }}/config.json" dest: "{{ node_config_directory }}/{{ item.key }}/config.json"
mode: "0660" mode: "0660"
when: with_dict: "{{ heat_services | select_services_enabled_and_mapped_to_host }}"
- item.value.enabled | bool
- inventory_hostname in groups[item.value.group]
with_dict: "{{ heat_services }}"
notify: notify:
- Restart {{ item.key }} container - Restart {{ item.key }} container
@ -61,10 +55,7 @@
- "{{ node_custom_config }}/heat/{{ inventory_hostname }}/heat.conf" - "{{ node_custom_config }}/heat/{{ inventory_hostname }}/heat.conf"
dest: "{{ node_config_directory }}/{{ item.key }}/heat.conf" dest: "{{ node_config_directory }}/{{ item.key }}/heat.conf"
mode: "0660" mode: "0660"
when: with_dict: "{{ heat_services | select_services_enabled_and_mapped_to_host }}"
- item.value.enabled | bool
- inventory_hostname in groups[item.value.group]
with_dict: "{{ heat_services }}"
notify: notify:
- Restart {{ item.key }} container - Restart {{ item.key }} container
@ -76,9 +67,7 @@
mode: "0660" mode: "0660"
when: when:
- heat_policy_file is defined - heat_policy_file is defined
- item.value.enabled | bool with_dict: "{{ heat_services | select_services_enabled_and_mapped_to_host }}"
- inventory_hostname in groups[item.value.group]
with_dict: "{{ heat_services }}"
notify: notify:
- Restart {{ item.key }} container - Restart {{ item.key }} container
@ -90,9 +79,7 @@
dest: "{{ node_config_directory }}/heat-api/wsgi-heat-api.conf" dest: "{{ node_config_directory }}/heat-api/wsgi-heat-api.conf"
mode: "0660" mode: "0660"
become: true become: true
when: when: service | service_enabled_and_mapped_to_host
- inventory_hostname in groups[service['group']]
- service.enabled | bool
notify: notify:
- Restart heat-api container - Restart heat-api container
@ -104,8 +91,6 @@
dest: "{{ node_config_directory }}/heat-api-cfn/wsgi-heat-api-cfn.conf" dest: "{{ node_config_directory }}/heat-api-cfn/wsgi-heat-api-cfn.conf"
mode: "0660" mode: "0660"
become: true become: true
when: when: service | service_enabled_and_mapped_to_host
- inventory_hostname in groups[service['group']]
- service.enabled | bool
notify: notify:
- Restart heat-api-cfn container - Restart heat-api-cfn container

View File

@ -1,20 +1,15 @@
--- ---
- name: Deploy horizon container - name: Deploy horizon container
vars:
horizon: "{{ horizon_services['horizon'] }}"
become: true become: true
kolla_container: kolla_container:
action: "compare_container" action: "compare_container"
common_options: "{{ docker_common_options }}" common_options: "{{ docker_common_options }}"
name: "{{ horizon.container_name }}" name: "{{ item.value.container_name }}"
image: "{{ horizon.image }}" image: "{{ item.value.image }}"
environment: "{{ horizon.environment }}" environment: "{{ item.value.environment }}"
volumes: "{{ horizon.volumes }}" volumes: "{{ item.value.volumes }}"
dimensions: "{{ horizon.dimensions }}" dimensions: "{{ item.value.dimensions }}"
healthcheck: "{{ horizon.healthcheck | default(omit) }}" healthcheck: "{{ item.value.healthcheck | default(omit) }}"
when: with_dict: "{{ horizon_services | select_services_enabled_and_mapped_to_host }}"
- inventory_hostname in groups[horizon.group]
- horizon.enabled | bool
with_dict: "{{ horizon_services }}"
notify: notify:
- "Restart {{ item.key }} container" - "Restart {{ item.key }} container"

View File

@ -7,10 +7,7 @@
owner: "{{ config_owner_user }}" owner: "{{ config_owner_user }}"
group: "{{ config_owner_group }}" group: "{{ config_owner_group }}"
mode: "0770" mode: "0770"
when: with_dict: "{{ horizon_services | select_services_enabled_and_mapped_to_host }}"
- inventory_hostname in groups[item.value.group]
- item.value.enabled | bool
with_dict: "{{ horizon_services }}"
- name: Set empty custom policy - name: Set empty custom policy
set_fact: set_fact:
@ -43,21 +40,19 @@
- name: Copying over config.json files for services - name: Copying over config.json files for services
become: true become: true
vars: vars:
horizon: "{{ horizon_services['horizon'] }}" service: "{{ horizon_services['horizon'] }}"
template: template:
src: "horizon.json.j2" src: "horizon.json.j2"
dest: "{{ node_config_directory }}/horizon/config.json" dest: "{{ node_config_directory }}/horizon/config.json"
mode: "0660" mode: "0660"
when: when: service | service_enabled_and_mapped_to_host
- horizon.enabled | bool
- inventory_hostname in groups[horizon.group]
notify: notify:
- Restart horizon container - Restart horizon container
- name: Copying over horizon.conf - name: Copying over horizon.conf
become: true become: true
vars: vars:
horizon: "{{ horizon_services['horizon'] }}" service: "{{ horizon_services['horizon'] }}"
template: template:
src: "{{ item }}" src: "{{ item }}"
dest: "{{ node_config_directory }}/horizon/horizon.conf" dest: "{{ node_config_directory }}/horizon/horizon.conf"
@ -66,16 +61,14 @@
- "{{ node_custom_config }}/horizon/{{ inventory_hostname }}/horizon.conf" - "{{ node_custom_config }}/horizon/{{ inventory_hostname }}/horizon.conf"
- "{{ node_custom_config }}/horizon/horizon.conf" - "{{ node_custom_config }}/horizon/horizon.conf"
- "horizon.conf.j2" - "horizon.conf.j2"
when: when: service | service_enabled_and_mapped_to_host
- horizon.enabled | bool
- inventory_hostname in groups[horizon.group]
notify: notify:
- Restart horizon container - Restart horizon container
- name: Copying over kolla-settings.py - name: Copying over kolla-settings.py
become: true become: true
vars: vars:
horizon: "{{ horizon_services['horizon'] }}" service: "{{ horizon_services['horizon'] }}"
template: template:
src: "{{ item }}" src: "{{ item }}"
dest: "{{ node_config_directory }}/horizon/_9998-kolla-settings.py" dest: "{{ node_config_directory }}/horizon/_9998-kolla-settings.py"
@ -84,16 +77,14 @@
- "{{ node_custom_config }}/horizon/{{ inventory_hostname }}/_9998-kolla-settings.py" - "{{ node_custom_config }}/horizon/{{ inventory_hostname }}/_9998-kolla-settings.py"
- "{{ node_custom_config }}/horizon/_9998-kolla-settings.py" - "{{ node_custom_config }}/horizon/_9998-kolla-settings.py"
- "_9998-kolla-settings.py.j2" - "_9998-kolla-settings.py.j2"
when: when: service | service_enabled_and_mapped_to_host
- horizon.enabled | bool
- inventory_hostname in groups[horizon.group]
notify: notify:
- Restart horizon container - Restart horizon container
- name: Copying over custom-settings.py - name: Copying over custom-settings.py
become: true become: true
vars: vars:
horizon: "{{ horizon_services['horizon'] }}" service: "{{ horizon_services['horizon'] }}"
template: template:
src: "{{ item }}" src: "{{ item }}"
dest: "{{ node_config_directory }}/horizon/_9999-custom-settings.py" dest: "{{ node_config_directory }}/horizon/_9999-custom-settings.py"
@ -102,23 +93,19 @@
- "{{ node_custom_config }}/horizon/{{ inventory_hostname }}/_9999-custom-settings.py" - "{{ node_custom_config }}/horizon/{{ inventory_hostname }}/_9999-custom-settings.py"
- "{{ node_custom_config }}/horizon/_9999-custom-settings.py" - "{{ node_custom_config }}/horizon/_9999-custom-settings.py"
- "_9999-custom-settings.py.j2" - "_9999-custom-settings.py.j2"
when: when: service | service_enabled_and_mapped_to_host
- horizon.enabled | bool
- inventory_hostname in groups[horizon.group]
notify: notify:
- Restart horizon container - Restart horizon container
- name: Copying over existing policy file - name: Copying over existing policy file
become: true become: true
vars: vars:
horizon: "{{ horizon_services['horizon'] }}" service: "{{ horizon_services['horizon'] }}"
template: template:
src: "{{ item }}" src: "{{ item }}"
dest: "{{ node_config_directory }}/horizon/{{ item | basename }}" dest: "{{ node_config_directory }}/horizon/{{ item | basename }}"
mode: "0660" mode: "0660"
when: when: service | service_enabled_and_mapped_to_host
- horizon.enabled | bool
- inventory_hostname in groups[horizon.group]
with_items: "{{ custom_policy }}" with_items: "{{ custom_policy }}"
notify: notify:
- Restart horizon container - Restart horizon container
@ -126,14 +113,13 @@
- name: Copying over custom themes - name: Copying over custom themes
become: true become: true
vars: vars:
horizon: "{{ horizon_services['horizon'] }}" service: "{{ horizon_services['horizon'] }}"
copy: copy:
src: "{{ node_custom_config }}/horizon/themes/{{ item.name }}" src: "{{ node_custom_config }}/horizon/themes/{{ item.name }}"
dest: "{{ node_config_directory }}/horizon/themes/" dest: "{{ node_config_directory }}/horizon/themes/"
mode: 0660 mode: 0660
when: when:
- horizon.enabled | bool - service | service_enabled_and_mapped_to_host
- inventory_hostname in groups[horizon.group]
- horizon_custom_themes | length > 0 - horizon_custom_themes | length > 0
with_items: "{{ horizon_custom_themes }}" with_items: "{{ horizon_custom_themes }}"
notify: notify:

View File

@ -8,9 +8,6 @@
image: "{{ item.value.image }}" image: "{{ item.value.image }}"
volumes: "{{ item.value.volumes }}" volumes: "{{ item.value.volumes }}"
dimensions: "{{ item.value.dimensions }}" dimensions: "{{ item.value.dimensions }}"
when: with_dict: "{{ influxdb_services | select_services_enabled_and_mapped_to_host }}"
- inventory_hostname in groups[item.value.group]
- item.value.enabled | bool
with_dict: "{{ influxdb_services }}"
notify: notify:
- "Restart {{ item.key }} container" - "Restart {{ item.key }} container"

View File

@ -7,10 +7,7 @@
group: "{{ config_owner_group }}" group: "{{ config_owner_group }}"
mode: "0770" mode: "0770"
become: true become: true
when: with_dict: "{{ influxdb_services | select_services_enabled_and_mapped_to_host }}"
- inventory_hostname in groups[item.value.group]
- item.value.enabled | bool
with_dict: "{{ influxdb_services }}"
- name: Copying over config.json files - name: Copying over config.json files
template: template:
@ -18,10 +15,7 @@
dest: "{{ node_config_directory }}/influxdb/config.json" dest: "{{ node_config_directory }}/influxdb/config.json"
mode: "0660" mode: "0660"
become: true become: true
when: with_dict: "{{ influxdb_services | select_services_enabled_and_mapped_to_host }}"
- inventory_hostname in groups[item.value.group]
- item.value.enabled | bool
with_dict: "{{ influxdb_services }}"
notify: notify:
- Restart influxdb container - Restart influxdb container
@ -33,9 +27,7 @@
dest: "{{ node_config_directory }}/influxdb/influxdb.conf" dest: "{{ node_config_directory }}/influxdb/influxdb.conf"
mode: "0660" mode: "0660"
become: true become: true
when: when: service | service_enabled_and_mapped_to_host
- inventory_hostname in groups[service.group]
- service.enabled | bool
with_first_found: with_first_found:
- "{{ node_custom_config }}/influxdb/{{ inventory_hostname }}/influxdb.conf" - "{{ node_custom_config }}/influxdb/{{ inventory_hostname }}/influxdb.conf"
- "{{ node_custom_config }}/influxdb.conf" - "{{ node_custom_config }}/influxdb.conf"

View File

@ -47,7 +47,7 @@
- name: Running ironic-tftp bootstrap container - name: Running ironic-tftp bootstrap container
vars: vars:
ironic_tftp: "{{ ironic_services['ironic-tftp'] }}" service: "{{ ironic_services['ironic-tftp'] }}"
become: true become: true
kolla_container: kolla_container:
action: "start_container" action: "start_container"
@ -58,12 +58,10 @@
HTTPBOOT_PATH: /var/lib/ironic/httpboot HTTPBOOT_PATH: /var/lib/ironic/httpboot
KOLLA_BOOTSTRAP: KOLLA_BOOTSTRAP:
KOLLA_CONFIG_STRATEGY: "{{ config_strategy }}" KOLLA_CONFIG_STRATEGY: "{{ config_strategy }}"
image: "{{ ironic_tftp.image }}" image: "{{ service.image }}"
labels: labels:
BOOTSTRAP: BOOTSTRAP:
name: "bootstrap_ironic_tftp" name: "bootstrap_ironic_tftp"
restart_policy: oneshot restart_policy: oneshot
volumes: "{{ ironic_tftp.volumes }}" volumes: "{{ service.volumes }}"
when: when: service | service_enabled_and_mapped_to_host
- inventory_hostname in groups[ironic_tftp.group]
- ironic_tftp.enabled | bool

View File

@ -12,9 +12,6 @@
volumes: "{{ item.value.volumes | reject('equalto', '') | list }}" volumes: "{{ item.value.volumes | reject('equalto', '') | list }}"
dimensions: "{{ item.value.dimensions }}" dimensions: "{{ item.value.dimensions }}"
healthcheck: "{{ item.value.healthcheck | default(omit) }}" healthcheck: "{{ item.value.healthcheck | default(omit) }}"
when: with_dict: "{{ ironic_services | select_services_enabled_and_mapped_to_host }}"
- inventory_hostname in groups[item.value.group]
- item.value.enabled | bool
with_dict: "{{ ironic_services }}"
notify: notify:
- "Restart {{ item.key }} container" - "Restart {{ item.key }} container"

View File

@ -7,10 +7,7 @@
group: "{{ config_owner_group }}" group: "{{ config_owner_group }}"
mode: "0770" mode: "0770"
become: true become: true
when: with_dict: "{{ ironic_services | select_services_enabled_and_mapped_to_host }}"
- inventory_hostname in groups[item.value.group]
- item.value.enabled | bool
with_dict: "{{ ironic_services }}"
- name: Check if Ironic policies shall be overwritten - name: Check if Ironic policies shall be overwritten
stat: stat:
@ -60,10 +57,7 @@
dest: "{{ node_config_directory }}/{{ item.key }}/config.json" dest: "{{ node_config_directory }}/{{ item.key }}/config.json"
mode: "0660" mode: "0660"
become: true become: true
when: with_dict: "{{ ironic_services | select_services_enabled_and_mapped_to_host }}"
- inventory_hostname in groups[item.value.group]
- item.value.enabled | bool
with_dict: "{{ ironic_services }}"
notify: notify:
- "Restart {{ item.key }} container" - "Restart {{ item.key }} container"
@ -82,9 +76,7 @@
become: true become: true
when: when:
- item.key in [ "ironic-api", "ironic-conductor", "ironic-prometheus-exporter" ] - item.key in [ "ironic-api", "ironic-conductor", "ironic-prometheus-exporter" ]
- inventory_hostname in groups[item.value.group] with_dict: "{{ ironic_services | select_services_enabled_and_mapped_to_host }}"
- item.value.enabled | bool
with_dict: "{{ ironic_services }}"
notify: notify:
- "Restart {{ item.key }} container" - "Restart {{ item.key }} container"
@ -101,9 +93,7 @@
dest: "{{ node_config_directory }}/ironic-inspector/inspector.conf" dest: "{{ node_config_directory }}/ironic-inspector/inspector.conf"
mode: "0660" mode: "0660"
become: true become: true
when: when: service | service_enabled_and_mapped_to_host
- inventory_hostname in groups[service.group]
- service.enabled | bool
notify: notify:
- Restart ironic-inspector container - Restart ironic-inspector container
@ -115,9 +105,7 @@
dest: "{{ node_config_directory }}/ironic-dnsmasq/dnsmasq.conf" dest: "{{ node_config_directory }}/ironic-dnsmasq/dnsmasq.conf"
mode: "0660" mode: "0660"
become: true become: true
when: when: service | service_enabled_and_mapped_to_host
- inventory_hostname in groups[service.group]
- service.enabled | bool
with_first_found: with_first_found:
- "{{ node_custom_config }}/ironic/ironic-dnsmasq.conf" - "{{ node_custom_config }}/ironic/ironic-dnsmasq.conf"
- "{{ node_custom_config }}/ironic/{{ inventory_hostname }}/ironic-dnsmasq.conf" - "{{ node_custom_config }}/ironic/{{ inventory_hostname }}/ironic-dnsmasq.conf"
@ -140,8 +128,7 @@
when: when:
# Only required when Ironic inspector is in use. # Only required when Ironic inspector is in use.
- groups['ironic-inspector'] | length > 0 - groups['ironic-inspector'] | length > 0
- inventory_hostname in groups[service.group] - service | service_enabled_and_mapped_to_host
- service.enabled | bool
- not ironic_dnsmasq_serve_ipxe | bool - not ironic_dnsmasq_serve_ipxe | bool
notify: notify:
- Restart ironic-tftp container - Restart ironic-tftp container
@ -160,8 +147,7 @@
when: when:
# Only required when Ironic inspector is in use. # Only required when Ironic inspector is in use.
- groups['ironic-inspector'] | length > 0 - groups['ironic-inspector'] | length > 0
- inventory_hostname in groups[service.group] - service | service_enabled_and_mapped_to_host
- service.enabled | bool
- not ironic_dnsmasq_serve_ipxe | bool - not ironic_dnsmasq_serve_ipxe | bool
notify: notify:
- Restart ironic-tftp container - Restart ironic-tftp container
@ -180,8 +166,7 @@
when: when:
# Only required when Ironic inspector is in use. # Only required when Ironic inspector is in use.
- groups['ironic-inspector'] | length > 0 - groups['ironic-inspector'] | length > 0
- inventory_hostname in groups[service.group] - service | service_enabled_and_mapped_to_host
- service.enabled | bool
notify: notify:
- Restart ironic-http container - Restart ironic-http container
@ -200,8 +185,7 @@
when: when:
# Only required when Ironic inspector is in use. # Only required when Ironic inspector is in use.
- groups['ironic-inspector'] | length > 0 - groups['ironic-inspector'] | length > 0
- inventory_hostname in groups[service.group] - service | service_enabled_and_mapped_to_host
- service.enabled | bool
notify: notify:
- Restart ironic-http container - Restart ironic-http container
@ -216,9 +200,7 @@
with_first_found: with_first_found:
- "{{ node_custom_config }}/ironic/ironic-http-httpd.conf" - "{{ node_custom_config }}/ironic/ironic-http-httpd.conf"
- "ironic-http-httpd.conf.j2" - "ironic-http-httpd.conf.j2"
when: when: service | service_enabled_and_mapped_to_host
- service.enabled | bool
- inventory_hostname in groups[service.group]
notify: notify:
- Restart ironic-http container - Restart ironic-http container
@ -234,9 +216,7 @@
- "{{ node_config_directory }}/ironic/{{ inventory_hostname }}/ironic-prometheus-exporter-wsgi.conf" - "{{ node_config_directory }}/ironic/{{ inventory_hostname }}/ironic-prometheus-exporter-wsgi.conf"
- "{{ node_config_directory }}/ironic/ironic-prometheus-exporter-wsgi.conf" - "{{ node_config_directory }}/ironic/ironic-prometheus-exporter-wsgi.conf"
- "ironic-prometheus-exporter-wsgi.conf.j2" - "ironic-prometheus-exporter-wsgi.conf.j2"
when: when: service | service_enabled_and_mapped_to_host
- inventory_hostname in groups[service.group]
- service.enabled | bool
notify: notify:
- "Restart ironic-prometheus-exporter container" - "Restart ironic-prometheus-exporter container"
@ -253,9 +233,7 @@
when: when:
- ironic_policy_file is defined - ironic_policy_file is defined
- item.key in services_require_policy_json - item.key in services_require_policy_json
- inventory_hostname in groups[item.value.group] with_dict: "{{ ironic_services | select_services_enabled_and_mapped_to_host }}"
- item.value.enabled | bool
with_dict: "{{ ironic_services }}"
notify: notify:
- "Restart {{ item.key }} container" - "Restart {{ item.key }} container"
@ -271,20 +249,18 @@
when: when:
- ironic_inspector_policy_file is defined - ironic_inspector_policy_file is defined
- item.key in services_require_inspector_policy_json - item.key in services_require_inspector_policy_json
- inventory_hostname in groups[item.value.group] with_dict: "{{ ironic_services | select_services_enabled_and_mapped_to_host }}"
- item.value.enabled | bool
with_dict: "{{ ironic_services }}"
notify: notify:
- "Restart {{ item.key }} container" - "Restart {{ item.key }} container"
- name: Copying over ironic-api-wsgi.conf - name: Copying over ironic-api-wsgi.conf
vars:
service: "{{ ironic_services['ironic-api'] }}"
template: template:
src: "ironic-api-wsgi.conf.j2" src: "ironic-api-wsgi.conf.j2"
dest: "{{ node_config_directory }}/ironic-api/ironic-api-wsgi.conf" dest: "{{ node_config_directory }}/ironic-api/ironic-api-wsgi.conf"
mode: "0660" mode: "0660"
become: true become: true
when: when: service | service_enabled_and_mapped_to_host
- inventory_hostname in groups["ironic-api"]
- ironic_services["ironic-api"].enabled | bool
notify: notify:
- "Restart ironic-api container" - "Restart ironic-api container"

View File

@ -10,9 +10,6 @@
privileged: "{{ item.value.privileged | default(False) }}" privileged: "{{ item.value.privileged | default(False) }}"
volumes: "{{ item.value.volumes }}" volumes: "{{ item.value.volumes }}"
dimensions: "{{ item.value.dimensions }}" dimensions: "{{ item.value.dimensions }}"
when: with_dict: "{{ iscsi_services | select_services_enabled_and_mapped_to_host }}"
- inventory_hostname in groups[item.value.group]
- item.value.enabled | bool
with_dict: "{{ iscsi_services }}"
notify: notify:
- "Restart {{ item.key }} container" - "Restart {{ item.key }} container"

View File

@ -7,10 +7,7 @@
group: "{{ config_owner_group }}" group: "{{ config_owner_group }}"
mode: "0770" mode: "0770"
become: true become: true
when: with_dict: "{{ iscsi_services | select_services_enabled_and_mapped_to_host }}"
- inventory_hostname in groups[item.value.group]
- item.value.enabled | bool
with_dict: "{{ iscsi_services }}"
- name: Copying over config.json files for services - name: Copying over config.json files for services
template: template:
@ -18,9 +15,6 @@
dest: "{{ node_config_directory }}/{{ item.key }}/config.json" dest: "{{ node_config_directory }}/{{ item.key }}/config.json"
mode: "0660" mode: "0660"
become: true become: true
when: with_dict: "{{ iscsi_services | select_services_enabled_and_mapped_to_host }}"
- inventory_hostname in groups[item.value.group]
- item.value.enabled | bool
with_dict: "{{ iscsi_services }}"
notify: notify:
- "Restart {{ item.key }} container" - "Restart {{ item.key }} container"

View File

@ -9,9 +9,6 @@
volumes: "{{ item.value.volumes | reject('equalto', '') | list }}" volumes: "{{ item.value.volumes | reject('equalto', '') | list }}"
dimensions: "{{ item.value.dimensions }}" dimensions: "{{ item.value.dimensions }}"
healthcheck: "{{ item.value.healthcheck | default(omit) }}" healthcheck: "{{ item.value.healthcheck | default(omit) }}"
when: with_dict: "{{ keystone_services | select_services_enabled_and_mapped_to_host }}"
- inventory_hostname in groups[item.value.group]
- item.value.enabled | bool
with_dict: "{{ keystone_services }}"
notify: notify:
- "Restart {{ item.key }} container" - "Restart {{ item.key }} container"

View File

@ -7,10 +7,7 @@
group: "{{ config_owner_group }}" group: "{{ config_owner_group }}"
mode: "0770" mode: "0770"
become: true become: true
when: with_dict: "{{ keystone_services | select_services_enabled_and_mapped_to_host }}"
- inventory_hostname in groups[item.value.group]
- item.value.enabled | bool
with_dict: "{{ keystone_services }}"
- name: Check if policies shall be overwritten - name: Check if policies shall be overwritten
stat: stat:
@ -48,10 +45,7 @@
dest: "{{ node_config_directory }}/{{ item.key }}/config.json" dest: "{{ node_config_directory }}/{{ item.key }}/config.json"
mode: "0660" mode: "0660"
become: true become: true
with_dict: "{{ keystone_services }}" with_dict: "{{ keystone_services | select_services_enabled_and_mapped_to_host }}"
when:
- inventory_hostname in groups[item.value.group]
- item.value.enabled | bool
notify: notify:
- Restart {{ item.key }} container - Restart {{ item.key }} container
@ -68,39 +62,34 @@
dest: "{{ node_config_directory }}/{{ item.key }}/keystone.conf" dest: "{{ node_config_directory }}/{{ item.key }}/keystone.conf"
mode: "0660" mode: "0660"
become: true become: true
with_dict: "{{ keystone_services }}" with_dict: "{{ keystone_services | select_services_enabled_and_mapped_to_host }}"
when: when:
- inventory_hostname in groups[item.value.group]
- item.key in [ "keystone", "keystone-fernet" ] - item.key in [ "keystone", "keystone-fernet" ]
- item.value.enabled | bool
notify: notify:
- Restart {{ item.key }} container - Restart {{ item.key }} container
- name: Copying keystone-startup script for keystone - name: Copying keystone-startup script for keystone
vars: vars:
keystone: "{{ keystone_services['keystone'] }}" service: "{{ keystone_services['keystone'] }}"
template: template:
src: "keystone-startup.sh.j2" src: "keystone-startup.sh.j2"
dest: "{{ node_config_directory }}/keystone/keystone-startup.sh" dest: "{{ node_config_directory }}/keystone/keystone-startup.sh"
mode: "0660" mode: "0660"
become: true become: true
when: when: service | service_enabled_and_mapped_to_host
- inventory_hostname in groups[keystone.group]
- keystone.enabled | bool
notify: notify:
- Restart keystone container - Restart keystone container
- name: Create Keystone domain-specific config directory - name: Create Keystone domain-specific config directory
vars: vars:
keystone: "{{ keystone_services.keystone }}" service: "{{ keystone_services['keystone'] }}"
file: file:
dest: "{{ node_config_directory }}/keystone/domains/" dest: "{{ node_config_directory }}/keystone/domains/"
state: "directory" state: "directory"
mode: "0770" mode: "0770"
become: true become: true
when: when:
- inventory_hostname in groups[keystone.group] - service | service_enabled_and_mapped_to_host
- keystone.enabled | bool
- keystone_domain_directory.stat.exists - keystone_domain_directory.stat.exists
- name: Get file list in custom domains folder - name: Get file list in custom domains folder
@ -114,7 +103,7 @@
- name: Copying Keystone Domain specific settings - name: Copying Keystone Domain specific settings
vars: vars:
keystone: "{{ keystone_services.keystone }}" service: "{{ keystone_services['keystone'] }}"
template: template:
src: "{{ item.path }}" src: "{{ item.path }}"
dest: "{{ node_config_directory }}/keystone/domains/" dest: "{{ node_config_directory }}/keystone/domains/"
@ -122,8 +111,7 @@
become: true become: true
register: keystone_domains register: keystone_domains
when: when:
- inventory_hostname in groups[keystone.group] - service | service_enabled_and_mapped_to_host
- keystone.enabled | bool
- keystone_domain_directory.stat.exists - keystone_domain_directory.stat.exists
with_items: "{{ keystone_domains.files | default([]) }}" with_items: "{{ keystone_domains.files | default([]) }}"
notify: notify:
@ -136,11 +124,9 @@
mode: "0660" mode: "0660"
become: true become: true
when: when:
- inventory_hostname in groups[item.value.group]
- item.key in [ "keystone", "keystone-fernet" ] - item.key in [ "keystone", "keystone-fernet" ]
- item.value.enabled | bool
- keystone_policy_file is defined - keystone_policy_file is defined
with_dict: "{{ keystone_services }}" with_dict: "{{ keystone_services | select_services_enabled_and_mapped_to_host }}"
notify: notify:
- Restart {{ item.key }} container - Restart {{ item.key }} container
@ -150,15 +136,13 @@
- name: Copying over wsgi-keystone.conf - name: Copying over wsgi-keystone.conf
vars: vars:
keystone: "{{ keystone_services.keystone }}" service: "{{ keystone_services['keystone'] }}"
template: template:
src: "{{ item }}" src: "{{ item }}"
dest: "{{ node_config_directory }}/keystone/wsgi-keystone.conf" dest: "{{ node_config_directory }}/keystone/wsgi-keystone.conf"
mode: "0660" mode: "0660"
become: true become: true
when: when: service | service_enabled_and_mapped_to_host
- inventory_hostname in groups[keystone.group]
- keystone.enabled | bool
with_first_found: with_first_found:
- "{{ node_custom_config }}/keystone/{{ inventory_hostname }}/wsgi-keystone.conf" - "{{ node_custom_config }}/keystone/{{ inventory_hostname }}/wsgi-keystone.conf"
- "{{ node_custom_config }}/keystone/wsgi-keystone.conf" - "{{ node_custom_config }}/keystone/wsgi-keystone.conf"
@ -168,26 +152,24 @@
- name: Checking whether keystone-paste.ini file exists - name: Checking whether keystone-paste.ini file exists
vars: vars:
keystone: "{{ keystone_services.keystone }}" service: "{{ keystone_services['keystone'] }}"
stat: stat:
path: "{{ node_custom_config }}/keystone/keystone-paste.ini" path: "{{ node_custom_config }}/keystone/keystone-paste.ini"
delegate_to: localhost delegate_to: localhost
run_once: True run_once: True
register: check_keystone_paste_ini register: check_keystone_paste_ini
when: when: service | service_enabled_and_mapped_to_host
- keystone.enabled | bool
- name: Copying over keystone-paste.ini - name: Copying over keystone-paste.ini
vars: vars:
keystone: "{{ keystone_services.keystone }}" service: "{{ keystone_services['keystone'] }}"
template: template:
src: "{{ node_custom_config }}/keystone/keystone-paste.ini" src: "{{ node_custom_config }}/keystone/keystone-paste.ini"
dest: "{{ node_config_directory }}/keystone/keystone-paste.ini" dest: "{{ node_config_directory }}/keystone/keystone-paste.ini"
mode: "0660" mode: "0660"
become: true become: true
when: when:
- inventory_hostname in groups[keystone.group] - service | service_enabled_and_mapped_to_host
- keystone.enabled | bool
- check_keystone_paste_ini.stat.exists - check_keystone_paste_ini.stat.exists
notify: notify:
- Restart keystone container - Restart keystone container
@ -211,7 +193,7 @@
- name: Copying files for keystone-fernet - name: Copying files for keystone-fernet
vars: vars:
keystone_fernet: "{{ keystone_services['keystone-fernet'] }}" service: "{{ keystone_services['keystone-fernet'] }}"
template: template:
src: "{{ item.src }}" src: "{{ item.src }}"
dest: "{{ node_config_directory }}/keystone-fernet/{{ item.dest }}" dest: "{{ node_config_directory }}/keystone-fernet/{{ item.dest }}"
@ -226,15 +208,13 @@
- { src: "fernet-healthcheck.sh.j2", dest: "fernet-healthcheck.sh" } - { src: "fernet-healthcheck.sh.j2", dest: "fernet-healthcheck.sh" }
- { src: "id_rsa", dest: "id_rsa" } - { src: "id_rsa", dest: "id_rsa" }
- { src: "ssh_config.j2", dest: "ssh_config" } - { src: "ssh_config.j2", dest: "ssh_config" }
when: when: service | service_enabled_and_mapped_to_host
- inventory_hostname in groups[keystone_fernet.group]
- keystone_fernet.enabled | bool
notify: notify:
- Restart keystone-fernet container - Restart keystone-fernet container
- name: Copying files for keystone-ssh - name: Copying files for keystone-ssh
vars: vars:
keystone_ssh: "{{ keystone_services['keystone-ssh'] }}" service: "{{ keystone_services['keystone-ssh'] }}"
template: template:
src: "{{ item.src }}" src: "{{ item.src }}"
dest: "{{ node_config_directory }}/keystone-ssh/{{ item.dest }}" dest: "{{ node_config_directory }}/keystone-ssh/{{ item.dest }}"
@ -243,8 +223,6 @@
with_items: with_items:
- { src: "sshd_config.j2", dest: "sshd_config" } - { src: "sshd_config.j2", dest: "sshd_config" }
- { src: "id_rsa.pub", dest: "id_rsa.pub" } - { src: "id_rsa.pub", dest: "id_rsa.pub" }
when: when: service | service_enabled_and_mapped_to_host
- inventory_hostname in groups[keystone_ssh.group]
- keystone_ssh.enabled | bool
notify: notify:
- Restart keystone-ssh container - Restart keystone-ssh container

View File

@ -11,9 +11,6 @@
volumes: "{{ item.value.volumes }}" volumes: "{{ item.value.volumes }}"
dimensions: "{{ item.value.dimensions }}" dimensions: "{{ item.value.dimensions }}"
healthcheck: "{{ item.value.healthcheck | default(omit) }}" healthcheck: "{{ item.value.healthcheck | default(omit) }}"
when: with_dict: "{{ kuryr_services | select_services_enabled_and_mapped_to_host }}"
- inventory_hostname in groups[item.value.group]
- item.value.enabled | bool
with_dict: "{{ kuryr_services }}"
notify: notify:
- "Restart {{ item.key }} container" - "Restart {{ item.key }} container"

View File

@ -7,10 +7,7 @@
group: "{{ config_owner_group }}" group: "{{ config_owner_group }}"
mode: "0770" mode: "0770"
become: true become: true
when: with_dict: "{{ kuryr_services | select_services_enabled_and_mapped_to_host }}"
- inventory_hostname in groups[item.value.group]
- item.value.enabled | bool
with_dict: "{{ kuryr_services }}"
- name: Check if policies shall be overwritten - name: Check if policies shall be overwritten
stat: stat:
@ -41,10 +38,7 @@
dest: "{{ node_config_directory }}/{{ item.key }}/config.json" dest: "{{ node_config_directory }}/{{ item.key }}/config.json"
mode: "0660" mode: "0660"
become: true become: true
when: with_dict: "{{ kuryr_services | select_services_enabled_and_mapped_to_host }}"
- inventory_hostname in groups[item.value.group]
- item.value.enabled | bool
with_dict: "{{ kuryr_services }}"
notify: notify:
- Restart kuryr container - Restart kuryr container
@ -61,10 +55,7 @@
dest: "{{ node_config_directory }}/{{ item.key }}/kuryr.conf" dest: "{{ node_config_directory }}/{{ item.key }}/kuryr.conf"
mode: "0660" mode: "0660"
become: true become: true
when: with_dict: "{{ kuryr_services | select_services_enabled_and_mapped_to_host }}"
- inventory_hostname in groups[item.value.group]
- item.value.enabled | bool
with_dict: "{{ kuryr_services }}"
notify: notify:
- Restart kuryr container - Restart kuryr container
@ -76,9 +67,7 @@
dest: "{{ node_config_directory }}/{{ item }}/kuryr.spec" dest: "{{ node_config_directory }}/{{ item }}/kuryr.spec"
mode: "0660" mode: "0660"
become: true become: true
when: when: service | service_enabled_and_mapped_to_host
- inventory_hostname in groups[service.group]
- service.enabled | bool
with_items: with_items:
- "kuryr" - "kuryr"
notify: notify:
@ -92,8 +81,6 @@
become: true become: true
when: when:
- kuryr_policy_file is defined - kuryr_policy_file is defined
- inventory_hostname in groups[item.value.group] with_dict: "{{ kuryr_services | select_services_enabled_and_mapped_to_host }}"
- item.value.enabled | bool
with_dict: "{{ kuryr_services }}"
notify: notify:
- Restart kuryr container - Restart kuryr container

View File

@ -10,9 +10,6 @@
dimensions: "{{ item.value.dimensions }}" dimensions: "{{ item.value.dimensions }}"
healthcheck: "{{ item.value.healthcheck | default(omit) }}" healthcheck: "{{ item.value.healthcheck | default(omit) }}"
environment: "{{ item.value.environment | default(omit) }}" environment: "{{ item.value.environment | default(omit) }}"
when: with_dict: "{{ letsencrypt_services | select_services_enabled_and_mapped_to_host }}"
- inventory_hostname in groups[item.value.group]
- item.value.enabled | bool
with_dict: "{{ letsencrypt_services }}"
notify: notify:
- "Restart {{ item.key }} container" - "Restart {{ item.key }} container"

View File

@ -7,10 +7,7 @@
group: "{{ config_owner_group }}" group: "{{ config_owner_group }}"
mode: "0770" mode: "0770"
become: true become: true
when: with_dict: "{{ letsencrypt_services | select_services_enabled_and_mapped_to_host }}"
- inventory_hostname in groups[item.value.group]
- item.value.enabled | bool
with_dict: "{{ letsencrypt_services }}"
- name: Copying over config.json files for services - name: Copying over config.json files for services
template: template:
@ -18,10 +15,7 @@
dest: "{{ node_config_directory }}/{{ item.key }}/config.json" dest: "{{ node_config_directory }}/{{ item.key }}/config.json"
mode: "0660" mode: "0660"
become: true become: true
when: with_dict: "{{ letsencrypt_services | select_services_enabled_and_mapped_to_host }}"
- inventory_hostname in groups[item.value.group]
- item.value.enabled | bool
with_dict: "{{ letsencrypt_services }}"
notify: notify:
- "Restart {{ item.key }} container" - "Restart {{ item.key }} container"
@ -37,9 +31,7 @@
- "{{ node_custom_config }}/letsencrypt/{{ inventory_hostname }}/letsencrypt-webserver.conf" - "{{ node_custom_config }}/letsencrypt/{{ inventory_hostname }}/letsencrypt-webserver.conf"
- "{{ node_custom_config }}/letsencrypt/letsencrypt-webserver.conf" - "{{ node_custom_config }}/letsencrypt/letsencrypt-webserver.conf"
- "letsencrypt-webserver.conf.j2" - "letsencrypt-webserver.conf.j2"
when: when: service | service_enabled_and_mapped_to_host
- inventory_hostname in groups[service.group]
- service.enabled | bool
notify: notify:
- Restart letsencrypt-webserver container - Restart letsencrypt-webserver container
@ -55,9 +47,7 @@
- { src: "crontab.j2", dest: "crontab" } - { src: "crontab.j2", dest: "crontab" }
- { src: "id_rsa.j2", dest: "id_rsa" } - { src: "id_rsa.j2", dest: "id_rsa" }
- { src: "letsencrypt-lego-run.sh.j2", dest: "letsencrypt-lego-run.sh" } - { src: "letsencrypt-lego-run.sh.j2", dest: "letsencrypt-lego-run.sh" }
when: when: service | service_enabled_and_mapped_to_host
- inventory_hostname in groups[service.group]
- service.enabled | bool
notify: notify:
- Restart letsencrypt-lego container - Restart letsencrypt-lego container

View File

@ -18,8 +18,7 @@
state: stopped state: stopped
when: when:
- container_facts['letsencrypt_webserver'] is not defined - container_facts['letsencrypt_webserver'] is not defined
- inventory_hostname in groups[service.group] - service | service_enabled_and_mapped_to_host
- service.enabled | bool
- name: Validating letsencrypt email variable - name: Validating letsencrypt email variable
run_once: true run_once: true

View File

@ -10,9 +10,6 @@
dimensions: "{{ item.value.dimensions }}" dimensions: "{{ item.value.dimensions }}"
healthcheck: "{{ item.value.healthcheck | default(omit) }}" healthcheck: "{{ item.value.healthcheck | default(omit) }}"
privileged: "{{ item.value.privileged | default(False) }}" privileged: "{{ item.value.privileged | default(False) }}"
when: with_dict: "{{ loadbalancer_services | select_services_enabled_and_mapped_to_host }}"
- inventory_hostname in groups[item.value.group]
- item.value.enabled | bool
with_dict: "{{ loadbalancer_services }}"
notify: notify:
- "Restart {{ item.key }} container" - "Restart {{ item.key }} container"

View File

@ -7,10 +7,7 @@
group: "{{ config_owner_group }}" group: "{{ config_owner_group }}"
mode: "0770" mode: "0770"
become: true become: true
when: with_dict: "{{ loadbalancer_services | select_services_enabled_and_mapped_to_host }}"
- inventory_hostname in groups[item.value.group]
- item.value.enabled | bool
with_dict: "{{ loadbalancer_services }}"
- name: Ensuring haproxy service config subdir exists - name: Ensuring haproxy service config subdir exists
vars: vars:
@ -22,9 +19,7 @@
group: "{{ config_owner_group }}" group: "{{ config_owner_group }}"
mode: "0770" mode: "0770"
become: true become: true
when: when: service | service_enabled_and_mapped_to_host
- inventory_hostname in groups[service.group]
- service.enabled | bool
- name: Ensuring proxysql service config subdirectories exist - name: Ensuring proxysql service config subdirectories exist
vars: vars:
@ -39,9 +34,7 @@
with_items: with_items:
- "users" - "users"
- "rules" - "rules"
when: when: service | service_enabled_and_mapped_to_host
- inventory_hostname in groups[service.group]
- service.enabled | bool
- name: Ensuring keepalived checks subdir exists - name: Ensuring keepalived checks subdir exists
vars: vars:
@ -53,9 +46,7 @@
group: "{{ config_owner_group }}" group: "{{ config_owner_group }}"
mode: "0770" mode: "0770"
become: true become: true
when: when: service | service_enabled_and_mapped_to_host
- inventory_hostname in groups[service.group]
- service.enabled | bool
- name: Remove mariadb.cfg if proxysql enabled - name: Remove mariadb.cfg if proxysql enabled
vars: vars:
@ -65,8 +56,7 @@
state: absent state: absent
become: true become: true
when: when:
- inventory_hostname in groups[service.group] - service | service_enabled_and_mapped_to_host
- service.enabled | bool
- loadbalancer_services.proxysql.enabled | bool - loadbalancer_services.proxysql.enabled | bool
notify: notify:
- Restart haproxy container - Restart haproxy container
@ -81,12 +71,11 @@
with_dict: "{{ loadbalancer_services }}" with_dict: "{{ loadbalancer_services }}"
when: when:
- keepalived_track_script_enabled | bool - keepalived_track_script_enabled | bool
- inventory_hostname in groups[service.group]
- item.key != 'keepalived' - item.key != 'keepalived'
- item.key != 'haproxy-ssh' - item.key != 'haproxy-ssh'
- not item.value.enabled | bool - not item.value.enabled | bool
or not inventory_hostname in groups[item.value.group] or not inventory_hostname in groups[item.value.group]
- service.enabled | bool - service | service_enabled_and_mapped_to_host
notify: notify:
- Restart keepalived container - Restart keepalived container
@ -101,12 +90,11 @@
with_dict: "{{ loadbalancer_services }}" with_dict: "{{ loadbalancer_services }}"
when: when:
- keepalived_track_script_enabled | bool - keepalived_track_script_enabled | bool
- inventory_hostname in groups[service.group]
- inventory_hostname in groups[item.value.group] - inventory_hostname in groups[item.value.group]
- item.key != 'keepalived' - item.key != 'keepalived'
- item.key != 'haproxy-ssh' - item.key != 'haproxy-ssh'
- item.value.enabled | bool - item.value.enabled | bool
- service.enabled | bool - service | service_enabled_and_mapped_to_host
notify: notify:
- Restart keepalived container - Restart keepalived container
@ -116,10 +104,7 @@
dest: "{{ node_config_directory }}/{{ item.key }}/config.json" dest: "{{ node_config_directory }}/{{ item.key }}/config.json"
mode: "0660" mode: "0660"
become: true become: true
when: with_dict: "{{ loadbalancer_services | select_services_enabled_and_mapped_to_host }}"
- inventory_hostname in groups[item.value.group]
- item.value.enabled | bool
with_dict: "{{ loadbalancer_services }}"
notify: notify:
- "Restart {{ item.key }} container" - "Restart {{ item.key }} container"
@ -131,9 +116,7 @@
dest: "{{ node_config_directory }}/haproxy/haproxy.cfg" dest: "{{ node_config_directory }}/haproxy/haproxy.cfg"
mode: "0660" mode: "0660"
become: true become: true
when: when: service | service_enabled_and_mapped_to_host
- inventory_hostname in groups[service.group]
- service.enabled | bool
with_first_found: with_first_found:
- "{{ node_custom_config }}/haproxy/{{ inventory_hostname }}/haproxy_main.cfg" - "{{ node_custom_config }}/haproxy/{{ inventory_hostname }}/haproxy_main.cfg"
- "{{ node_custom_config }}/haproxy/haproxy_main.cfg" - "{{ node_custom_config }}/haproxy/haproxy_main.cfg"
@ -149,9 +132,7 @@
dest: "{{ node_config_directory }}/proxysql/proxysql.yaml" dest: "{{ node_config_directory }}/proxysql/proxysql.yaml"
mode: "0660" mode: "0660"
become: true become: true
when: when: service | service_enabled_and_mapped_to_host
- inventory_hostname in groups[service.group]
- service.enabled | bool
with_first_found: with_first_found:
- "{{ node_custom_config }}/proxysql/{{ inventory_hostname }}/proxysql.yaml" - "{{ node_custom_config }}/proxysql/{{ inventory_hostname }}/proxysql.yaml"
- "{{ node_custom_config }}/proxysql/proxysql.yaml" - "{{ node_custom_config }}/proxysql/proxysql.yaml"
@ -168,8 +149,7 @@
mode: "0660" mode: "0660"
become: true become: true
when: when:
- inventory_hostname in groups[service.group] - service | service_enabled_and_mapped_to_host
- service.enabled | bool
- haproxy_single_external_frontend | bool - haproxy_single_external_frontend | bool
notify: notify:
- Restart haproxy container - Restart haproxy container
@ -182,9 +162,7 @@
dest: "{{ node_config_directory }}/haproxy/services.d/" dest: "{{ node_config_directory }}/haproxy/services.d/"
mode: "0660" mode: "0660"
become: true become: true
when: when: service | service_enabled_and_mapped_to_host
- inventory_hostname in groups[service.group]
- service.enabled | bool
with_fileglob: with_fileglob:
- "{{ node_custom_config }}/haproxy/services.d/*.cfg" - "{{ node_custom_config }}/haproxy/services.d/*.cfg"
notify: notify:
@ -198,9 +176,7 @@
dest: "{{ node_config_directory }}/keepalived/keepalived.conf" dest: "{{ node_config_directory }}/keepalived/keepalived.conf"
mode: "0660" mode: "0660"
become: true become: true
when: when: service | service_enabled_and_mapped_to_host
- inventory_hostname in groups[service.group]
- service.enabled | bool
with_first_found: with_first_found:
- "{{ node_custom_config }}/keepalived/{{ inventory_hostname }}/keepalived.conf" - "{{ node_custom_config }}/keepalived/{{ inventory_hostname }}/keepalived.conf"
- "{{ node_custom_config }}/keepalived/keepalived.conf" - "{{ node_custom_config }}/keepalived/keepalived.conf"
@ -220,8 +196,7 @@
- not enable_letsencrypt | bool - not enable_letsencrypt | bool
- kolla_enable_tls_external | bool - kolla_enable_tls_external | bool
- not kolla_externally_managed_cert | bool - not kolla_externally_managed_cert | bool
- inventory_hostname in groups[service.group] - service | service_enabled_and_mapped_to_host
- service.enabled | bool
with_items: with_items:
- "haproxy.pem" - "haproxy.pem"
notify: notify:
@ -239,8 +214,7 @@
- not enable_letsencrypt | bool - not enable_letsencrypt | bool
- kolla_enable_tls_internal | bool - kolla_enable_tls_internal | bool
- not kolla_externally_managed_cert | bool - not kolla_externally_managed_cert | bool
- inventory_hostname in groups[service.group] - service | service_enabled_and_mapped_to_host
- service.enabled | bool
with_items: with_items:
- "haproxy-internal.pem" - "haproxy-internal.pem"
notify: notify:
@ -258,9 +232,7 @@
dest: "{{ node_config_directory }}/haproxy/haproxy_run.sh" dest: "{{ node_config_directory }}/haproxy/haproxy_run.sh"
mode: "0770" mode: "0770"
become: true become: true
when: when: service | service_enabled_and_mapped_to_host
- inventory_hostname in groups[service.group]
- service.enabled | bool
with_first_found: with_first_found:
- "{{ node_custom_config }}/haproxy/{{ inventory_hostname }}/haproxy_run.sh" - "{{ node_custom_config }}/haproxy/{{ inventory_hostname }}/haproxy_run.sh"
- "{{ node_custom_config }}/haproxy/haproxy_run.sh" - "{{ node_custom_config }}/haproxy/haproxy_run.sh"
@ -276,9 +248,7 @@
dest: "{{ node_config_directory }}/proxysql/proxysql_run.sh" dest: "{{ node_config_directory }}/proxysql/proxysql_run.sh"
mode: "0770" mode: "0770"
become: true become: true
when: when: service | service_enabled_and_mapped_to_host
- inventory_hostname in groups[service.group]
- service.enabled | bool
with_first_found: with_first_found:
- "{{ node_custom_config }}/proxysql/{{ inventory_hostname }}/proxysql_run.sh" - "{{ node_custom_config }}/proxysql/{{ inventory_hostname }}/proxysql_run.sh"
- "{{ node_custom_config }}/proxysql/proxysql_run.sh" - "{{ node_custom_config }}/proxysql/proxysql_run.sh"
@ -288,7 +258,7 @@
- name: Copying files for haproxy-ssh - name: Copying files for haproxy-ssh
vars: vars:
haproxy_ssh: "{{ loadbalancer_services['haproxy-ssh'] }}" service: "{{ loadbalancer_services['haproxy-ssh'] }}"
template: template:
src: "{{ item.src }}" src: "{{ item.src }}"
dest: "{{ node_config_directory }}/haproxy-ssh/{{ item.dest }}" dest: "{{ node_config_directory }}/haproxy-ssh/{{ item.dest }}"
@ -297,8 +267,6 @@
with_items: with_items:
- { src: "haproxy-ssh/sshd_config.j2", dest: "sshd_config" } - { src: "haproxy-ssh/sshd_config.j2", dest: "sshd_config" }
- { src: "haproxy-ssh/id_rsa.pub", dest: "id_rsa.pub" } - { src: "haproxy-ssh/id_rsa.pub", dest: "id_rsa.pub" }
when: when: service | service_enabled_and_mapped_to_host
- inventory_hostname in groups[haproxy_ssh.group]
- haproxy_ssh.enabled | bool
notify: notify:
- Restart haproxy-ssh container - Restart haproxy-ssh container

View File

@ -10,9 +10,6 @@
dimensions: "{{ item.value.dimensions }}" dimensions: "{{ item.value.dimensions }}"
healthcheck: "{{ item.value.healthcheck | default(omit) }}" healthcheck: "{{ item.value.healthcheck | default(omit) }}"
environment: "{{ item.value.environment }}" environment: "{{ item.value.environment }}"
when: with_dict: "{{ magnum_services | select_services_enabled_and_mapped_to_host }}"
- inventory_hostname in groups[item.value.group]
- item.value.enabled | bool
with_dict: "{{ magnum_services }}"
notify: notify:
- "Restart {{ item.key }} container" - "Restart {{ item.key }} container"

View File

@ -7,10 +7,7 @@
group: "{{ config_owner_group }}" group: "{{ config_owner_group }}"
mode: "0770" mode: "0770"
become: true become: true
when: with_dict: "{{ magnum_services | select_services_enabled_and_mapped_to_host }}"
- inventory_hostname in groups[item.value.group]
- item.value.enabled | bool
with_dict: "{{ magnum_services }}"
- name: Check if policies shall be overwritten - name: Check if policies shall be overwritten
stat: stat:
@ -45,10 +42,8 @@
mode: "0660" mode: "0660"
become: true become: true
when: when:
- inventory_hostname in groups[item.value.group]
- item.value.enabled | bool
- magnum_kubeconfig_file.stat.exists - magnum_kubeconfig_file.stat.exists
with_dict: "{{ magnum_services }}" with_dict: "{{ magnum_services | select_services_enabled_and_mapped_to_host }}"
notify: notify:
- Restart {{ item.key }} container - Restart {{ item.key }} container
@ -68,10 +63,7 @@
dest: "{{ node_config_directory }}/{{ item.key }}/config.json" dest: "{{ node_config_directory }}/{{ item.key }}/config.json"
mode: "0660" mode: "0660"
become: true become: true
when: with_dict: "{{ magnum_services | select_services_enabled_and_mapped_to_host }}"
- inventory_hostname in groups[item.value.group]
- item.value.enabled | bool
with_dict: "{{ magnum_services }}"
notify: notify:
- Restart {{ item.key }} container - Restart {{ item.key }} container
@ -88,10 +80,7 @@
dest: "{{ node_config_directory }}/{{ item.key }}/magnum.conf" dest: "{{ node_config_directory }}/{{ item.key }}/magnum.conf"
mode: "0660" mode: "0660"
become: true become: true
when: with_dict: "{{ magnum_services | select_services_enabled_and_mapped_to_host }}"
- inventory_hostname in groups[item.value.group]
- item.value.enabled | bool
with_dict: "{{ magnum_services }}"
notify: notify:
- Restart {{ item.key }} container - Restart {{ item.key }} container
@ -103,8 +92,6 @@
become: true become: true
when: when:
- magnum_policy_file is defined - magnum_policy_file is defined
- inventory_hostname in groups[item.value.group] with_dict: "{{ magnum_services | select_services_enabled_and_mapped_to_host }}"
- item.value.enabled | bool
with_dict: "{{ magnum_services }}"
notify: notify:
- Restart {{ item.key }} container - Restart {{ item.key }} container

View File

@ -10,9 +10,6 @@
volumes: "{{ item.value.volumes | reject('equalto', '') | list }}" volumes: "{{ item.value.volumes | reject('equalto', '') | list }}"
dimensions: "{{ item.value.dimensions }}" dimensions: "{{ item.value.dimensions }}"
healthcheck: "{{ item.value.healthcheck | default(omit) }}" healthcheck: "{{ item.value.healthcheck | default(omit) }}"
when: with_dict: "{{ manila_services | select_services_enabled_and_mapped_to_host }}"
- inventory_hostname in groups[item.value.group]
- item.value.enabled | bool
with_dict: "{{ manila_services }}"
notify: notify:
- "Restart {{ item.key }} container" - "Restart {{ item.key }} container"

View File

@ -7,10 +7,7 @@
group: "{{ config_owner_group }}" group: "{{ config_owner_group }}"
mode: "0770" mode: "0770"
become: true become: true
when: with_dict: "{{ manila_services | select_services_enabled_and_mapped_to_host }}"
- inventory_hostname in groups[item.value.group]
- item.value.enabled | bool
with_dict: "{{ manila_services }}"
- include_tasks: external_ceph.yml - include_tasks: external_ceph.yml
when: when:
@ -46,10 +43,7 @@
dest: "{{ node_config_directory }}/{{ item.key }}/config.json" dest: "{{ node_config_directory }}/{{ item.key }}/config.json"
mode: "0660" mode: "0660"
become: true become: true
when: with_dict: "{{ manila_services | select_services_enabled_and_mapped_to_host }}"
- inventory_hostname in groups[item.value.group]
- item.value.enabled | bool
with_dict: "{{ manila_services }}"
notify: notify:
- "Restart {{ item.key }} container" - "Restart {{ item.key }} container"
@ -68,9 +62,7 @@
become: true become: true
when: when:
- item.key in [ "manila-api", "manila-data", "manila-scheduler" ] - item.key in [ "manila-api", "manila-data", "manila-scheduler" ]
- inventory_hostname in groups[item.value.group] with_dict: "{{ manila_services | select_services_enabled_and_mapped_to_host }}"
- item.value.enabled | bool
with_dict: "{{ manila_services }}"
notify: notify:
- Restart {{ item.key }} container - Restart {{ item.key }} container
@ -90,9 +82,7 @@
dest: "{{ node_config_directory }}/{{ item }}/manila.conf" dest: "{{ node_config_directory }}/{{ item }}/manila.conf"
mode: "0660" mode: "0660"
become: true become: true
when: when: service | service_enabled_and_mapped_to_host
- inventory_hostname in groups[service.group]
- service.enabled | bool
with_items: with_items:
- "manila-share" - "manila-share"
notify: notify:
@ -105,8 +95,6 @@
mode: "0660" mode: "0660"
when: when:
- manila_policy_file is defined - manila_policy_file is defined
- inventory_hostname in groups[item.value.group] with_dict: "{{ manila_services | select_services_enabled_and_mapped_to_host }}"
- item.value.enabled | bool
with_dict: "{{ manila_services }}"
notify: notify:
- "Restart {{ item.key }} container" - "Restart {{ item.key }} container"

View File

@ -9,9 +9,7 @@
group: "{{ config_owner_group }}" group: "{{ config_owner_group }}"
mode: "0770" mode: "0770"
become: true become: true
when: when: service | service_enabled_and_mapped_to_host
- inventory_hostname in groups[service.group]
- service.enabled | bool
- name: Copy over multiple ceph configs for Manila - name: Copy over multiple ceph configs for Manila
merge_configs: merge_configs:

View File

@ -10,9 +10,6 @@
dimensions: "{{ item.value.dimensions }}" dimensions: "{{ item.value.dimensions }}"
environment: "{{ item.value.environment | default(omit) }}" environment: "{{ item.value.environment | default(omit) }}"
healthcheck: "{{ item.value.healthcheck | default(omit) }}" healthcheck: "{{ item.value.healthcheck | default(omit) }}"
when: with_dict: "{{ mariadb_services | select_services_enabled_and_mapped_to_host }}"
- inventory_hostname in groups[item.value.group]
- item.value.enabled | bool
with_dict: "{{ mariadb_services }}"
notify: notify:
- "restart {{ item.key }}" - "restart {{ item.key }}"

View File

@ -7,10 +7,7 @@
group: "{{ config_owner_group }}" group: "{{ config_owner_group }}"
mode: "0770" mode: "0770"
become: true become: true
when: with_dict: "{{ mariadb_services | select_services_enabled_and_mapped_to_host }}"
- inventory_hostname in groups[item.value.group]
- item.value.enabled | bool
with_dict: "{{ mariadb_services }}"
- name: Ensuring database backup config directory exists - name: Ensuring database backup config directory exists
file: file:
@ -45,10 +42,7 @@
dest: "{{ node_config_directory }}/{{ item.key }}/config.json" dest: "{{ node_config_directory }}/{{ item.key }}/config.json"
mode: "0660" mode: "0660"
become: true become: true
when: with_dict: "{{ mariadb_services | select_services_enabled_and_mapped_to_host }}"
- inventory_hostname in groups[item.value.group]
- item.value.enabled | bool
with_dict: "{{ mariadb_services }}"
notify: notify:
- "restart {{ item.key }}" - "restart {{ item.key }}"
@ -76,8 +70,6 @@
dest: "{{ node_config_directory }}/{{ service_name }}/galera.cnf" dest: "{{ node_config_directory }}/{{ service_name }}/galera.cnf"
mode: "0660" mode: "0660"
become: true become: true
when: when: service | service_enabled_and_mapped_to_host
- inventory_hostname in groups[service.group]
- service.enabled | bool
notify: notify:
- restart mariadb - restart mariadb

View File

@ -10,9 +10,6 @@
privileged: "{{ item.value.privileged | default(False) }}" privileged: "{{ item.value.privileged | default(False) }}"
volumes: "{{ item.value.volumes | reject('equalto', '') | list }}" volumes: "{{ item.value.volumes | reject('equalto', '') | list }}"
dimensions: "{{ item.value.dimensions }}" dimensions: "{{ item.value.dimensions }}"
when: with_dict: "{{ masakari_services | select_services_enabled_and_mapped_to_host }}"
- inventory_hostname in groups[item.value.group]
- item.value.enabled | bool
with_dict: "{{ masakari_services }}"
notify: notify:
- Restart {{ item.key }} container - Restart {{ item.key }} container

View File

@ -7,10 +7,7 @@
group: "{{ config_owner_group }}" group: "{{ config_owner_group }}"
mode: "0770" mode: "0770"
become: true become: true
when: with_dict: "{{ masakari_services | select_services_enabled_and_mapped_to_host }}"
- item.value.enabled | bool
- inventory_hostname in groups[item.value.group]
with_dict: "{{ masakari_services }}"
- name: Check if policies shall be overwritten - name: Check if policies shall be overwritten
stat: stat:
@ -39,9 +36,7 @@
become: true become: true
when: when:
- masakari_policy_file is defined - masakari_policy_file is defined
- inventory_hostname in groups[item.value.group] with_dict: "{{ masakari_services | select_services_enabled_and_mapped_to_host }}"
- item.value.enabled | bool
with_dict: "{{ masakari_services }}"
notify: notify:
- Restart {{ item.key }} container - Restart {{ item.key }} container
@ -51,10 +46,7 @@
dest: "{{ node_config_directory }}/{{ item.key }}/config.json" dest: "{{ node_config_directory }}/{{ item.key }}/config.json"
mode: "0660" mode: "0660"
become: true become: true
when: with_dict: "{{ masakari_services | select_services_enabled_and_mapped_to_host }}"
- inventory_hostname in groups[item.value.group]
- item.value.enabled | bool
with_dict: "{{ masakari_services }}"
notify: notify:
- Restart {{ item.key }} container - Restart {{ item.key }} container
@ -76,9 +68,7 @@
dest: "{{ node_config_directory }}/{{ service_name }}/masakari.conf" dest: "{{ node_config_directory }}/{{ service_name }}/masakari.conf"
mode: "0660" mode: "0660"
become: true become: true
when: when: service | service_enabled_and_mapped_to_host
- inventory_hostname in groups[service.group]
- service.enabled | bool
with_items: with_items:
- masakari-api - masakari-api
- masakari-engine - masakari-engine
@ -99,9 +89,7 @@
dest: "{{ node_config_directory }}/{{ service_name }}/masakari-monitors.conf" dest: "{{ node_config_directory }}/{{ service_name }}/masakari-monitors.conf"
mode: "0660" mode: "0660"
become: true become: true
when: when: service | service_enabled_and_mapped_to_host
- inventory_hostname in groups[service.group]
- service.enabled | bool
with_items: with_items:
- masakari-instancemonitor - masakari-instancemonitor
- masakari-hostmonitor - masakari-hostmonitor
@ -116,9 +104,7 @@
dest: "{{ node_config_directory }}/masakari-api/wsgi-masakari.conf" dest: "{{ node_config_directory }}/masakari-api/wsgi-masakari.conf"
mode: "0660" mode: "0660"
become: true become: true
when: when: service | service_enabled_and_mapped_to_host
- inventory_hostname in groups[service.group]
- service.enabled | bool
notify: notify:
- Restart masakari-api container - Restart masakari-api container
@ -132,9 +118,7 @@
dest: "{{ node_config_directory }}/masakari-api/masakari-api-paste.ini" dest: "{{ node_config_directory }}/masakari-api/masakari-api-paste.ini"
mode: "0660" mode: "0660"
become: true become: true
when: when: service | service_enabled_and_mapped_to_host
- inventory_hostname in groups[service.group]
- service.enabled | bool
notify: notify:
- Restart masakari-api container - Restart masakari-api container
@ -149,8 +133,7 @@
mode: "0660" mode: "0660"
when: when:
- libvirt_enable_sasl | bool - libvirt_enable_sasl | bool
- inventory_hostname in groups[service.group] - service | service_enabled_and_mapped_to_host
- service.enabled | bool
with_items: with_items:
- { src: "auth.conf.j2", dest: "auth.conf", service: "masakari-instancemonitor" } - { src: "auth.conf.j2", dest: "auth.conf", service: "masakari-instancemonitor" }
notify: notify:

View File

@ -11,7 +11,5 @@
volumes: "{{ service.volumes }}" volumes: "{{ service.volumes }}"
dimensions: "{{ service.dimensions }}" dimensions: "{{ service.dimensions }}"
healthcheck: "{{ service.healthcheck | default(omit) }}" healthcheck: "{{ service.healthcheck | default(omit) }}"
when: when: service | service_enabled_and_mapped_to_host
- inventory_hostname in groups[service.group]
- service.enabled | bool
notify: Restart memcached container notify: Restart memcached container

View File

@ -20,7 +20,5 @@
become: true become: true
with_items: with_items:
- "memcached" - "memcached"
when: when: service | service_enabled_and_mapped_to_host
- inventory_hostname in groups[service.group]
- service.enabled | bool
notify: Restart memcached container notify: Restart memcached container

View File

@ -9,9 +9,6 @@
volumes: "{{ item.value.volumes | reject('equalto', '') | list }}" volumes: "{{ item.value.volumes | reject('equalto', '') | list }}"
dimensions: "{{ item.value.dimensions }}" dimensions: "{{ item.value.dimensions }}"
healthcheck: "{{ item.value.healthcheck | default(omit) }}" healthcheck: "{{ item.value.healthcheck | default(omit) }}"
when: with_dict: "{{ mistral_services | select_services_enabled_and_mapped_to_host }}"
- inventory_hostname in groups[item.value.group]
- item.value.enabled | bool
with_dict: "{{ mistral_services }}"
notify: notify:
- "Restart {{ item.key }} container" - "Restart {{ item.key }} container"

View File

@ -7,10 +7,7 @@
group: "{{ config_owner_group }}" group: "{{ config_owner_group }}"
mode: "0770" mode: "0770"
become: true become: true
when: with_dict: "{{ mistral_services | select_services_enabled_and_mapped_to_host }}"
- inventory_hostname in groups[item.value.group]
- item.value.enabled | bool
with_dict: "{{ mistral_services }}"
- name: Check if policies shall be overwritten - name: Check if policies shall be overwritten
stat: stat:
@ -41,10 +38,7 @@
dest: "{{ node_config_directory }}/{{ item.key }}/config.json" dest: "{{ node_config_directory }}/{{ item.key }}/config.json"
mode: "0660" mode: "0660"
become: true become: true
when: with_dict: "{{ mistral_services | select_services_enabled_and_mapped_to_host }}"
- item.value.enabled | bool
- inventory_hostname in groups[item.value.group]
with_dict: "{{ mistral_services }}"
notify: notify:
- Restart {{ item.key }} container - Restart {{ item.key }} container
@ -61,10 +55,7 @@
dest: "{{ node_config_directory }}/{{ item.key }}/mistral.conf" dest: "{{ node_config_directory }}/{{ item.key }}/mistral.conf"
mode: "0660" mode: "0660"
become: true become: true
when: with_dict: "{{ mistral_services | select_services_enabled_and_mapped_to_host }}"
- item.value.enabled | bool
- inventory_hostname in groups[item.value.group]
with_dict: "{{ mistral_services }}"
notify: notify:
- Restart {{ item.key }} container - Restart {{ item.key }} container
@ -76,9 +67,7 @@
become: true become: true
when: when:
- mistral_policy_file is defined - mistral_policy_file is defined
- inventory_hostname in groups[item.value.group] with_dict: "{{ mistral_services | select_services_enabled_and_mapped_to_host }}"
- item.value.enabled | bool
with_dict: "{{ mistral_services }}"
notify: notify:
- Restart {{ item.key }} container - Restart {{ item.key }} container
@ -90,9 +79,7 @@
src: "{{ item }}" src: "{{ item }}"
dest: "{{ node_config_directory }}/mistral-event-engine/event_definitions.yaml" dest: "{{ node_config_directory }}/mistral-event-engine/event_definitions.yaml"
mode: "0660" mode: "0660"
when: when: service | service_enabled_and_mapped_to_host
- inventory_hostname in groups[service.group]
- service.enabled | bool
with_first_found: with_first_found:
- "{{ node_custom_config }}/mistral/{{ inventory_hostname }}/event_definitions.yaml" - "{{ node_custom_config }}/mistral/{{ inventory_hostname }}/event_definitions.yaml"
- "{{ node_custom_config }}/mistral/event_definitions.yaml" - "{{ node_custom_config }}/mistral/event_definitions.yaml"

View File

@ -9,9 +9,6 @@
ipc_mode: "{{ item.value.ipc_mode }}" ipc_mode: "{{ item.value.ipc_mode }}"
privileged: "{{ item.value.privileged | default(False) }}" privileged: "{{ item.value.privileged | default(False) }}"
volumes: "{{ item.value.volumes }}" volumes: "{{ item.value.volumes }}"
when: with_dict: "{{ multipathd_services | select_services_enabled_and_mapped_to_host }}"
- inventory_hostname in groups[item.value.group]
- item.value.enabled | bool
with_dict: "{{ multipathd_services }}"
notify: notify:
- "Restart {{ item.key }} container" - "Restart {{ item.key }} container"

View File

@ -7,10 +7,7 @@
group: "{{ config_owner_group }}" group: "{{ config_owner_group }}"
mode: "0770" mode: "0770"
become: true become: true
when: with_dict: "{{ multipathd_services | select_services_enabled_and_mapped_to_host }}"
- inventory_hostname in groups[item.value.group]
- item.value.enabled | bool
with_dict: "{{ multipathd_services }}"
- name: Copying over config.json files for services - name: Copying over config.json files for services
template: template:
@ -18,10 +15,7 @@
dest: "{{ node_config_directory }}/{{ item.key }}/config.json" dest: "{{ node_config_directory }}/{{ item.key }}/config.json"
mode: "0660" mode: "0660"
become: true become: true
when: with_dict: "{{ multipathd_services | select_services_enabled_and_mapped_to_host }}"
- inventory_hostname in groups[item.value.group]
- item.value.enabled | bool
with_dict: "{{ multipathd_services }}"
notify: notify:
- Restart multipathd container - Restart multipathd container
@ -37,8 +31,6 @@
- "{{ node_custom_config }}/multipath/{{ inventory_hostname }}/multipath.conf" - "{{ node_custom_config }}/multipath/{{ inventory_hostname }}/multipath.conf"
- "{{ node_custom_config }}/multipath.conf" - "{{ node_custom_config }}/multipath.conf"
- "multipath.conf.j2" - "multipath.conf.j2"
when: when: service | service_enabled_and_mapped_to_host
- inventory_hostname in groups[service.group]
- service.enabled | bool
notify: notify:
- Restart multipathd container - Restart multipathd container

View File

@ -11,9 +11,6 @@
dimensions: "{{ item.value.dimensions }}" dimensions: "{{ item.value.dimensions }}"
environment: "{{ item.value.environment | default(omit) }}" environment: "{{ item.value.environment | default(omit) }}"
healthcheck: "{{ item.value.healthcheck | default(omit) }}" healthcheck: "{{ item.value.healthcheck | default(omit) }}"
when: with_dict: "{{ neutron_services | select_services_enabled_and_mapped_to_host }}"
- item.value.enabled | bool
- item.value.host_in_groups | bool
with_dict: "{{ neutron_services }}"
notify: notify:
- "Restart {{ item.key }} container" - "Restart {{ item.key }} container"

View File

@ -21,7 +21,7 @@
include_role: include_role:
name: sysctl name: sysctl
vars: vars:
neutron_l3_agent: "{{ neutron_services['neutron-l3-agent'] }}" service: "{{ neutron_services['neutron-l3-agent'] }}"
settings: settings:
- { name: "net.ipv4.neigh.default.gc_thresh1", value: "{{ neutron_l3_agent_host_ipv4_neigh_gc_thresh1 }}"} - { name: "net.ipv4.neigh.default.gc_thresh1", value: "{{ neutron_l3_agent_host_ipv4_neigh_gc_thresh1 }}"}
- { name: "net.ipv4.neigh.default.gc_thresh2", value: "{{ neutron_l3_agent_host_ipv4_neigh_gc_thresh2 }}"} - { name: "net.ipv4.neigh.default.gc_thresh2", value: "{{ neutron_l3_agent_host_ipv4_neigh_gc_thresh2 }}"}
@ -31,4 +31,4 @@
- { name: "net.ipv6.neigh.default.gc_thresh3", value: "{{ neutron_l3_agent_host_ipv6_neigh_gc_thresh3 }}"} - { name: "net.ipv6.neigh.default.gc_thresh3", value: "{{ neutron_l3_agent_host_ipv6_neigh_gc_thresh3 }}"}
when: when:
- set_sysctl | bool - set_sysctl | bool
- (neutron_l3_agent.enabled | bool and neutron_l3_agent.host_in_groups | bool) - service | service_enabled_and_mapped_to_host

View File

@ -7,10 +7,7 @@
owner: "{{ config_owner_user }}" owner: "{{ config_owner_user }}"
group: "{{ config_owner_group }}" group: "{{ config_owner_group }}"
mode: "0770" mode: "0770"
when: with_dict: "{{ neutron_services | select_services_enabled_and_mapped_to_host }}"
- item.value.enabled | bool
- item.value.host_in_groups | bool
with_dict: "{{ neutron_services }}"
- name: Check if extra ml2 plugins exists - name: Check if extra ml2 plugins exists
find: find:
@ -26,7 +23,7 @@
- name: Creating TLS backend PEM File - name: Creating TLS backend PEM File
vars: vars:
neutron_tls_proxy: "{{ neutron_services['neutron-tls-proxy'] }}" service: "{{ neutron_services['neutron-tls-proxy'] }}"
assemble: assemble:
src: "{{ node_config_directory }}/neutron-tls-proxy/" src: "{{ node_config_directory }}/neutron-tls-proxy/"
dest: "{{ node_config_directory }}/neutron-tls-proxy/neutron-cert-and-key.pem" dest: "{{ node_config_directory }}/neutron-tls-proxy/neutron-cert-and-key.pem"
@ -34,9 +31,7 @@
regexp: "^neutron-(cert|key)\\.pem$" regexp: "^neutron-(cert|key)\\.pem$"
remote_src: true remote_src: true
become: true become: true
when: when: service | service_enabled_and_mapped_to_host
- neutron_tls_proxy.enabled | bool
- neutron_tls_proxy.host_in_groups | bool
- name: Check if policies shall be overwritten - name: Check if policies shall be overwritten
stat: stat:
@ -65,9 +60,7 @@
become: true become: true
when: when:
- neutron_policy_file is defined - neutron_policy_file is defined
- item.value.enabled | bool with_dict: "{{ neutron_services | select_services_enabled_and_mapped_to_host }}"
- item.value.host_in_groups | bool
with_dict: "{{ neutron_services }}"
notify: notify:
- "Restart {{ item.key }} container" - "Restart {{ item.key }} container"
@ -77,10 +70,7 @@
src: "{{ item.key }}.json.j2" src: "{{ item.key }}.json.j2"
dest: "{{ node_config_directory }}/{{ item.key }}/config.json" dest: "{{ node_config_directory }}/{{ item.key }}/config.json"
mode: "0660" mode: "0660"
when: with_dict: "{{ neutron_services | select_services_enabled_and_mapped_to_host }}"
- item.value.enabled | bool
- item.value.host_in_groups | bool
with_dict: "{{ neutron_services }}"
notify: notify:
- "Restart {{ item.key }} container" - "Restart {{ item.key }} container"
@ -114,10 +104,8 @@
dest: "{{ node_config_directory }}/{{ item.key }}/neutron.conf" dest: "{{ node_config_directory }}/{{ item.key }}/neutron.conf"
mode: "0660" mode: "0660"
when: when:
- item.value.enabled | bool
- item.value.host_in_groups | bool
- item.key in services_need_neutron_conf - item.key in services_need_neutron_conf
with_dict: "{{ neutron_services }}" with_dict: "{{ neutron_services | select_services_enabled_and_mapped_to_host }}"
notify: notify:
- "Restart {{ item.key }} container" - "Restart {{ item.key }} container"
@ -136,24 +124,20 @@
dest: "{{ node_config_directory }}/{{ item.key }}/neutron_vpnaas.conf" dest: "{{ node_config_directory }}/{{ item.key }}/neutron_vpnaas.conf"
mode: "0660" mode: "0660"
when: when:
- item.value.enabled | bool
- item.value.host_in_groups | bool
- item.key in services_need_neutron_vpnaas_conf - item.key in services_need_neutron_vpnaas_conf
with_dict: "{{ neutron_services }}" with_dict: "{{ neutron_services | select_services_enabled_and_mapped_to_host }}"
notify: notify:
- "Restart {{ item.key }} container" - "Restart {{ item.key }} container"
- name: Copying over ssh key - name: Copying over ssh key
become: true become: true
vars: vars:
neutron_server: "{{ neutron_services['neutron-server'] }}" service: "{{ neutron_services['neutron-server'] }}"
template: template:
src: "id_rsa" src: "id_rsa"
dest: "{{ node_config_directory }}/neutron-server/id_rsa" dest: "{{ node_config_directory }}/neutron-server/id_rsa"
mode: 0600 mode: 0600
when: when: service | service_enabled_and_mapped_to_host
- neutron_server.enabled | bool
- neutron_server.host_in_groups | bool
- name: Copying over ml2_conf.ini - name: Copying over ml2_conf.ini
become: true become: true
@ -171,9 +155,7 @@
mode: "0660" mode: "0660"
when: when:
- item.key in services_need_ml2_conf_ini - item.key in services_need_ml2_conf_ini
- item.value.enabled | bool with_dict: "{{ neutron_services | select_services_enabled_and_mapped_to_host }}"
- item.value.host_in_groups | bool
with_dict: "{{ neutron_services }}"
notify: notify:
- "Restart {{ item.key }} container" - "Restart {{ item.key }} container"
@ -181,6 +163,7 @@
become: true become: true
vars: vars:
service_name: "neutron-linuxbridge-agent" service_name: "neutron-linuxbridge-agent"
service: "{{ neutron_services[service_name] }}"
merge_configs: merge_configs:
sources: sources:
- "{{ role_path }}/templates/linuxbridge_agent.ini.j2" - "{{ role_path }}/templates/linuxbridge_agent.ini.j2"
@ -188,9 +171,7 @@
- "{{ node_custom_config }}/neutron/{{ inventory_hostname }}/linuxbridge_agent.ini" - "{{ node_custom_config }}/neutron/{{ inventory_hostname }}/linuxbridge_agent.ini"
dest: "{{ node_config_directory }}/{{ service_name }}/linuxbridge_agent.ini" dest: "{{ node_config_directory }}/{{ service_name }}/linuxbridge_agent.ini"
mode: "0660" mode: "0660"
when: when: service | service_enabled_and_mapped_to_host
- neutron_services[service_name].enabled | bool
- neutron_services[service_name].host_in_groups | bool
notify: notify:
- "Restart {{ service_name }} container" - "Restart {{ service_name }} container"
@ -198,6 +179,7 @@
become: true become: true
vars: vars:
service_name: "neutron-openvswitch-agent" service_name: "neutron-openvswitch-agent"
service: "{{ neutron_services[service_name] }}"
merge_configs: merge_configs:
sources: sources:
- "{{ role_path }}/templates/openvswitch_agent.ini.j2" - "{{ role_path }}/templates/openvswitch_agent.ini.j2"
@ -205,9 +187,7 @@
- "{{ node_custom_config }}/neutron/{{ inventory_hostname }}/openvswitch_agent.ini" - "{{ node_custom_config }}/neutron/{{ inventory_hostname }}/openvswitch_agent.ini"
dest: "{{ node_config_directory }}/{{ service_name }}/openvswitch_agent.ini" dest: "{{ node_config_directory }}/{{ service_name }}/openvswitch_agent.ini"
mode: "0660" mode: "0660"
when: when: service | service_enabled_and_mapped_to_host
- neutron_services[service_name].enabled | bool
- neutron_services[service_name].host_in_groups | bool
notify: notify:
- "Restart {{ service_name }} container" - "Restart {{ service_name }} container"
@ -215,7 +195,7 @@
become: true become: true
vars: vars:
service_name: "neutron-sriov-agent" service_name: "neutron-sriov-agent"
neutron_sriov_agent: "{{ neutron_services[service_name] }}" service: "{{ neutron_services[service_name] }}"
merge_configs: merge_configs:
sources: sources:
- "{{ role_path }}/templates/sriov_agent.ini.j2" - "{{ role_path }}/templates/sriov_agent.ini.j2"
@ -223,9 +203,7 @@
- "{{ node_custom_config }}/neutron/{{ inventory_hostname }}/sriov_agent.ini" - "{{ node_custom_config }}/neutron/{{ inventory_hostname }}/sriov_agent.ini"
dest: "{{ node_config_directory }}/{{ service_name }}/sriov_agent.ini" dest: "{{ node_config_directory }}/{{ service_name }}/sriov_agent.ini"
mode: "0660" mode: "0660"
when: when: service | service_enabled_and_mapped_to_host
- neutron_sriov_agent.enabled | bool
- neutron_sriov_agent.host_in_groups | bool
notify: notify:
- "Restart {{ service_name }} container" - "Restart {{ service_name }} container"
@ -233,7 +211,7 @@
become: true become: true
vars: vars:
service_name: "neutron-mlnx-agent" service_name: "neutron-mlnx-agent"
neutron_mlnx_agent: "{{ neutron_services[service_name] }}" service: "{{ neutron_services[service_name] }}"
merge_configs: merge_configs:
sources: sources:
- "{{ role_path }}/templates/mlnx_agent.ini.j2" - "{{ role_path }}/templates/mlnx_agent.ini.j2"
@ -241,9 +219,7 @@
- "{{ node_custom_config }}/neutron/{{ inventory_hostname }}/mlnx_agent.ini" - "{{ node_custom_config }}/neutron/{{ inventory_hostname }}/mlnx_agent.ini"
dest: "{{ node_config_directory }}/{{ service_name }}/mlnx_agent.ini" dest: "{{ node_config_directory }}/{{ service_name }}/mlnx_agent.ini"
mode: "0660" mode: "0660"
when: when: service | service_enabled_and_mapped_to_host
- neutron_mlnx_agent.enabled | bool
- neutron_mlnx_agent.host_in_groups | bool
notify: notify:
- "Restart {{ service_name }} container" - "Restart {{ service_name }} container"
@ -251,7 +227,7 @@
become: true become: true
vars: vars:
service_name: "neutron-eswitchd" service_name: "neutron-eswitchd"
neutron_eswitchd: "{{ neutron_services[service_name] }}" service: "{{ neutron_services[service_name] }}"
merge_configs: merge_configs:
sources: sources:
- "{{ role_path }}/templates/eswitchd.conf.j2" - "{{ role_path }}/templates/eswitchd.conf.j2"
@ -259,9 +235,7 @@
- "{{ node_custom_config }}/neutron/{{ inventory_hostname }}/eswitchd.conf" - "{{ node_custom_config }}/neutron/{{ inventory_hostname }}/eswitchd.conf"
dest: "{{ node_config_directory }}/{{ service_name }}/eswitchd.conf" dest: "{{ node_config_directory }}/{{ service_name }}/eswitchd.conf"
mode: "0660" mode: "0660"
when: when: service | service_enabled_and_mapped_to_host
- neutron_eswitchd.enabled | bool
- neutron_eswitchd.host_in_groups | bool
notify: notify:
- "Restart {{ service_name }} container" - "Restart {{ service_name }} container"
@ -269,7 +243,7 @@
become: true become: true
vars: vars:
service_name: "neutron-dhcp-agent" service_name: "neutron-dhcp-agent"
neutron_dhcp_agent: "{{ neutron_services[service_name] }}" service: "{{ neutron_services[service_name] }}"
merge_configs: merge_configs:
sources: sources:
- "{{ role_path }}/templates/dhcp_agent.ini.j2" - "{{ role_path }}/templates/dhcp_agent.ini.j2"
@ -277,9 +251,7 @@
- "{{ node_custom_config }}/neutron/{{ inventory_hostname }}/dhcp_agent.ini" - "{{ node_custom_config }}/neutron/{{ inventory_hostname }}/dhcp_agent.ini"
dest: "{{ node_config_directory }}/{{ service_name }}/dhcp_agent.ini" dest: "{{ node_config_directory }}/{{ service_name }}/dhcp_agent.ini"
mode: "0660" mode: "0660"
when: when: service | service_enabled_and_mapped_to_host
- neutron_dhcp_agent.enabled | bool
- neutron_dhcp_agent.host_in_groups | bool
notify: notify:
- "Restart {{ service_name }} container" - "Restart {{ service_name }} container"
@ -287,7 +259,7 @@
become: true become: true
vars: vars:
service_name: "neutron-dhcp-agent" service_name: "neutron-dhcp-agent"
neutron_dhcp_agent: "{{ neutron_services[service_name] }}" service: "{{ neutron_services[service_name] }}"
template: template:
src: "{{ item }}" src: "{{ item }}"
dest: "{{ node_config_directory }}/{{ service_name }}/dnsmasq.conf" dest: "{{ node_config_directory }}/{{ service_name }}/dnsmasq.conf"
@ -296,9 +268,7 @@
- "{{ node_custom_config }}/neutron/{{ inventory_hostname }}/dnsmasq.conf" - "{{ node_custom_config }}/neutron/{{ inventory_hostname }}/dnsmasq.conf"
- "{{ node_custom_config }}/neutron/dnsmasq.conf" - "{{ node_custom_config }}/neutron/dnsmasq.conf"
- "dnsmasq.conf.j2" - "dnsmasq.conf.j2"
when: when: service | service_enabled_and_mapped_to_host
- neutron_dhcp_agent.enabled | bool
- neutron_dhcp_agent.host_in_groups | bool
notify: notify:
- "Restart {{ service_name }} container" - "Restart {{ service_name }} container"
@ -317,9 +287,7 @@
mode: "0660" mode: "0660"
when: when:
- item.key in services_need_l3_agent_ini - item.key in services_need_l3_agent_ini
- item.value.enabled | bool with_dict: "{{ neutron_services | select_services_enabled_and_mapped_to_host }}"
- item.value.host_in_groups | bool
with_dict: "{{ neutron_services }}"
notify: notify:
- "Restart {{ item.key }} container" - "Restart {{ item.key }} container"
@ -339,9 +307,7 @@
when: when:
- enable_neutron_fwaas | bool - enable_neutron_fwaas | bool
- item.key in services_need_fwaas_driver_ini - item.key in services_need_fwaas_driver_ini
- item.value.enabled | bool with_dict: "{{ neutron_services | select_services_enabled_and_mapped_to_host }}"
- item.value.host_in_groups | bool
with_dict: "{{ neutron_services }}"
notify: notify:
- "Restart {{ item.key }} container" - "Restart {{ item.key }} container"
@ -349,16 +315,14 @@
become: true become: true
vars: vars:
service_name: "neutron-metadata-agent" service_name: "neutron-metadata-agent"
neutron_metadata_agent: "{{ neutron_services[service_name] }}" service: "{{ neutron_services[service_name] }}"
merge_configs: merge_configs:
sources: sources:
- "{{ role_path }}/templates/metadata_agent.ini.j2" - "{{ role_path }}/templates/metadata_agent.ini.j2"
- "{{ node_custom_config }}/neutron/metadata_agent.ini" - "{{ node_custom_config }}/neutron/metadata_agent.ini"
dest: "{{ node_config_directory }}/{{ service_name }}/metadata_agent.ini" dest: "{{ node_config_directory }}/{{ service_name }}/metadata_agent.ini"
mode: "0660" mode: "0660"
when: when: service | service_enabled_and_mapped_to_host
- neutron_metadata_agent.enabled | bool
- neutron_metadata_agent.host_in_groups | bool
notify: notify:
- "Restart {{ service_name }} container" - "Restart {{ service_name }} container"
@ -366,16 +330,14 @@
become: true become: true
vars: vars:
service_name: "neutron-ovn-metadata-agent" service_name: "neutron-ovn-metadata-agent"
neutron_ovn_metadata_agent: "{{ neutron_services[service_name] }}" service: "{{ neutron_services[service_name] }}"
merge_configs: merge_configs:
sources: sources:
- "{{ role_path }}/templates/neutron_ovn_metadata_agent.ini.j2" - "{{ role_path }}/templates/neutron_ovn_metadata_agent.ini.j2"
- "{{ node_custom_config }}/neutron/neutron_ovn_metadata_agent.ini" - "{{ node_custom_config }}/neutron/neutron_ovn_metadata_agent.ini"
dest: "{{ node_config_directory }}/{{ service_name }}/neutron_ovn_metadata_agent.ini" dest: "{{ node_config_directory }}/{{ service_name }}/neutron_ovn_metadata_agent.ini"
mode: "0660" mode: "0660"
when: when: service | service_enabled_and_mapped_to_host
- neutron_ovn_metadata_agent.enabled | bool
- neutron_ovn_metadata_agent.host_in_groups | bool
notify: notify:
- "Restart {{ service_name }} container" - "Restart {{ service_name }} container"
@ -383,16 +345,14 @@
become: true become: true
vars: vars:
service_name: "neutron-metering-agent" service_name: "neutron-metering-agent"
neutron_metering_agent: "{{ neutron_services[service_name] }}" service: "{{ neutron_services[service_name] }}"
merge_configs: merge_configs:
sources: sources:
- "{{ role_path }}/templates/metering_agent.ini.j2" - "{{ role_path }}/templates/metering_agent.ini.j2"
- "{{ node_custom_config }}/neutron/metering_agent.ini" - "{{ node_custom_config }}/neutron/metering_agent.ini"
dest: "{{ node_config_directory }}/{{ service_name }}/metering_agent.ini" dest: "{{ node_config_directory }}/{{ service_name }}/metering_agent.ini"
mode: "0660" mode: "0660"
when: when: service | service_enabled_and_mapped_to_host
- neutron_metering_agent.enabled | bool
- neutron_metering_agent.host_in_groups | bool
notify: notify:
- "Restart {{ service_name }} container" - "Restart {{ service_name }} container"
@ -400,16 +360,14 @@
become: true become: true
vars: vars:
service_name: "ironic-neutron-agent" service_name: "ironic-neutron-agent"
ironic_neutron_agent: "{{ neutron_services[service_name] }}" service: "{{ neutron_services[service_name] }}"
merge_configs: merge_configs:
sources: sources:
- "{{ role_path }}/templates/ironic_neutron_agent.ini.j2" - "{{ role_path }}/templates/ironic_neutron_agent.ini.j2"
- "{{ node_custom_config }}/neutron/ironic_neutron_agent.ini" - "{{ node_custom_config }}/neutron/ironic_neutron_agent.ini"
dest: "{{ node_config_directory }}/{{ service_name }}/ironic_neutron_agent.ini" dest: "{{ node_config_directory }}/{{ service_name }}/ironic_neutron_agent.ini"
mode: "0660" mode: "0660"
when: when: service | service_enabled_and_mapped_to_host
- ironic_neutron_agent.enabled | bool
- ironic_neutron_agent.host_in_groups | bool
notify: notify:
- "Restart {{ service_name }} container" - "Restart {{ service_name }} container"
@ -417,16 +375,14 @@
become: true become: true
vars: vars:
service_name: "neutron-bgp-dragent" service_name: "neutron-bgp-dragent"
neutron_bgp_dragent: "{{ neutron_services[service_name] }}" service: "{{ neutron_services[service_name] }}"
merge_configs: merge_configs:
sources: sources:
- "{{ role_path }}/templates/bgp_dragent.ini.j2" - "{{ role_path }}/templates/bgp_dragent.ini.j2"
- "{{ node_custom_config }}/neutron/bgp_dragent.ini" - "{{ node_custom_config }}/neutron/bgp_dragent.ini"
dest: "{{ node_config_directory }}/{{ service_name }}/bgp_dragent.ini" dest: "{{ node_config_directory }}/{{ service_name }}/bgp_dragent.ini"
mode: "0660" mode: "0660"
when: when: service | service_enabled_and_mapped_to_host
- neutron_bgp_dragent.enabled | bool
- neutron_bgp_dragent.host_in_groups | bool
notify: notify:
- "Restart {{ service_name }} container" - "Restart {{ service_name }} container"
@ -434,16 +390,14 @@
become: true become: true
vars: vars:
service_name: "neutron-ovn-agent" service_name: "neutron-ovn-agent"
neutron_ovn_agent: "{{ neutron_services[service_name] }}" service: "{{ neutron_services[service_name] }}"
merge_configs: merge_configs:
sources: sources:
- "{{ role_path }}/templates/ovn_agent.ini.j2" - "{{ role_path }}/templates/ovn_agent.ini.j2"
- "{{ node_custom_config }}/neutron/ovn_agent.ini" - "{{ node_custom_config }}/neutron/ovn_agent.ini"
dest: "{{ node_config_directory }}/{{ service_name }}/ovn_agent.ini" dest: "{{ node_config_directory }}/{{ service_name }}/ovn_agent.ini"
mode: "0660" mode: "0660"
when: when: service | service_enabled_and_mapped_to_host
- neutron_ovn_agent.enabled | bool
- neutron_ovn_agent.host_in_groups | bool
notify: notify:
- "Restart {{ service_name }} container" - "Restart {{ service_name }} container"
@ -451,7 +405,7 @@
become: true become: true
vars: vars:
service_name: "neutron-server" service_name: "neutron-server"
neutron_server: "{{ neutron_services[service_name] }}" service: "{{ neutron_services[service_name] }}"
merge_configs: merge_configs:
sources: sources:
- "{{ role_path }}/templates/nsx.ini.j2" - "{{ role_path }}/templates/nsx.ini.j2"
@ -460,8 +414,7 @@
dest: "{{ node_config_directory }}/{{ service_name }}/nsx.ini" dest: "{{ node_config_directory }}/{{ service_name }}/nsx.ini"
mode: "0660" mode: "0660"
when: when:
- neutron_server.enabled | bool - service | service_enabled_and_mapped_to_host
- neutron_server.host_in_groups | bool
- neutron_plugin_agent in ['vmware_nsxv', 'vmware_nsxv3', 'vmware_nsxp', 'vmware_dvs'] - neutron_plugin_agent in ['vmware_nsxv', 'vmware_nsxv3', 'vmware_nsxp', 'vmware_dvs']
notify: notify:
- "Restart {{ service_name }} container" - "Restart {{ service_name }} container"
@ -475,9 +428,7 @@
src: neutron-l3-agent-wrapper.sh.j2 src: neutron-l3-agent-wrapper.sh.j2
dest: "{{ node_config_directory }}/{{ service_name }}/neutron-l3-agent-wrapper.sh" dest: "{{ node_config_directory }}/{{ service_name }}/neutron-l3-agent-wrapper.sh"
mode: "0770" mode: "0770"
when: when: service | service_enabled_and_mapped_to_host
- service.enabled | bool
- service.host_in_groups | bool
notify: notify:
- "Restart {{ service_name }} container" - "Restart {{ service_name }} container"
@ -506,7 +457,7 @@
- name: Copying over neutron-tls-proxy.cfg - name: Copying over neutron-tls-proxy.cfg
vars: vars:
neutron_tls_proxy: "{{ neutron_services['neutron-tls-proxy'] }}" service: "{{ neutron_services['neutron-tls-proxy'] }}"
template: template:
src: "{{ item }}" src: "{{ item }}"
dest: "{{ node_config_directory }}/neutron-tls-proxy/neutron-tls-proxy.cfg" dest: "{{ node_config_directory }}/neutron-tls-proxy/neutron-tls-proxy.cfg"
@ -516,9 +467,7 @@
- "{{ node_custom_config }}/neutron/{{ inventory_hostname }}/neutron-tls-proxy.cfg" - "{{ node_custom_config }}/neutron/{{ inventory_hostname }}/neutron-tls-proxy.cfg"
- "{{ node_custom_config }}/neutron/neutron-tls-proxy.cfg" - "{{ node_custom_config }}/neutron/neutron-tls-proxy.cfg"
- "neutron-tls-proxy.cfg.j2" - "neutron-tls-proxy.cfg.j2"
when: when: service | service_enabled_and_mapped_to_host
- neutron_tls_proxy.enabled | bool
- neutron_tls_proxy.host_in_groups | bool
notify: notify:
- Restart neutron-tls-proxy container - Restart neutron-tls-proxy container
@ -538,9 +487,7 @@
mode: "0660" mode: "0660"
when: when:
- enable_neutron_taas | bool - enable_neutron_taas | bool
- item.value.enabled | bool
- item.value.host_in_groups | bool
- item.key in services_need_neutron_taas_conf - item.key in services_need_neutron_taas_conf
with_dict: "{{ neutron_services }}" with_dict: "{{ neutron_services | select_services_enabled_and_mapped_to_host }}"
notify: notify:
- "Restart {{ item.key }} container" - "Restart {{ item.key }} container"

View File

@ -45,8 +45,8 @@
- name: Stopping all neutron-server for contract db - name: Stopping all neutron-server for contract db
vars: vars:
neutron_server: "{{ neutron_services['neutron-server'] }}" service: "{{ neutron_services['neutron-server'] }}"
first_neutron_server_host: "{{ groups[neutron_server.group][0] }}" first_neutron_server_host: "{{ groups[service.group][0] }}"
results_of_check_pending_contract_scripts: "{{ hostvars[first_neutron_server_host]['neutron_check_contract_db_stdout'] }}" results_of_check_pending_contract_scripts: "{{ hostvars[first_neutron_server_host]['neutron_check_contract_db_stdout'] }}"
# NOTE(hrw): no idea # NOTE(hrw): no idea
filter_rc: "results[?rc!=`0`]" filter_rc: "results[?rc!=`0`]"
@ -55,9 +55,9 @@
kolla_container: kolla_container:
action: "stop_container" action: "stop_container"
common_options: "{{ docker_common_options }}" common_options: "{{ docker_common_options }}"
name: "{{ neutron_server.container_name }}" name: "{{ service.container_name }}"
when: when:
- neutron_server.host_in_groups | bool - service.host_in_groups | bool
- is_stop_neutron_server | length > 0 - is_stop_neutron_server | length > 0
notify: notify:
- "Restart neutron-server container" - "Restart neutron-server container"

View File

@ -14,9 +14,6 @@
volumes: "{{ item.value.volumes | reject('equalto', '') | list }}" volumes: "{{ item.value.volumes | reject('equalto', '') | list }}"
dimensions: "{{ item.value.dimensions }}" dimensions: "{{ item.value.dimensions }}"
healthcheck: "{{ item.value.healthcheck | default(omit) }}" healthcheck: "{{ item.value.healthcheck | default(omit) }}"
when: with_dict: "{{ nova_cell_services | select_services_enabled_and_mapped_to_host }}"
- inventory_hostname in groups[item.value.group]
- item.value.enabled | bool
with_dict: "{{ nova_cell_services }}"
notify: notify:
- "Restart {{ item.key }} container" - "Restart {{ item.key }} container"

View File

@ -1,46 +1,29 @@
--- ---
- name: Copying over libvirt TLS keys (nova-libvirt) - name: Copying over libvirt TLS keys to services
become: true become: true
vars: vars:
service: "{{ nova_cell_services['nova-libvirt'] }}" services:
service_name: nova-libvirt - "nova-compute"
paths: - "nova-libvirt"
- "{{ node_custom_config }}/nova/nova-libvirt/{{ inventory_hostname }}/{{ item }}" key_files:
- "{{ node_custom_config }}/nova/nova-libvirt/{{ item }}"
copy:
src: "{{ lookup('first_found', paths) }}"
dest: "{{ node_config_directory }}/{{ service_name }}/{{ item }}"
mode: "0600"
when:
- inventory_hostname in groups[service.group]
- service.enabled | bool
with_items:
- cacert.pem - cacert.pem
- clientcert.pem
- clientkey.pem
- servercert.pem - servercert.pem
- serverkey.pem - serverkey.pem
- clientcert.pem service_name: "{{ item[0] }}"
- clientkey.pem filename: "{{ item[1] }}"
notify:
- Restart {{ service_name }} container
- name: Copying over libvirt TLS keys (nova-compute)
become: true
vars:
service: "{{ nova_cell_services['nova-compute'] }}"
service_name: nova-compute
paths: paths:
- "{{ node_custom_config }}/nova/nova-libvirt/{{ inventory_hostname }}/{{ item }}" - "{{ node_custom_config }}/nova/nova-libvirt/{{ inventory_hostname }}/{{ filename }}"
- "{{ node_custom_config }}/nova/nova-libvirt/{{ item }}" - "{{ node_custom_config }}/nova/nova-libvirt/{{ filename }}"
service: "{{ nova_cell_services[service_name] }}"
copy: copy:
src: "{{ lookup('first_found', paths) }}" src: "{{ lookup('first_found', paths) }}"
dest: "{{ node_config_directory }}/{{ service_name }}/{{ item }}" dest: "{{ node_config_directory }}/{{ service_name }}/{{ filename }}"
mode: "0600" mode: "0600"
when: when:
- inventory_hostname in groups[service.group] - service | service_enabled_and_mapped_to_host
- service.enabled | bool - not (service_name == 'nova-compute' and (filename == 'servercert.pem' or filename == 'serverkey.pem'))
with_items: loop: "{{ services | product(key_files) | list }}"
- cacert.pem
- clientcert.pem
- clientkey.pem
notify: notify:
- Restart {{service_name }} container - Restart {{service_name }} container

View File

@ -7,10 +7,7 @@
owner: "{{ config_owner_user }}" owner: "{{ config_owner_user }}"
group: "{{ config_owner_group }}" group: "{{ config_owner_group }}"
mode: "0770" mode: "0770"
when: with_dict: "{{ nova_cell_services | select_services_enabled_and_mapped_to_host }}"
- inventory_hostname in groups[item.value.group]
- item.value.enabled | bool
with_dict: "{{ nova_cell_services }}"
- include_tasks: copy-certs.yml - include_tasks: copy-certs.yml
when: when:
@ -59,10 +56,7 @@
src: "{{ item.key }}.json.j2" src: "{{ item.key }}.json.j2"
dest: "{{ node_config_directory }}/{{ item.key }}/config.json" dest: "{{ node_config_directory }}/{{ item.key }}/config.json"
mode: "0660" mode: "0660"
when: with_dict: "{{ nova_cell_services | select_services_enabled_and_mapped_to_host }}"
- inventory_hostname in groups[item.value.group]
- item.value.enabled | bool
with_dict: "{{ nova_cell_services }}"
notify: notify:
- "Restart {{ item.key }} container" - "Restart {{ item.key }} container"
@ -81,10 +75,8 @@
dest: "{{ node_config_directory }}/{{ item.key }}/nova.conf" dest: "{{ node_config_directory }}/{{ item.key }}/nova.conf"
mode: "0660" mode: "0660"
when: when:
- inventory_hostname in groups[item.value.group]
- item.value.enabled | bool
- item.key in nova_cell_services_require_nova_conf - item.key in nova_cell_services_require_nova_conf
with_dict: "{{ nova_cell_services }}" with_dict: "{{ nova_cell_services | select_services_enabled_and_mapped_to_host }}"
notify: notify:
- "Restart {{ item.key }} container" - "Restart {{ item.key }} container"
@ -97,9 +89,8 @@
dest: "{{ node_config_directory }}/nova-compute/provider_config.yaml" dest: "{{ node_config_directory }}/nova-compute/provider_config.yaml"
mode: "0660" mode: "0660"
when: when:
- inventory_hostname in groups[service.group] - service | service_enabled_and_mapped_to_host
- nova_cell_compute_provider_config is defined - nova_cell_compute_provider_config is defined
- service.enabled | bool
notify: notify:
- Restart nova-compute container - Restart nova-compute container
@ -111,9 +102,7 @@
src: "{{ item.src }}" src: "{{ item.src }}"
dest: "{{ node_config_directory }}/nova-libvirt/{{ item.dest }}" dest: "{{ node_config_directory }}/nova-libvirt/{{ item.dest }}"
mode: "0660" mode: "0660"
when: when: service | service_enabled_and_mapped_to_host
- inventory_hostname in groups[service.group]
- service.enabled | bool
with_items: with_items:
- { src: "qemu.conf.j2", dest: "qemu.conf" } - { src: "qemu.conf.j2", dest: "qemu.conf" }
- { src: "libvirtd.conf.j2", dest: "libvirtd.conf" } - { src: "libvirtd.conf.j2", dest: "libvirtd.conf" }
@ -138,8 +127,7 @@
mode: "0660" mode: "0660"
when: when:
- libvirt_enable_sasl | bool - libvirt_enable_sasl | bool
- inventory_hostname in groups[service.group] - service | service_enabled_and_mapped_to_host
- service.enabled | bool
with_items: with_items:
- { src: "auth.conf.j2", dest: "auth.conf", service: "nova-compute" } - { src: "auth.conf.j2", dest: "auth.conf", service: "nova-compute" }
- { src: "auth.conf.j2", dest: "auth.conf", service: "nova-libvirt" } - { src: "auth.conf.j2", dest: "auth.conf", service: "nova-libvirt" }
@ -155,9 +143,7 @@
src: "{{ item.src }}" src: "{{ item.src }}"
dest: "{{ node_config_directory }}/nova-ssh/{{ item.dest }}" dest: "{{ node_config_directory }}/nova-ssh/{{ item.dest }}"
mode: "0660" mode: "0660"
when: when: service | service_enabled_and_mapped_to_host
- inventory_hostname in groups[service.group]
- service.enabled | bool
with_items: with_items:
- { src: "sshd_config.j2", dest: "sshd_config" } - { src: "sshd_config.j2", dest: "sshd_config" }
- { src: "id_rsa", dest: "id_rsa" } - { src: "id_rsa", dest: "id_rsa" }
@ -176,8 +162,7 @@
when: when:
- nova_compute_virt_type == "vmware" - nova_compute_virt_type == "vmware"
- not vmware_vcenter_insecure | bool - not vmware_vcenter_insecure | bool
- inventory_hostname in groups[service.group] - service | service_enabled_and_mapped_to_host
- service.enabled | bool
notify: notify:
- Restart nova-compute container - Restart nova-compute container
@ -194,9 +179,7 @@
- "{{ node_custom_config }}/nova_compute/release" - "{{ node_custom_config }}/nova_compute/release"
- "{{ node_custom_config }}/nova/release" - "{{ node_custom_config }}/nova/release"
skip: true skip: true
when: when: service | service_enabled_and_mapped_to_host
- inventory_hostname in groups[service.group]
- service.enabled | bool
notify: notify:
- Restart nova-compute container - Restart nova-compute container
@ -209,9 +192,7 @@
dest: "{{ node_config_directory }}/nova-compute/hostnqn" dest: "{{ node_config_directory }}/nova-compute/hostnqn"
mode: "0660" mode: "0660"
become: true become: true
when: when: service | service_enabled_and_mapped_to_host
- inventory_hostname in groups[service.group]
- service.enabled | bool
notify: notify:
- Restart nova-compute container - Restart nova-compute container
@ -222,11 +203,9 @@
dest: "{{ node_config_directory }}/{{ item.key }}/{{ nova_policy_file }}" dest: "{{ node_config_directory }}/{{ item.key }}/{{ nova_policy_file }}"
mode: "0660" mode: "0660"
when: when:
- inventory_hostname in groups[item.value.group]
- item.value.enabled | bool
- nova_policy_file is defined - nova_policy_file is defined
- item.key in nova_cell_services_require_policy_json - item.key in nova_cell_services_require_policy_json
with_dict: "{{ nova_cell_services }}" with_dict: "{{ nova_cell_services | select_services_enabled_and_mapped_to_host }}"
notify: notify:
- "Restart {{ item.key }} container" - "Restart {{ item.key }} container"
@ -240,8 +219,7 @@
become: True become: True
when: when:
- vendordata_file_path is defined - vendordata_file_path is defined
- inventory_hostname in groups[service.group] - service | service_enabled_and_mapped_to_host
- service.enabled | bool
notify: notify:
- "Restart {{ item }} container" - "Restart {{ item }} container"
with_items: with_items:

View File

@ -98,8 +98,7 @@
- nova-compute - nova-compute
- nova-libvirt - nova-libvirt
when: when:
- inventory_hostname in groups[service.group] - service | service_enabled_and_mapped_to_host
- service.enabled | bool
- nova_backend == "rbd" - nova_backend == "rbd"
notify: notify:
- Restart {{ item }} container - Restart {{ item }} container
@ -146,8 +145,7 @@
group: "{{ config_owner_group }}" group: "{{ config_owner_group }}"
mode: "0770" mode: "0770"
become: true become: true
when: when: service | service_enabled_and_mapped_to_host
- inventory_hostname in groups[service.group]
- name: Pushing nova secret xml for libvirt - name: Pushing nova secret xml for libvirt
vars: vars:
@ -159,9 +157,7 @@
group: "{{ config_owner_group }}" group: "{{ config_owner_group }}"
mode: "0600" mode: "0600"
become: true become: true
when: when: service | service_enabled_and_mapped_to_host
- inventory_hostname in groups[service.group]
- item.enabled | bool
with_items: with_items:
- uuid: "{{ rbd_secret_uuid }}" - uuid: "{{ rbd_secret_uuid }}"
name: "client.nova secret" name: "client.nova secret"
@ -182,7 +178,7 @@
mode: "0600" mode: "0600"
become: true become: true
when: when:
- inventory_hostname in groups[service.group] - service | service_enabled_and_mapped_to_host
- item.enabled | bool - item.enabled | bool
- external_ceph_cephx_enabled | bool - external_ceph_cephx_enabled | bool
with_items: with_items:

View File

@ -30,7 +30,7 @@
- name: Checking free port for Nova NoVNC Proxy - name: Checking free port for Nova NoVNC Proxy
vars: vars:
nova_novncproxy: "{{ nova_cell_services['nova-novncproxy'] }}" service: "{{ nova_cell_services['nova-novncproxy'] }}"
wait_for: wait_for:
host: "{{ api_interface_address }}" host: "{{ api_interface_address }}"
port: "{{ nova_novncproxy_listen_port }}" port: "{{ nova_novncproxy_listen_port }}"
@ -39,12 +39,11 @@
state: stopped state: stopped
when: when:
- container_facts['nova_novncproxy'] is not defined - container_facts['nova_novncproxy'] is not defined
- nova_novncproxy.enabled | bool - service | service_enabled_and_mapped_to_host
- inventory_hostname in groups[nova_novncproxy.group]
- name: Checking free port for Nova Serial Proxy - name: Checking free port for Nova Serial Proxy
vars: vars:
nova_serialproxy: "{{ nova_cell_services['nova-serialproxy'] }}" service: "{{ nova_cell_services['nova-serialproxy'] }}"
wait_for: wait_for:
host: "{{ api_interface_address }}" host: "{{ api_interface_address }}"
port: "{{ nova_serialproxy_listen_port }}" port: "{{ nova_serialproxy_listen_port }}"
@ -53,12 +52,11 @@
state: stopped state: stopped
when: when:
- container_facts['nova_serialproxy'] is not defined - container_facts['nova_serialproxy'] is not defined
- nova_serialproxy.enabled | bool - service | service_enabled_and_mapped_to_host
- inventory_hostname in groups[nova_serialproxy.group]
- name: Checking free port for Nova Spice HTML5 Proxy - name: Checking free port for Nova Spice HTML5 Proxy
vars: vars:
nova_spicehtml5proxy: "{{ nova_cell_services['nova-spicehtml5proxy'] }}" service: "{{ nova_cell_services['nova-spicehtml5proxy'] }}"
wait_for: wait_for:
host: "{{ api_interface_address }}" host: "{{ api_interface_address }}"
port: "{{ nova_spicehtml5proxy_listen_port }}" port: "{{ nova_spicehtml5proxy_listen_port }}"
@ -67,12 +65,11 @@
state: stopped state: stopped
when: when:
- container_facts['nova_spicehtml5proxy'] is not defined - container_facts['nova_spicehtml5proxy'] is not defined
- nova_spicehtml5proxy.enabled | bool - service | service_enabled_and_mapped_to_host
- inventory_hostname in groups[nova_spicehtml5proxy.group]
- name: Checking free port for Nova SSH (API interface) - name: Checking free port for Nova SSH (API interface)
vars: vars:
nova_ssh: "{{ nova_cell_services['nova-ssh'] }}" service: "{{ nova_cell_services['nova-ssh'] }}"
wait_for: wait_for:
host: "{{ api_interface_address }}" host: "{{ api_interface_address }}"
port: "{{ nova_ssh_port }}" port: "{{ nova_ssh_port }}"
@ -81,12 +78,11 @@
state: stopped state: stopped
when: when:
- container_facts['nova_ssh'] is not defined - container_facts['nova_ssh'] is not defined
- nova_ssh.enabled | bool - service | service_enabled_and_mapped_to_host
- inventory_hostname in groups[nova_ssh.group]
- name: Checking free port for Nova SSH (migration interface) - name: Checking free port for Nova SSH (migration interface)
vars: vars:
nova_ssh: "{{ nova_cell_services['nova-ssh'] }}" service: "{{ nova_cell_services['nova-ssh'] }}"
wait_for: wait_for:
host: "{{ migration_interface_address }}" host: "{{ migration_interface_address }}"
port: "{{ nova_ssh_port }}" port: "{{ nova_ssh_port }}"
@ -96,12 +92,11 @@
when: when:
- migration_interface_address != api_interface_address - migration_interface_address != api_interface_address
- container_facts['nova_ssh'] is not defined - container_facts['nova_ssh'] is not defined
- nova_ssh.enabled | bool - service | service_enabled_and_mapped_to_host
- inventory_hostname in groups[nova_ssh.group]
- name: Checking free port for Nova Libvirt - name: Checking free port for Nova Libvirt
vars: vars:
nova_libvirt: "{{ nova_cell_services['nova-libvirt'] }}" service: "{{ nova_cell_services['nova-libvirt'] }}"
wait_for: wait_for:
host: "{{ api_interface_address }}" host: "{{ api_interface_address }}"
port: "{{ nova_libvirt_port }}" port: "{{ nova_libvirt_port }}"
@ -110,19 +105,17 @@
state: stopped state: stopped
when: when:
- container_facts['nova_libvirt'] is not defined - container_facts['nova_libvirt'] is not defined
- nova_libvirt.enabled | bool - service | service_enabled_and_mapped_to_host
- inventory_hostname in groups[nova_libvirt.group]
- name: Checking that host libvirt is not running - name: Checking that host libvirt is not running
vars: vars:
nova_libvirt: "{{ nova_cell_services['nova-libvirt'] }}" service: "{{ nova_cell_services['nova-libvirt'] }}"
stat: path=/var/run/libvirt/libvirt-sock stat: path=/var/run/libvirt/libvirt-sock
register: result register: result
failed_when: result.stat.exists failed_when: result.stat.exists
when: when:
- container_facts['nova_libvirt'] is not defined - container_facts['nova_libvirt'] is not defined
- nova_libvirt.enabled | bool - service | service_enabled_and_mapped_to_host
- inventory_hostname in groups[nova_libvirt.group]
- name: Checking that nova_libvirt container is not running - name: Checking that nova_libvirt container is not running
vars: vars:

View File

@ -36,6 +36,5 @@
healthcheck: "{{ service.healthcheck | default(omit) }}" healthcheck: "{{ service.healthcheck | default(omit) }}"
when: when:
- kolla_action == 'upgrade' - kolla_action == 'upgrade'
- inventory_hostname in groups[service.group] - service | service_enabled_and_mapped_to_host
- service.enabled | bool
with_items: "{{ nova_cell_services_require_nova_conf }}" with_items: "{{ nova_cell_services_require_nova_conf }}"

View File

@ -5,12 +5,10 @@
action: "stop_container" action: "stop_container"
common_options: "{{ docker_common_options }}" common_options: "{{ docker_common_options }}"
name: "{{ item.value.container_name }}" name: "{{ item.value.container_name }}"
with_dict: "{{ nova_cell_services }}" with_dict: "{{ nova_cell_services | select_services_enabled_and_mapped_to_host }}"
when: when:
- "'nova-compute' not in item.key" - "'nova-compute' not in item.key"
- item.key in nova_cell_services_require_nova_conf - item.key in nova_cell_services_require_nova_conf
- inventory_hostname in groups[item.value.group]
- item.value.enabled | bool
- nova_safety_upgrade | bool - nova_safety_upgrade | bool
- import_tasks: rolling_upgrade.yml - import_tasks: rolling_upgrade.yml

View File

@ -13,9 +13,6 @@
volumes: "{{ item.value.volumes | reject('equalto', '') | list }}" volumes: "{{ item.value.volumes | reject('equalto', '') | list }}"
dimensions: "{{ item.value.dimensions }}" dimensions: "{{ item.value.dimensions }}"
healthcheck: "{{ item.value.healthcheck | default(omit) }}" healthcheck: "{{ item.value.healthcheck | default(omit) }}"
when: with_dict: "{{ nova_services | select_services_enabled_and_mapped_to_host }}"
- inventory_hostname in groups[item.value.group]
- item.value.enabled | bool
with_dict: "{{ nova_services }}"
notify: notify:
- "Restart {{ item.key }} container" - "Restart {{ item.key }} container"

View File

@ -7,10 +7,7 @@
owner: "{{ config_owner_user }}" owner: "{{ config_owner_user }}"
group: "{{ config_owner_group }}" group: "{{ config_owner_group }}"
mode: "0770" mode: "0770"
when: with_dict: "{{ nova_services | select_services_enabled_and_mapped_to_host }}"
- inventory_hostname in groups[item.value.group]
- item.value.enabled | bool
with_dict: "{{ nova_services }}"
- name: Check if policies shall be overwritten - name: Check if policies shall be overwritten
stat: stat:
@ -54,10 +51,7 @@
src: "{{ item.key }}.json.j2" src: "{{ item.key }}.json.j2"
dest: "{{ node_config_directory }}/{{ item.key }}/config.json" dest: "{{ node_config_directory }}/{{ item.key }}/config.json"
mode: "0660" mode: "0660"
when: with_dict: "{{ nova_services | select_services_enabled_and_mapped_to_host }}"
- inventory_hostname in groups[item.value.group]
- item.value.enabled | bool
with_dict: "{{ nova_services }}"
notify: notify:
- "Restart {{ item.key }} container" - "Restart {{ item.key }} container"
@ -74,10 +68,7 @@
- "{{ node_custom_config }}/nova/{{ inventory_hostname }}/nova.conf" - "{{ node_custom_config }}/nova/{{ inventory_hostname }}/nova.conf"
dest: "{{ node_config_directory }}/{{ item.key }}/nova.conf" dest: "{{ node_config_directory }}/{{ item.key }}/nova.conf"
mode: "0660" mode: "0660"
when: with_dict: "{{ nova_services | select_services_enabled_and_mapped_to_host }}"
- inventory_hostname in groups[item.value.group]
- item.value.enabled | bool
with_dict: "{{ nova_services }}"
notify: notify:
- "Restart {{ item.key }} container" - "Restart {{ item.key }} container"
@ -88,23 +79,21 @@
dest: "{{ node_config_directory }}/{{ item.key }}/{{ nova_policy_file }}" dest: "{{ node_config_directory }}/{{ item.key }}/{{ nova_policy_file }}"
mode: "0660" mode: "0660"
when: when:
- inventory_hostname in groups[item.value.group]
- item.value.enabled | bool
- nova_policy_file is defined - nova_policy_file is defined
- item.key in nova_services_require_policy_json - item.key in nova_services_require_policy_json
with_dict: "{{ nova_services }}" with_dict: "{{ nova_services | select_services_enabled_and_mapped_to_host }}"
notify: notify:
- "Restart {{ item.key }} container" - "Restart {{ item.key }} container"
- name: Copying over nova-api-wsgi.conf - name: Copying over nova-api-wsgi.conf
vars:
service: "{{ nova_services['nova-api'] }}"
template: template:
src: "nova-api-wsgi.conf.j2" src: "nova-api-wsgi.conf.j2"
dest: "{{ node_config_directory }}/nova-api/nova-api-wsgi.conf" dest: "{{ node_config_directory }}/nova-api/nova-api-wsgi.conf"
mode: "0660" mode: "0660"
become: true become: true
when: when: service | service_enabled_and_mapped_to_host
- inventory_hostname in groups["nova-api"]
- nova_services["nova-api"].enabled | bool
notify: notify:
- "Restart nova-api container" - "Restart nova-api container"
@ -118,7 +107,6 @@
become: True become: True
when: when:
- vendordata_file_path is defined - vendordata_file_path is defined
- inventory_hostname in groups[service['group']] - service | service_enabled_and_mapped_to_host
- service.enabled | bool
notify: notify:
- "Restart nova-api container" - "Restart nova-api container"

View File

@ -16,7 +16,7 @@
- name: Checking free port for Nova API - name: Checking free port for Nova API
vars: vars:
nova_api: "{{ nova_services['nova-api'] }}" service: "{{ nova_services['nova-api'] }}"
wait_for: wait_for:
host: "{{ api_interface_address }}" host: "{{ api_interface_address }}"
port: "{{ nova_api_listen_port }}" port: "{{ nova_api_listen_port }}"
@ -25,12 +25,11 @@
state: stopped state: stopped
when: when:
- container_facts['nova_api'] is not defined - container_facts['nova_api'] is not defined
- inventory_hostname in groups[nova_api.group] - service | service_enabled_and_mapped_to_host
- nova_api.enabled | bool
- name: Checking free port for Nova Metadata - name: Checking free port for Nova Metadata
vars: vars:
nova_api: "{{ nova_services['nova-api'] }}" service: "{{ nova_services['nova-api'] }}"
wait_for: wait_for:
host: "{{ api_interface_address }}" host: "{{ api_interface_address }}"
port: "{{ nova_metadata_listen_port }}" port: "{{ nova_metadata_listen_port }}"
@ -39,5 +38,4 @@
state: stopped state: stopped
when: when:
- container_facts['nova_api'] is not defined - container_facts['nova_api'] is not defined
- inventory_hostname in groups[nova_api.group] - service | service_enabled_and_mapped_to_host
- nova_api.enabled | bool

View File

@ -17,8 +17,7 @@
healthcheck: "{{ service.healthcheck | default(omit) }}" healthcheck: "{{ service.healthcheck | default(omit) }}"
when: when:
- kolla_action == 'upgrade' - kolla_action == 'upgrade'
- inventory_hostname in groups[service.group] - service | service_enabled_and_mapped_to_host
- service.enabled | bool
with_items: with_items:
- nova-scheduler - nova-scheduler
- nova-api - nova-api

View File

@ -17,5 +17,4 @@
healthcheck: "{{ service.healthcheck | default(omit) }}" healthcheck: "{{ service.healthcheck | default(omit) }}"
when: when:
- kolla_action == 'upgrade' - kolla_action == 'upgrade'
- inventory_hostname in groups[service.group] - service | service_enabled_and_mapped_to_host
- service.enabled | bool

View File

@ -44,10 +44,8 @@
action: "stop_container" action: "stop_container"
common_options: "{{ docker_common_options }}" common_options: "{{ docker_common_options }}"
name: "{{ item.value.container_name }}" name: "{{ item.value.container_name }}"
with_dict: "{{ nova_services }}" with_dict: "{{ nova_services | select_services_enabled_and_mapped_to_host }}"
when: when:
- inventory_hostname in groups[item.value.group]
- item.value.enabled | bool
- nova_safety_upgrade | bool - nova_safety_upgrade | bool
- import_tasks: rolling_upgrade.yml - import_tasks: rolling_upgrade.yml

View File

@ -9,9 +9,6 @@
volumes: "{{ item.value.volumes }}" volumes: "{{ item.value.volumes }}"
dimensions: "{{ item.value.dimensions }}" dimensions: "{{ item.value.dimensions }}"
healthcheck: "{{ item.value.healthcheck | default(omit) }}" healthcheck: "{{ item.value.healthcheck | default(omit) }}"
when: with_dict: "{{ octavia_services | select_services_enabled_and_mapped_to_host }}"
- inventory_hostname in groups[item.value.group]
- item.value.enabled | bool
with_dict: "{{ octavia_services }}"
notify: notify:
- "Restart {{ item.key }} container" - "Restart {{ item.key }} container"

View File

@ -10,10 +10,7 @@
group: "{{ config_owner_group }}" group: "{{ config_owner_group }}"
mode: "0770" mode: "0770"
become: true become: true
when: with_dict: "{{ octavia_services | select_services_enabled_and_mapped_to_host }}"
- inventory_hostname in groups[item.value.group]
- item.value.enabled | bool
with_dict: "{{ octavia_services }}"
- name: Check if policies shall be overwritten - name: Check if policies shall be overwritten
stat: stat:
@ -42,9 +39,7 @@
become: true become: true
when: when:
- octavia_policy_file is defined - octavia_policy_file is defined
- inventory_hostname in groups[item.value.group] with_dict: "{{ octavia_services | select_services_enabled_and_mapped_to_host }}"
- item.value.enabled | bool
with_dict: "{{ octavia_services }}"
notify: notify:
- "Restart {{ item.key }} container" - "Restart {{ item.key }} container"
@ -58,10 +53,7 @@
dest: "{{ node_config_directory }}/{{ item.key }}/config.json" dest: "{{ node_config_directory }}/{{ item.key }}/config.json"
mode: "0660" mode: "0660"
become: true become: true
when: with_dict: "{{ octavia_services | select_services_enabled_and_mapped_to_host }}"
- inventory_hostname in groups[item.value.group]
- item.value.enabled | bool
with_dict: "{{ octavia_services }}"
notify: notify:
- "Restart {{ item.key }} container" - "Restart {{ item.key }} container"
@ -77,9 +69,7 @@
- "{{ node_custom_config }}/octavia/{{ inventory_hostname }}/octavia-wsgi.conf" - "{{ node_custom_config }}/octavia/{{ inventory_hostname }}/octavia-wsgi.conf"
- "{{ node_custom_config }}/octavia/octavia-wsgi.conf" - "{{ node_custom_config }}/octavia/octavia-wsgi.conf"
- "octavia-wsgi.conf.j2" - "octavia-wsgi.conf.j2"
when: when: service | service_enabled_and_mapped_to_host
- inventory_hostname in groups[service.group]
- service.enabled | bool
notify: notify:
- Restart octavia-api container - Restart octavia-api container
@ -96,10 +86,7 @@
dest: "{{ node_config_directory }}/{{ item.key }}/octavia.conf" dest: "{{ node_config_directory }}/{{ item.key }}/octavia.conf"
mode: "0660" mode: "0660"
become: true become: true
when: with_dict: "{{ octavia_services | select_services_enabled_and_mapped_to_host }}"
- inventory_hostname in groups[item.value.group]
- item.value.enabled | bool
with_dict: "{{ octavia_services }}"
notify: notify:
- "Restart {{ item.key }} container" - "Restart {{ item.key }} container"
@ -125,9 +112,7 @@
dest: "{{ node_config_directory }}/octavia-worker/{{ item }}" dest: "{{ node_config_directory }}/octavia-worker/{{ item }}"
mode: "0660" mode: "0660"
become: true become: true
when: when: service | service_enabled_and_mapped_to_host
- inventory_hostname in groups[service.group]
- service.enabled | bool
with_items: "{{ octavia_amphora_keys }}" with_items: "{{ octavia_amphora_keys }}"
notify: notify:
- Restart octavia-worker container - Restart octavia-worker container
@ -140,9 +125,7 @@
dest: "{{ node_config_directory }}/octavia-housekeeping/{{ item }}" dest: "{{ node_config_directory }}/octavia-housekeeping/{{ item }}"
mode: "0660" mode: "0660"
become: true become: true
when: when: service | service_enabled_and_mapped_to_host
- inventory_hostname in groups[service.group]
- service.enabled | bool
with_items: "{{ octavia_amphora_keys }}" with_items: "{{ octavia_amphora_keys }}"
notify: notify:
- Restart octavia-housekeeping container - Restart octavia-housekeeping container
@ -155,9 +138,7 @@
dest: "{{ node_config_directory }}/octavia-health-manager/{{ item }}" dest: "{{ node_config_directory }}/octavia-health-manager/{{ item }}"
mode: "0660" mode: "0660"
become: true become: true
when: when: service | service_enabled_and_mapped_to_host
- inventory_hostname in groups[service.group]
- service.enabled | bool
with_items: "{{ octavia_amphora_keys }}" with_items: "{{ octavia_amphora_keys }}"
notify: notify:
- Restart octavia-health-manager container - Restart octavia-health-manager container

View File

@ -10,9 +10,6 @@
name: "{{ item.value.container_name }}" name: "{{ item.value.container_name }}"
image: "{{ item.value.image }}" image: "{{ item.value.image }}"
volumes: "{{ item.value.volumes }}" volumes: "{{ item.value.volumes }}"
when: with_dict: "{{ opensearch_services | select_services_enabled_and_mapped_to_host }}"
- inventory_hostname in groups[item.value.group]
- item.value.enabled | bool
with_dict: "{{ opensearch_services }}"
notify: notify:
- "Restart {{ item.key }} container" - "Restart {{ item.key }} container"

View File

@ -7,10 +7,7 @@
group: "{{ config_owner_group }}" group: "{{ config_owner_group }}"
mode: "0770" mode: "0770"
become: true become: true
when: with_dict: "{{ opensearch_services | select_services_enabled_and_mapped_to_host }}"
- inventory_hostname in groups[item.value.group]
- item.value.enabled | bool
with_dict: "{{ opensearch_services }}"
- include_tasks: copy-certs.yml - include_tasks: copy-certs.yml
when: when:
@ -22,14 +19,13 @@
dest: "{{ node_config_directory }}/{{ item.key }}/config.json" dest: "{{ node_config_directory }}/{{ item.key }}/config.json"
mode: "0660" mode: "0660"
become: true become: true
when: with_dict: "{{ opensearch_services | select_services_enabled_and_mapped_to_host }}"
- inventory_hostname in groups[item.value.group]
- item.value.enabled | bool
with_dict: "{{ opensearch_services }}"
notify: notify:
- Restart {{ item.key }} container - Restart {{ item.key }} container
- name: Copying over opensearch service config file - name: Copying over opensearch service config file
vars:
service: "{{ opensearch_services['opensearch'] }}"
merge_yaml: merge_yaml:
sources: sources:
- "{{ role_path }}/templates/opensearch.yml.j2" - "{{ role_path }}/templates/opensearch.yml.j2"
@ -39,15 +35,13 @@
dest: "{{ node_config_directory }}/opensearch/opensearch.yml" dest: "{{ node_config_directory }}/opensearch/opensearch.yml"
mode: "0660" mode: "0660"
become: true become: true
when: when: service | service_enabled_and_mapped_to_host
- inventory_hostname in groups['opensearch']
- opensearch_services['opensearch'].enabled | bool
notify: notify:
- Restart opensearch container - Restart opensearch container
- name: Copying over opensearch-dashboards config file - name: Copying over opensearch-dashboards config file
vars: vars:
opensearch_dashboards: "{{ opensearch_services['opensearch-dashboards'] }}" service: "{{ opensearch_services['opensearch-dashboards'] }}"
merge_yaml: merge_yaml:
sources: sources:
- "{{ role_path }}/templates/opensearch_dashboards.yml.j2" - "{{ role_path }}/templates/opensearch_dashboards.yml.j2"
@ -56,8 +50,6 @@
dest: "{{ node_config_directory }}/opensearch-dashboards/opensearch_dashboards.yml" dest: "{{ node_config_directory }}/opensearch-dashboards/opensearch_dashboards.yml"
mode: "0660" mode: "0660"
become: true become: true
when: when: service | service_enabled_and_mapped_to_host
- inventory_hostname in groups['opensearch-dashboards']
- opensearch_dashboards.enabled | bool
notify: notify:
- Restart opensearch-dashboards container - Restart opensearch-dashboards container

View File

@ -10,9 +10,6 @@
volumes: "{{ item.value.volumes }}" volumes: "{{ item.value.volumes }}"
dimensions: "{{ item.value.dimensions }}" dimensions: "{{ item.value.dimensions }}"
healthcheck: "{{ item.value.healthcheck }}" healthcheck: "{{ item.value.healthcheck }}"
when: with_dict: "{{ openvswitch_services | select_services_enabled_and_mapped_to_host }}"
- item.value.enabled | bool
- item.value.host_in_groups | bool
with_dict: "{{ openvswitch_services }}"
notify: notify:
- "Restart {{ item.key }} container" - "Restart {{ item.key }} container"

View File

@ -7,10 +7,7 @@
owner: "{{ config_owner_user }}" owner: "{{ config_owner_user }}"
group: "{{ config_owner_group }}" group: "{{ config_owner_group }}"
mode: "0770" mode: "0770"
when: with_dict: "{{ openvswitch_services | select_services_enabled_and_mapped_to_host }}"
- item.value.enabled | bool
- item.value.host_in_groups | bool
with_dict: "{{ openvswitch_services }}"
- name: Copying over config.json files for services - name: Copying over config.json files for services
become: true become: true
@ -18,10 +15,7 @@
src: "{{ item.key }}.json.j2" src: "{{ item.key }}.json.j2"
dest: "{{ node_config_directory }}/{{ item.key }}/config.json" dest: "{{ node_config_directory }}/{{ item.key }}/config.json"
mode: "0660" mode: "0660"
when: with_dict: "{{ openvswitch_services | select_services_enabled_and_mapped_to_host }}"
- item.value.enabled | bool
- item.value.host_in_groups | bool
with_dict: "{{ openvswitch_services }}"
notify: notify:
- "Restart {{ item.key }} container" - "Restart {{ item.key }} container"
@ -34,6 +28,5 @@
mode: "0755" mode: "0755"
become: true become: true
when: when:
- service.host_in_groups | bool - service | service_enabled_and_mapped_to_host
- service.enabled | bool
- openvswitch_ovs_vsctl_wrapper_enabled | bool - openvswitch_ovs_vsctl_wrapper_enabled | bool

View File

@ -16,7 +16,7 @@
- name: Checking free port for OVSDB - name: Checking free port for OVSDB
vars: vars:
openvswitch_db: "{{ openvswitch_services['openvswitch-db-server'] }}" service: "{{ openvswitch_services['openvswitch-db-server'] }}"
wait_for: wait_for:
host: "{{ api_interface_address }}" host: "{{ api_interface_address }}"
port: "{{ ovsdb_port }}" port: "{{ ovsdb_port }}"
@ -25,5 +25,4 @@
state: stopped state: stopped
when: when:
- container_facts['openvswitch_db'] is not defined - container_facts['openvswitch_db'] is not defined
- inventory_hostname in groups[openvswitch_db.group] - service | service_enabled_and_mapped_to_host
- openvswitch_db.enabled | bool

View File

@ -8,9 +8,6 @@
image: "{{ item.value.image }}" image: "{{ item.value.image }}"
volumes: "{{ item.value.volumes | reject('equalto', '') | list }}" volumes: "{{ item.value.volumes | reject('equalto', '') | list }}"
dimensions: "{{ item.value.dimensions }}" dimensions: "{{ item.value.dimensions }}"
when: with_dict: "{{ ovn_controller_services | select_services_enabled_and_mapped_to_host }}"
- inventory_hostname in groups[item.value.group]
- item.value.enabled | bool
with_dict: "{{ ovn_controller_services }}"
notify: notify:
- Restart {{ item.key }} container - Restart {{ item.key }} container

View File

@ -7,10 +7,7 @@
group: "{{ config_owner_group }}" group: "{{ config_owner_group }}"
mode: "0770" mode: "0770"
become: true become: true
when: with_dict: "{{ ovn_controller_services | select_services_enabled_and_mapped_to_host }}"
- inventory_hostname in groups[item.value.group]
- item.value.enabled | bool
with_dict: "{{ ovn_controller_services }}"
- name: Copying over config.json files for services - name: Copying over config.json files for services
template: template:
@ -18,9 +15,6 @@
dest: "{{ node_config_directory }}/{{ item.key }}/config.json" dest: "{{ node_config_directory }}/{{ item.key }}/config.json"
mode: "0660" mode: "0660"
become: true become: true
when: with_dict: "{{ ovn_controller_services | select_services_enabled_and_mapped_to_host }}"
- inventory_hostname in groups[item.value.group]
- item.value.enabled | bool
with_dict: "{{ ovn_controller_services }}"
notify: notify:
- Restart {{ item.key }} container - Restart {{ item.key }} container

View File

@ -8,9 +8,6 @@
image: "{{ item.value.image }}" image: "{{ item.value.image }}"
volumes: "{{ item.value.volumes | reject('equalto', '') | list }}" volumes: "{{ item.value.volumes | reject('equalto', '') | list }}"
dimensions: "{{ item.value.dimensions }}" dimensions: "{{ item.value.dimensions }}"
when: with_dict: "{{ ovn_db_services | select_services_enabled_and_mapped_to_host }}"
- inventory_hostname in groups[item.value.group]
- item.value.enabled | bool
with_dict: "{{ ovn_db_services }}"
notify: notify:
- Restart {{ item.key }} container - Restart {{ item.key }} container

View File

@ -7,10 +7,7 @@
group: "{{ config_owner_group }}" group: "{{ config_owner_group }}"
mode: "0770" mode: "0770"
become: true become: true
when: with_dict: "{{ ovn_db_services | select_services_enabled_and_mapped_to_host }}"
- inventory_hostname in groups[item.value.group]
- item.value.enabled | bool
with_dict: "{{ ovn_db_services }}"
- name: Copying over config.json files for services - name: Copying over config.json files for services
template: template:
@ -18,9 +15,6 @@
dest: "{{ node_config_directory }}/{{ item.key }}/config.json" dest: "{{ node_config_directory }}/{{ item.key }}/config.json"
mode: "0660" mode: "0660"
become: true become: true
when: with_dict: "{{ ovn_db_services | select_services_enabled_and_mapped_to_host }}"
- inventory_hostname in groups[item.value.group]
- item.value.enabled | bool
with_dict: "{{ ovn_db_services }}"
notify: notify:
- Restart {{ item.key }} container - Restart {{ item.key }} container

View File

@ -9,9 +9,6 @@
privileged: "{{ item.value.privileged | default(False) }}" privileged: "{{ item.value.privileged | default(False) }}"
volumes: "{{ item.value.volumes }}" volumes: "{{ item.value.volumes }}"
dimensions: "{{ item.value.dimensions }}" dimensions: "{{ item.value.dimensions }}"
when: with_dict: "{{ ovsdpdk_services | select_services_enabled_and_mapped_to_host }}"
- item.value.enabled | bool
- item.value.host_in_groups | bool
with_dict: "{{ ovsdpdk_services }}"
notify: notify:
- "Restart {{ item.key }} container" - "Restart {{ item.key }} container"

Some files were not shown because too many files have changed in this diff Show More