Merge "Refactor services' check-containers and optimise"

This commit is contained in:
Zuul 2024-12-03 16:24:26 +00:00 committed by Gerrit Code Review
commit afa42820db
64 changed files with 161 additions and 761 deletions

View File

@ -267,6 +267,8 @@ EXAMPLES = '''
def generate_module(): def generate_module():
# NOTE(jeffrey4l): add empty string '' to choices let us use # NOTE(jeffrey4l): add empty string '' to choices let us use
# pid_mode: "{{ service.pid_mode | default ('') }}" in yaml # pid_mode: "{{ service.pid_mode | default ('') }}" in yaml
# NOTE(r-krcek): arguments_spec should also be reflected in the list of
# arguments in service-check-containers role
argument_spec = dict( argument_spec = dict(
common_options=dict(required=False, type='dict', default=dict()), common_options=dict(required=False, type='dict', default=dict()),
action=dict(required=True, type='str', action=dict(required=True, type='str',

View File

@ -1,14 +1,3 @@
--- ---
- name: Check aodh containers - import_role:
become: true name: service-check-containers
kolla_container:
action: "compare_container"
common_options: "{{ docker_common_options }}"
name: "{{ item.value.container_name }}"
image: "{{ item.value.image }}"
volumes: "{{ item.value.volumes | reject('equalto', '') | list }}"
dimensions: "{{ item.value.dimensions }}"
healthcheck: "{{ item.value.healthcheck | default(omit) }}"
with_dict: "{{ aodh_services | select_services_enabled_and_mapped_to_host }}"
notify:
- "Restart {{ item.key }} container"

View File

@ -1,14 +1,3 @@
--- ---
- name: Check barbican containers - import_role:
become: true name: service-check-containers
kolla_container:
action: "compare_container"
common_options: "{{ docker_common_options }}"
name: "{{ item.value.container_name }}"
image: "{{ item.value.image }}"
volumes: "{{ item.value.volumes | reject('equalto', '') | list }}"
dimensions: "{{ item.value.dimensions }}"
healthcheck: "{{ item.value.healthcheck | default(omit) }}"
with_dict: "{{ barbican_services | select_services_enabled_and_mapped_to_host }}"
notify:
- "Restart {{ item.key }} container"

View File

@ -1,14 +1,3 @@
--- ---
- name: Check blazar containers - import_role:
become: true name: service-check-containers
kolla_container:
action: "compare_container"
common_options: "{{ docker_common_options }}"
name: "{{ item.value.container_name }}"
image: "{{ item.value.image }}"
volumes: "{{ item.value.volumes | reject('equalto', '') | list }}"
dimensions: "{{ item.value.dimensions }}"
healthcheck: "{{ item.value.healthcheck | default(omit) }}"
with_dict: "{{ blazar_services | select_services_enabled_and_mapped_to_host }}"
notify:
- "Restart {{ item.key }} container"

View File

@ -1,15 +1,3 @@
--- ---
- name: Check ceilometer containers - import_role:
become: true name: service-check-containers
kolla_container:
action: "compare_container"
common_options: "{{ docker_common_options }}"
name: "{{ item.value.container_name }}"
image: "{{ item.value.image }}"
privileged: "{{ item.value.privileged | default(False) }}"
volumes: "{{ item.value.volumes | reject('equalto', '') | list }}"
dimensions: "{{ item.value.dimensions }}"
healthcheck: "{{ item.value.healthcheck | default(omit) }}"
with_dict: "{{ ceilometer_services | select_services_enabled_and_mapped_to_host }}"
notify:
- "Restart {{ item.key }} container"

View File

@ -1,17 +1,3 @@
--- ---
- name: Check cinder containers - import_role:
become: true name: service-check-containers
kolla_container:
action: "compare_container"
common_options: "{{ docker_common_options }}"
name: "{{ item.value.container_name }}"
image: "{{ item.value.image }}"
tmpfs: "{{ item.value.tmpfs | default(omit) }}"
volumes: "{{ item.value.volumes | reject('equalto', '') | list }}"
dimensions: "{{ item.value.dimensions }}"
healthcheck: "{{ item.value.healthcheck | default(omit) }}"
privileged: "{{ item.value.privileged | default(False) }}"
ipc_mode: "{{ item.value.ipc_mode | default('') }}"
with_dict: "{{ cinder_services | select_services_enabled_and_mapped_to_host }}"
notify:
- "Restart {{ item.key }} container"

View File

@ -35,8 +35,6 @@
with_nested: with_nested:
- "{{ cinder_services | dict2items }}" - "{{ cinder_services | dict2items }}"
- "{{ cinder_ceph_backends + [cinder_backup_ceph_backend] }}" - "{{ cinder_ceph_backends + [cinder_backup_ceph_backend] }}"
notify:
- "Restart {{ service_name }} container"
- name: Copy over Ceph keyring files for cinder-volume - name: Copy over Ceph keyring files for cinder-volume
vars: vars:
@ -51,8 +49,6 @@
when: when:
- external_ceph_cephx_enabled | bool - external_ceph_cephx_enabled | bool
- service | service_enabled_and_mapped_to_host - service | service_enabled_and_mapped_to_host
notify:
- Restart cinder-volume container
- name: Copy over Ceph keyring files for cinder-backup - name: Copy over Ceph keyring files for cinder-backup
vars: vars:
@ -69,8 +65,6 @@
when: when:
- external_ceph_cephx_enabled | bool - external_ceph_cephx_enabled | bool
- service | service_enabled_and_mapped_to_host - service | service_enabled_and_mapped_to_host
notify:
- Restart cinder-backup container
- name: Ensuring config directory has correct owner and permission - name: Ensuring config directory has correct owner and permission
become: true become: true

View File

@ -1,14 +1,3 @@
--- ---
- name: Check cloudkitty containers - import_role:
become: true name: service-check-containers
kolla_container:
action: "compare_container"
common_options: "{{ docker_common_options }}"
name: "{{ item.value.container_name }}"
image: "{{ item.value.image }}"
volumes: "{{ item.value.volumes | reject('equalto', '') | list }}"
dimensions: "{{ item.value.dimensions }}"
healthcheck: "{{ item.value.healthcheck | default(omit) }}"
with_dict: "{{ cloudkitty_services | select_services_enabled_and_mapped_to_host }}"
notify:
- "Restart {{ item.key }} container"

View File

@ -1,14 +1,3 @@
--- ---
- name: Check collectd containers - import_role:
become: true name: service-check-containers
kolla_container:
action: "compare_container"
common_options: "{{ docker_common_options }}"
name: "{{ item.value.container_name }}"
image: "{{ item.value.image }}"
privileged: "{{ item.value.privileged | default(False) }}"
volumes: "{{ item.value.volumes }}"
dimensions: "{{ item.value.dimensions }}"
with_dict: "{{ collectd_services | select_services_enabled_and_mapped_to_host }}"
notify:
- "Restart {{ item.key }} container"

View File

@ -1,15 +1,3 @@
--- ---
- name: Check common containers - import_role:
become: true name: service-check-containers
kolla_container:
action: "compare_container"
common_options: "{{ docker_common_options }}"
name: "{{ item.value.container_name }}"
image: "{{ item.value.image }}"
volumes: "{{ item.value.volumes }}"
dimensions: "{{ item.value.dimensions }}"
privileged: "{{ item.value.privileged | default(False) }}"
environment: "{{ item.value.environment }}"
with_dict: "{{ common_services | select_services_enabled_and_mapped_to_host }}"
notify:
- "Restart {{ item.key }} container"

View File

@ -1,15 +1,3 @@
--- ---
- name: Check cyborg containers - import_role:
become: true name: service-check-containers
kolla_container:
action: "compare_container"
common_options: "{{ docker_common_options }}"
name: "{{ item.value.container_name }}"
image: "{{ item.value.image }}"
privileged: "{{ item.value.privileged | default(False) }}"
volumes: "{{ item.value.volumes }}"
dimensions: "{{ item.value.dimensions }}"
healthcheck: "{{ item.value.healthcheck | default(omit) }}"
with_dict: "{{ cyborg_services | select_services_enabled_and_mapped_to_host }}"
notify:
- Restart {{ item.key }} container

View File

@ -9,8 +9,6 @@
- designate_backend_external == 'bind9' - designate_backend_external == 'bind9'
- item.key in [ "designate-worker" ] - item.key in [ "designate-worker" ]
with_dict: "{{ designate_services | select_services_enabled_and_mapped_to_host }}" with_dict: "{{ designate_services | select_services_enabled_and_mapped_to_host }}"
notify:
- Restart {{ item.key }} container
- name: Copying over rndc.key (designate_backend_external) - name: Copying over rndc.key (designate_backend_external)
template: template:
@ -22,5 +20,3 @@
- designate_backend_external == 'bind9' - designate_backend_external == 'bind9'
- item.key in [ "designate-worker" ] - item.key in [ "designate-worker" ]
with_dict: "{{ designate_services | select_services_enabled_and_mapped_to_host }}" with_dict: "{{ designate_services | select_services_enabled_and_mapped_to_host }}"
notify:
- Restart {{ item.key }} container

View File

@ -1,14 +1,3 @@
--- ---
- name: Check designate containers - import_role:
become: true name: service-check-containers
kolla_container:
action: "compare_container"
common_options: "{{ docker_common_options }}"
name: "{{ item.value.container_name }}"
image: "{{ item.value.image }}"
volumes: "{{ item.value.volumes | reject('equalto', '') | list }}"
dimensions: "{{ item.value.dimensions }}"
healthcheck: "{{ item.value.healthcheck | default(omit) }}"
with_dict: "{{ designate_services | select_services_enabled_and_mapped_to_host }}"
notify:
- "Restart {{ item.key }} container"

View File

@ -1,14 +1,3 @@
--- ---
- name: Check etcd containers - import_role:
become: true name: service-check-containers
kolla_container:
action: "compare_container"
common_options: "{{ docker_common_options }}"
name: "{{ item.value.container_name }}"
image: "{{ item.value.image }}"
volumes: "{{ item.value.volumes }}"
dimensions: "{{ item.value.dimensions }}"
environment: "{{ item.value.environment }}"
with_dict: "{{ etcd_services | select_services_enabled_and_mapped_to_host }}"
notify:
- "Restart {{ item.key }} container"

View File

@ -1,16 +1,3 @@
--- ---
- name: Check glance containers - import_role:
become: true name: service-check-containers
kolla_container:
action: "compare_container"
common_options: "{{ docker_common_options }}"
name: "{{ item.value.container_name }}"
image: "{{ item.value.image }}"
privileged: "{{ item.value.privileged | default(omit) }}"
environment: "{{ item.value.environment | default(omit) }}"
volumes: "{{ item.value.volumes | reject('equalto', '') | list }}"
dimensions: "{{ item.value.dimensions }}"
healthcheck: "{{ item.value.healthcheck | default(omit) }}"
with_dict: "{{ glance_services | select_services_enabled_and_mapped_to_host }}"
notify:
- "Restart {{ item.key }} container"

View File

@ -21,8 +21,6 @@
become: true become: true
when: inventory_hostname in groups['glance-api'] when: inventory_hostname in groups['glance-api']
with_items: "{{ glance_ceph_backends }}" with_items: "{{ glance_ceph_backends }}"
notify:
- Restart glance-api container
- name: Copy over ceph Glance keyrings - name: Copy over ceph Glance keyrings
vars: vars:
@ -34,8 +32,6 @@
become: true become: true
with_items: "{{ glance_ceph_backends }}" with_items: "{{ glance_ceph_backends }}"
when: inventory_hostname in groups['glance-api'] when: inventory_hostname in groups['glance-api']
notify:
- Restart glance-api container
- name: Ensuring config directory has correct owner and permission - name: Ensuring config directory has correct owner and permission
file: file:

View File

@ -1,14 +1,3 @@
--- ---
- name: Check gnocchi containers - import_role:
become: true name: service-check-containers
kolla_container:
action: "compare_container"
common_options: "{{ docker_common_options }}"
name: "{{ item.value.container_name }}"
image: "{{ item.value.image }}"
volumes: "{{ item.value.volumes }}"
dimensions: "{{ item.value.dimensions }}"
healthcheck: "{{ item.value.healthcheck | default(omit) }}"
with_dict: "{{ gnocchi_services | select_services_enabled_and_mapped_to_host }}"
notify:
- "Restart {{ item.key }} container"

View File

@ -18,8 +18,6 @@
mode: "0660" mode: "0660"
become: true become: true
with_dict: "{{ gnocchi_services | select_services_enabled_and_mapped_to_host }}" with_dict: "{{ gnocchi_services | select_services_enabled_and_mapped_to_host }}"
notify:
- Restart {{ item.key }} container
- name: Copy over ceph Gnocchi keyrings - name: Copy over ceph Gnocchi keyrings
template: template:
@ -28,8 +26,6 @@
mode: "0660" mode: "0660"
become: true become: true
with_dict: "{{ gnocchi_services | select_services_enabled_and_mapped_to_host }}" with_dict: "{{ gnocchi_services | select_services_enabled_and_mapped_to_host }}"
notify:
- Restart {{ item.key }} container
- name: Ensuring config directory has correct owner and permission - name: Ensuring config directory has correct owner and permission
become: true become: true

View File

@ -1,13 +1,3 @@
--- ---
- name: Check grafana containers - import_role:
become: true name: service-check-containers
kolla_container:
action: "compare_container"
common_options: "{{ docker_common_options }}"
name: "{{ item.value.container_name }}"
image: "{{ item.value.image }}"
volumes: "{{ item.value.volumes }}"
dimensions: "{{ item.value.dimensions }}"
with_dict: "{{ grafana_services | select_services_enabled_and_mapped_to_host }}"
notify:
- "Restart {{ item.key }} container"

View File

@ -1,25 +1,3 @@
--- ---
- name: Check hacluster containers - import_role:
become: true name: service-check-containers
kolla_container:
action: "compare_container"
common_options: "{{ docker_common_options }}"
name: "{{ service.container_name }}"
image: "{{ service.image | default(omit) }}"
volumes: "{{ service.volumes | default(omit) }}"
dimensions: "{{ service.dimensions | default(omit) }}"
volumes_from: "{{ service.volumes_from | default(omit) }}"
privileged: "{{ service.privileged | default(omit) }}"
cap_add: "{{ service.cap_add | default(omit) }}"
environment: "{{ service.environment | default(omit) }}"
ipc_mode: "{{ service.ipc_mode | default(omit) }}"
pid_mode: "{{ service.pid_mode | default(omit) }}"
security_opt: "{{ service.security_opt | default(omit) }}"
labels: "{{ service.labels | default(omit) }}"
command: "{{ service.command | default(omit) }}"
vars:
service_name: "{{ item.key }}"
service: "{{ item.value }}"
with_dict: "{{ hacluster_services | select_services_enabled_and_mapped_to_host }}"
notify:
- "Restart {{ service_name }} container"

View File

@ -1,14 +1,3 @@
--- ---
- name: Check heat containers - import_role:
become: true name: service-check-containers
kolla_container:
action: "compare_container"
common_options: "{{ docker_common_options }}"
name: "{{ item.value.container_name }}"
image: "{{ item.value.image }}"
volumes: "{{ item.value.volumes | reject('equalto', '') | list }}"
dimensions: "{{ item.value.dimensions }}"
healthcheck: "{{ item.value.healthcheck | default(omit) }}"
with_dict: "{{ heat_services | select_services_enabled_and_mapped_to_host }}"
notify:
- "Restart {{ item.key }} container"

View File

@ -1,15 +1,3 @@
--- ---
- name: Deploy horizon container - import_role:
become: true name: service-check-containers
kolla_container:
action: "compare_container"
common_options: "{{ docker_common_options }}"
name: "{{ item.value.container_name }}"
image: "{{ item.value.image }}"
environment: "{{ item.value.environment }}"
volumes: "{{ item.value.volumes }}"
dimensions: "{{ item.value.dimensions }}"
healthcheck: "{{ item.value.healthcheck | default(omit) }}"
with_dict: "{{ horizon_services | select_services_enabled_and_mapped_to_host }}"
notify:
- "Restart {{ item.key }} container"

View File

@ -1,13 +1,3 @@
--- ---
- name: Check influxdb containers - import_role:
become: true name: service-check-containers
kolla_container:
action: "compare_container"
common_options: "{{ docker_common_options }}"
name: "{{ item.value.container_name }}"
image: "{{ item.value.image }}"
volumes: "{{ item.value.volumes }}"
dimensions: "{{ item.value.dimensions }}"
with_dict: "{{ influxdb_services | select_services_enabled_and_mapped_to_host }}"
notify:
- "Restart {{ item.key }} container"

View File

@ -1,17 +1,3 @@
--- ---
- name: Check ironic containers - import_role:
become: true name: service-check-containers
kolla_container:
action: "compare_container"
common_options: "{{ docker_common_options }}"
name: "{{ item.value.container_name }}"
image: "{{ item.value.image }}"
privileged: "{{ item.value.privileged | default(False) }}"
cap_add: "{{ item.value.cap_add | default([]) }}"
environment: "{{ item.value.environment | default(omit) }}"
volumes: "{{ item.value.volumes | reject('equalto', '') | list }}"
dimensions: "{{ item.value.dimensions }}"
healthcheck: "{{ item.value.healthcheck | default(omit) }}"
with_dict: "{{ ironic_services | select_services_enabled_and_mapped_to_host }}"
notify:
- "Restart {{ item.key }} container"

View File

@ -1,15 +1,3 @@
--- ---
- name: Check iscsi containers - import_role:
become: true name: service-check-containers
kolla_container:
action: "compare_container"
common_options: "{{ docker_common_options }}"
name: "{{ item.value.container_name }}"
image: "{{ item.value.image }}"
ipc_mode: "{{ item.value.ipc_mode }}"
privileged: "{{ item.value.privileged | default(False) }}"
volumes: "{{ item.value.volumes }}"
dimensions: "{{ item.value.dimensions }}"
with_dict: "{{ iscsi_services | select_services_enabled_and_mapped_to_host }}"
notify:
- "Restart {{ item.key }} container"

View File

@ -1,14 +1,3 @@
--- ---
- name: Check keystone containers - import_role:
become: true name: service-check-containers
kolla_container:
action: "compare_container"
common_options: "{{ docker_common_options }}"
name: "{{ item.value.container_name }}"
image: "{{ item.value.image }}"
volumes: "{{ item.value.volumes | reject('equalto', '') | list }}"
dimensions: "{{ item.value.dimensions }}"
healthcheck: "{{ item.value.healthcheck | default(omit) }}"
with_dict: "{{ keystone_services | select_services_enabled_and_mapped_to_host }}"
notify:
- "Restart {{ item.key }} container"

View File

@ -1,16 +1,3 @@
--- ---
- name: Check kuryr containers - import_role:
become: true name: service-check-containers
kolla_container:
action: "compare_container"
common_options: "{{ docker_common_options }}"
name: "{{ item.value.container_name }}"
image: "{{ item.value.image }}"
privileged: "{{ item.value.privileged | default(False) }}"
cap_add: "{{ item.value.cap_add }}"
volumes: "{{ item.value.volumes }}"
dimensions: "{{ item.value.dimensions }}"
healthcheck: "{{ item.value.healthcheck | default(omit) }}"
with_dict: "{{ kuryr_services | select_services_enabled_and_mapped_to_host }}"
notify:
- "Restart {{ item.key }} container"

View File

@ -1,15 +1,3 @@
--- ---
- name: Check LetsEncrypt containers - import_role:
become: true name: service-check-containers
kolla_container:
action: "compare_container"
common_options: "{{ docker_common_options }}"
name: "{{ item.value.container_name }}"
image: "{{ item.value.image }}"
volumes: "{{ item.value.volumes }}"
dimensions: "{{ item.value.dimensions }}"
healthcheck: "{{ item.value.healthcheck | default(omit) }}"
environment: "{{ item.value.environment | default(omit) }}"
with_dict: "{{ letsencrypt_services | select_services_enabled_and_mapped_to_host }}"
notify:
- "Restart {{ item.key }} container"

View File

@ -1,15 +1,3 @@
--- ---
- name: Check loadbalancer containers - import_role:
become: true name: service-check-containers
kolla_container:
action: "compare_container"
common_options: "{{ docker_common_options }}"
name: "{{ item.value.container_name }}"
image: "{{ item.value.image }}"
volumes: "{{ item.value.volumes }}"
dimensions: "{{ item.value.dimensions }}"
healthcheck: "{{ item.value.healthcheck | default(omit) }}"
privileged: "{{ item.value.privileged | default(False) }}"
with_dict: "{{ loadbalancer_services | select_services_enabled_and_mapped_to_host }}"
notify:
- "Restart {{ item.key }} container"

View File

@ -1,15 +1,3 @@
--- ---
- name: Check magnum containers - import_role:
become: true name: service-check-containers
kolla_container:
action: "compare_container"
common_options: "{{ docker_common_options }}"
name: "{{ item.value.container_name }}"
image: "{{ item.value.image }}"
volumes: "{{ item.value.volumes | reject('equalto', '') | list }}"
dimensions: "{{ item.value.dimensions }}"
healthcheck: "{{ item.value.healthcheck | default(omit) }}"
environment: "{{ item.value.environment }}"
with_dict: "{{ magnum_services | select_services_enabled_and_mapped_to_host }}"
notify:
- "Restart {{ item.key }} container"

View File

@ -1,15 +1,3 @@
--- ---
- name: Check manila containers - import_role:
become: true name: service-check-containers
kolla_container:
action: "compare_container"
common_options: "{{ docker_common_options }}"
name: "{{ item.value.container_name }}"
image: "{{ item.value.image }}"
privileged: "{{ item.value.privileged | default(False) }}"
volumes: "{{ item.value.volumes | reject('equalto', '') | list }}"
dimensions: "{{ item.value.dimensions }}"
healthcheck: "{{ item.value.healthcheck | default(omit) }}"
with_dict: "{{ manila_services | select_services_enabled_and_mapped_to_host }}"
notify:
- "Restart {{ item.key }} container"

View File

@ -23,8 +23,6 @@
- inventory_hostname in groups['manila-share'] - inventory_hostname in groups['manila-share']
- item.enabled | bool - item.enabled | bool
with_items: "{{ manila_ceph_backends }}" with_items: "{{ manila_ceph_backends }}"
notify:
- Restart manila-share container
- name: Copy over ceph Manila keyrings - name: Copy over ceph Manila keyrings
template: template:
@ -36,8 +34,6 @@
when: when:
- inventory_hostname in groups['manila-share'] - inventory_hostname in groups['manila-share']
- item.enabled | bool - item.enabled | bool
notify:
- Restart manila-share container
- name: Ensuring config directory has correct owner and permission - name: Ensuring config directory has correct owner and permission
become: true become: true

View File

@ -83,7 +83,5 @@
volumes: "{{ service.volumes }}" volumes: "{{ service.volumes }}"
dimensions: "{{ service.dimensions }}" dimensions: "{{ service.dimensions }}"
environment: "{{ service.environment }}" environment: "{{ service.environment }}"
listen:
- Restart mariadb-clustercheck container
when: when:
- service | service_enabled_and_mapped_to_host - service | service_enabled_and_mapped_to_host

View File

@ -1,15 +1,3 @@
--- ---
- name: Check mariadb containers - import_role:
become: true name: service-check-containers
kolla_container:
action: "compare_container"
common_options: "{{ docker_common_options }}"
name: "{{ item.value.container_name }}"
image: "{{ item.value.image }}"
volumes: "{{ item.value.volumes }}"
dimensions: "{{ item.value.dimensions }}"
environment: "{{ item.value.environment | default(omit) }}"
healthcheck: "{{ item.value.healthcheck | default(omit) }}"
with_dict: "{{ mariadb_services | select_services_enabled_and_mapped_to_host }}"
notify:
- "Restart {{ item.key }} container"

View File

@ -1,15 +1,3 @@
--- ---
- name: Check masakari containers - import_role:
become: true name: service-check-containers
kolla_container:
action: "compare_container"
common_options: "{{ docker_common_options }}"
name: "{{ item.value.container_name }}"
image: "{{ item.value.image }}"
ipc_mode: "{{ item.value.ipc_mode | default(omit) }}"
privileged: "{{ item.value.privileged | default(False) }}"
volumes: "{{ item.value.volumes | reject('equalto', '') | list }}"
dimensions: "{{ item.value.dimensions }}"
with_dict: "{{ masakari_services | select_services_enabled_and_mapped_to_host }}"
notify:
- Restart {{ item.key }} container

View File

@ -1,15 +1,3 @@
--- ---
- name: Check memcached container - import_role:
vars: name: service-check-containers
service: "{{ memcached_services.memcached }}"
become: true
kolla_container:
action: "compare_container"
common_options: "{{ docker_common_options }}"
name: "{{ service.container_name }}"
image: "{{ service.image }}"
volumes: "{{ service.volumes }}"
dimensions: "{{ service.dimensions }}"
healthcheck: "{{ service.healthcheck | default(omit) }}"
when: service | service_enabled_and_mapped_to_host
notify: Restart memcached container

View File

@ -1,14 +1,3 @@
--- ---
- name: Check mistral containers - import_role:
become: true name: service-check-containers
kolla_container:
action: "compare_container"
common_options: "{{ docker_common_options }}"
name: "{{ item.value.container_name }}"
image: "{{ item.value.image }}"
volumes: "{{ item.value.volumes | reject('equalto', '') | list }}"
dimensions: "{{ item.value.dimensions }}"
healthcheck: "{{ item.value.healthcheck | default(omit) }}"
with_dict: "{{ mistral_services | select_services_enabled_and_mapped_to_host }}"
notify:
- "Restart {{ item.key }} container"

View File

@ -1,14 +1,3 @@
--- ---
- name: Check multipathd containers - import_role:
become: true name: service-check-containers
kolla_container:
action: "compare_container"
common_options: "{{ docker_common_options }}"
name: "{{ item.value.container_name }}"
image: "{{ item.value.image }}"
ipc_mode: "{{ item.value.ipc_mode }}"
privileged: "{{ item.value.privileged | default(False) }}"
volumes: "{{ item.value.volumes }}"
with_dict: "{{ multipathd_services | select_services_enabled_and_mapped_to_host }}"
notify:
- "Restart {{ item.key }} container"

View File

@ -1,16 +1,3 @@
--- ---
- name: Check neutron containers - import_role:
become: true name: service-check-containers
kolla_container:
action: "compare_container"
common_options: "{{ docker_common_options }}"
name: "{{ item.value.container_name }}"
image: "{{ item.value.image }}"
privileged: "{{ item.value.privileged | default(False) }}"
volumes: "{{ item.value.volumes }}"
dimensions: "{{ item.value.dimensions }}"
environment: "{{ item.value.environment | default(omit) }}"
healthcheck: "{{ item.value.healthcheck | default(omit) }}"
with_dict: "{{ neutron_services | select_services_enabled_and_mapped_to_host }}"
notify:
- "Restart {{ item.key }} container"

View File

@ -1,4 +1,6 @@
--- ---
project_name: "nova"
nova_cell_services: nova_cell_services:
nova-libvirt: nova-libvirt:
container_name: nova_libvirt container_name: nova_libvirt

View File

@ -1,19 +1,3 @@
--- ---
- name: Check nova-cell containers - import_role:
become: true name: service-check-containers
kolla_container:
action: "compare_container"
common_options: "{{ docker_common_options }}"
name: "{{ item.value.container_name }}"
image: "{{ item.value.image }}"
environment: "{{ item.value.environment | default(omit) }}"
pid_mode: "{{ item.value.pid_mode | default('') }}"
cgroupns_mode: "{{ item.value.cgroupns_mode | default(omit) }}"
ipc_mode: "{{ item.value.ipc_mode | default(omit) }}"
privileged: "{{ item.value.privileged | default(False) }}"
volumes: "{{ item.value.volumes | reject('equalto', '') | list }}"
dimensions: "{{ item.value.dimensions }}"
healthcheck: "{{ item.value.healthcheck | default(omit) }}"
with_dict: "{{ nova_cell_services | select_services_enabled_and_mapped_to_host }}"
notify:
- "Restart {{ item.key }} container"

View File

@ -61,8 +61,6 @@
- inventory_hostname in groups[nova_cell_compute_group] - inventory_hostname in groups[nova_cell_compute_group]
- nova_backend == "rbd" - nova_backend == "rbd"
- external_ceph_cephx_enabled | bool - external_ceph_cephx_enabled | bool
notify:
- Restart {{ item }} container
- name: Copy over ceph cinder keyring file - name: Copy over ceph cinder keyring file
template: template:
@ -78,8 +76,6 @@
- inventory_hostname in groups[nova_cell_compute_group] - inventory_hostname in groups[nova_cell_compute_group]
- nova_backend == "rbd" - nova_backend == "rbd"
- external_ceph_cephx_enabled | bool - external_ceph_cephx_enabled | bool
notify:
- Restart {{ item }} container
- name: Copy over ceph.conf - name: Copy over ceph.conf
vars: vars:
@ -100,8 +96,6 @@
when: when:
- service | service_enabled_and_mapped_to_host - service | service_enabled_and_mapped_to_host
- nova_backend == "rbd" - nova_backend == "rbd"
notify:
- Restart {{ item }} container
- block: - block:
- name: Ensure /etc/ceph directory exists (host libvirt) - name: Ensure /etc/ceph directory exists (host libvirt)

View File

@ -1,18 +1,3 @@
--- ---
- name: Check nova containers - import_role:
become: true name: service-check-containers
kolla_container:
action: "compare_container"
common_options: "{{ docker_common_options }}"
name: "{{ item.value.container_name }}"
image: "{{ item.value.image }}"
environment: "{{ item.value.environment | default(omit) }}"
pid_mode: "{{ item.value.pid_mode | default('') }}"
ipc_mode: "{{ item.value.ipc_mode | default(omit) }}"
privileged: "{{ item.value.privileged | default(False) }}"
volumes: "{{ item.value.volumes | reject('equalto', '') | list }}"
dimensions: "{{ item.value.dimensions }}"
healthcheck: "{{ item.value.healthcheck | default(omit) }}"
with_dict: "{{ nova_services | select_services_enabled_and_mapped_to_host }}"
notify:
- "Restart {{ item.key }} container"

View File

@ -1,14 +1,3 @@
--- ---
- name: Check octavia containers - import_role:
become: true name: service-check-containers
kolla_container:
action: "compare_container"
common_options: "{{ docker_common_options }}"
name: "{{ item.value.container_name }}"
image: "{{ item.value.image }}"
volumes: "{{ item.value.volumes }}"
dimensions: "{{ item.value.dimensions }}"
healthcheck: "{{ item.value.healthcheck | default(omit) }}"
with_dict: "{{ octavia_services | select_services_enabled_and_mapped_to_host }}"
notify:
- "Restart {{ item.key }} container"

View File

@ -1,15 +1,3 @@
--- ---
- name: Check opensearch containers - import_role:
become: true name: service-check-containers
kolla_container:
action: "compare_container"
common_options: "{{ docker_common_options }}"
dimensions: "{{ item.value.dimensions }}"
environment: "{{ item.value.environment | default(omit) }}"
healthcheck: "{{ item.value.healthcheck | default(omit) }}"
name: "{{ item.value.container_name }}"
image: "{{ item.value.image }}"
volumes: "{{ item.value.volumes }}"
with_dict: "{{ opensearch_services | select_services_enabled_and_mapped_to_host }}"
notify:
- "Restart {{ item.key }} container"

View File

@ -1,15 +1,3 @@
--- ---
- name: Check openvswitch containers - import_role:
become: true name: service-check-containers
kolla_container:
action: "compare_container"
common_options: "{{ docker_common_options }}"
name: "{{ item.value.container_name }}"
image: "{{ item.value.image }}"
privileged: "{{ item.value.privileged | default(False) }}"
volumes: "{{ item.value.volumes }}"
dimensions: "{{ item.value.dimensions }}"
healthcheck: "{{ item.value.healthcheck }}"
with_dict: "{{ openvswitch_services | select_services_enabled_and_mapped_to_host }}"
notify:
- "Restart {{ item.key }} container"

View File

@ -1,13 +1,3 @@
--- ---
- name: Check ovn-controller containers - import_role:
become: true name: service-check-containers
kolla_container:
action: "compare_container"
common_options: "{{ docker_common_options }}"
name: "{{ item.value.container_name }}"
image: "{{ item.value.image }}"
volumes: "{{ item.value.volumes | reject('equalto', '') | list }}"
dimensions: "{{ item.value.dimensions }}"
with_dict: "{{ ovn_controller_services | select_services_enabled_and_mapped_to_host }}"
notify:
- Restart {{ item.key }} container

View File

@ -1,13 +1,3 @@
--- ---
- name: Check ovn containers - import_role:
become: true name: service-check-containers
kolla_container:
action: "compare_container"
common_options: "{{ docker_common_options }}"
name: "{{ item.value.container_name }}"
image: "{{ item.value.image }}"
volumes: "{{ item.value.volumes | reject('equalto', '') | list }}"
dimensions: "{{ item.value.dimensions }}"
with_dict: "{{ ovn_db_services | select_services_enabled_and_mapped_to_host }}"
notify:
- Restart {{ item.key }} container

View File

@ -1,14 +1,3 @@
--- ---
- name: Check ovs containers - import_role:
become: true name: service-check-containers
kolla_container:
action: "compare_container"
common_options: "{{ docker_common_options }}"
name: "{{ item.value.container_name }}"
image: "{{ item.value.image }}"
privileged: "{{ item.value.privileged | default(False) }}"
volumes: "{{ item.value.volumes }}"
dimensions: "{{ item.value.dimensions }}"
with_dict: "{{ ovsdpdk_services | select_services_enabled_and_mapped_to_host }}"
notify:
- "Restart {{ item.key }} container"

View File

@ -1,18 +1,3 @@
--- ---
- name: Check placement containers - import_role:
become: true name: service-check-containers
kolla_container:
action: "compare_container"
common_options: "{{ docker_common_options }}"
name: "{{ item.value.container_name }}"
image: "{{ item.value.image }}"
environment: "{{ item.value.environment | default(omit) }}"
pid_mode: "{{ item.value.pid_mode | default('') }}"
ipc_mode: "{{ item.value.ipc_mode | default(omit) }}"
privileged: "{{ item.value.privileged | default(False) }}"
volumes: "{{ item.value.volumes | reject('equalto', '') | list }}"
dimensions: "{{ item.value.dimensions }}"
healthcheck: "{{ item.value.healthcheck | default(omit) }}"
with_dict: "{{ placement_services | select_services_enabled_and_mapped_to_host }}"
notify:
- "Restart {{ item.key }} container"

View File

@ -1,15 +1,3 @@
--- ---
- name: Check prometheus containers - import_role:
become: true name: service-check-containers
kolla_container:
action: "compare_container"
common_options: "{{ docker_common_options }}"
name: "{{ item.value.container_name }}"
image: "{{ item.value.image }}"
pid_mode: "{{ item.value.pid_mode | default('') }}"
volumes: "{{ item.value.volumes }}"
dimensions: "{{ item.value.dimensions }}"
environment: "{{ item.value.environment | default(omit) }}"
with_dict: "{{ prometheus_services | select_services_enabled_and_mapped_to_host }}"
notify:
- "Restart {{ item.key }} container"

View File

@ -1,15 +1,3 @@
--- ---
- name: Check rabbitmq containers - import_role:
become: true name: service-check-containers
kolla_container:
action: "compare_container"
common_options: "{{ docker_common_options }}"
name: "{{ item.value.container_name }}"
image: "{{ item.value.image }}"
volumes: "{{ item.value.volumes }}"
environment: "{{ item.value.environment }}"
dimensions: "{{ item.value.dimensions }}"
healthcheck: "{{ item.value.healthcheck | default(omit) }}"
with_dict: "{{ rabbitmq_services | select_services_enabled_and_mapped_to_host }}"
notify:
- Restart rabbitmq container

View File

@ -1,15 +1,3 @@
--- ---
- name: Check redis containers - import_role:
become: true name: service-check-containers
kolla_container:
action: "compare_container"
common_options: "{{ docker_common_options }}"
name: "{{ item.value.container_name }}"
image: "{{ item.value.image }}"
environment: "{{ item.environment | default(omit) }}"
volumes: "{{ item.value.volumes }}"
dimensions: "{{ item.value.dimensions }}"
healthcheck: "{{ item.value.healthcheck | default(omit) }}"
with_dict: "{{ redis_services | select_services_enabled_and_mapped_to_host }}"
notify:
- "Restart {{ item.key }} container"

View File

@ -0,0 +1,30 @@
---
# NOTE(r-krcek): List of arguments should follow argument_spec in
# kolla_container module
- name: "{{ kolla_role_name | default(project_name) }} | Check containers"
become: true
vars:
service_name: "{{ item.key }}"
service: "{{ item.value }}"
kolla_container:
action: "compare_container"
common_options: "{{ docker_common_options }}"
name: "{{ service.container_name }}"
image: "{{ service.image | default(omit) }}"
volumes: "{{ service.volumes | default(omit) }}"
dimensions: "{{ service.dimensions | default(omit) }}"
tmpfs: "{{ service.tmpfs | default(omit) }}"
volumes_from: "{{ service.volumes_from | default(omit) }}"
privileged: "{{ service.privileged | default(omit) }}"
cap_add: "{{ service.cap_add | default(omit) }}"
environment: "{{ service.environment | default(omit) }}"
healthcheck: "{{ service.healthcheck | default(omit) }}"
ipc_mode: "{{ service.ipc_mode | default(omit) }}"
pid_mode: "{{ service.pid_mode | default(omit) }}"
security_opt: "{{ service.security_opt | default(omit) }}"
labels: "{{ service.labels | default(omit) }}"
command: "{{ service.command | default(omit) }}"
cgroupns_mode: "{{ service.cgroupns_mode | default(omit) }}"
with_dict: "{{ lookup('vars', (kolla_role_name | default(project_name)) + '_services') | select_services_enabled_and_mapped_to_host }}"
notify:
- "Restart {{ service_name }} container"

View File

@ -1,14 +1,3 @@
--- ---
- name: Check skyline container - import_role:
become: true name: service-check-containers
kolla_container:
action: "compare_container"
common_options: "{{ docker_common_options }}"
name: "{{ item.value.container_name }}"
image: "{{ item.value.image }}"
volumes: "{{ item.value.volumes | reject('equalto', '') | list }}"
dimensions: "{{ item.value.dimensions }}"
healthcheck: "{{ horizon.healthcheck | default(omit) }}"
with_dict: "{{ skyline_services | select_services_enabled_and_mapped_to_host }}"
notify:
- "Restart {{ item.key }} container"

View File

@ -1,14 +1,3 @@
--- ---
- name: Check tacker container - import_role:
become: true name: service-check-containers
kolla_container:
common_options: "{{ docker_common_options }}"
action: "compare_container"
name: "{{ item.value.container_name }}"
image: "{{ item.value.image }}"
volumes: "{{ item.value.volumes | reject('equalto', '') | list }}"
dimensions: "{{ item.value.dimensions }}"
healthcheck: "{{ item.value.healthcheck | default(omit) }}"
with_dict: "{{ tacker_services | select_services_enabled_and_mapped_to_host }}"
notify:
- "Restart {{ item.key }} container"

View File

@ -1,14 +1,3 @@
--- ---
- name: Check telegraf containers - import_role:
become: true name: service-check-containers
kolla_container:
action: "compare_container"
common_options: "{{ docker_common_options }}"
name: "{{ item.value.container_name }}"
image: "{{ item.value.image }}"
volumes: "{{ item.value.volumes }}"
pid_mode: "{{ item.value.pid_mode }}"
dimensions: "{{ item.value.dimensions }}"
with_dict: "{{ telegraf_services | select_services_enabled_and_mapped_to_host }}"
notify:
- "Restart {{ item.key }} container"

View File

@ -1,14 +1,3 @@
--- ---
- name: Check trove containers - import_role:
become: true name: service-check-containers
kolla_container:
action: "compare_container"
common_options: "{{ docker_common_options }}"
name: "{{ item.value.container_name }}"
image: "{{ item.value.image }}"
volumes: "{{ item.value.volumes | reject('equalto', '') | list }}"
dimensions: "{{ item.value.dimensions }}"
healthcheck: "{{ item.value.healthcheck | default(omit) }}"
with_dict: "{{ trove_services | select_services_enabled_and_mapped_to_host }}"
notify:
- "Restart {{ item.key }} container"

View File

@ -1,14 +1,3 @@
--- ---
- name: Check venus containers - import_role:
become: true name: service-check-containers
kolla_container:
action: "compare_container"
common_options: "{{ docker_common_options }}"
name: "{{ item.value.container_name }}"
image: "{{ item.value.image }}"
volumes: "{{ item.value.volumes | reject('equalto', '') | list }}"
dimensions: "{{ item.value.dimensions }}"
healthcheck: "{{ item.value.healthcheck | default(omit) }}"
with_dict: "{{ venus_services | select_services_enabled_and_mapped_to_host }}"
notify:
- "Restart {{ item.key }} container"

View File

@ -1,14 +1,3 @@
--- ---
- name: Check watcher containers - import_role:
become: true name: service-check-containers
kolla_container:
action: "compare_container"
common_options: "{{ docker_common_options }}"
name: "{{ item.value.container_name }}"
image: "{{ item.value.image }}"
volumes: "{{ item.value.volumes | reject('equalto', '') | list }}"
dimensions: "{{ item.value.dimensions }}"
healthcheck: "{{ item.value.healthcheck | default(omit) }}"
with_dict: "{{ watcher_services | select_services_enabled_and_mapped_to_host }}"
notify:
- "Restart {{ item.key }} container"

View File

@ -13,8 +13,6 @@
volumes: "{{ service.volumes | reject('equalto', '') | list }}" volumes: "{{ service.volumes | reject('equalto', '') | list }}"
dimensions: "{{ service.dimensions }}" dimensions: "{{ service.dimensions }}"
healthcheck: "{{ service.healthcheck | default(omit) }}" healthcheck: "{{ service.healthcheck | default(omit) }}"
listen:
- zun-api container changed
- name: Restart zun-wsproxy container - name: Restart zun-wsproxy container
vars: vars:
@ -30,8 +28,6 @@
volumes: "{{ service.volumes | reject('equalto', '') | list }}" volumes: "{{ service.volumes | reject('equalto', '') | list }}"
dimensions: "{{ service.dimensions }}" dimensions: "{{ service.dimensions }}"
healthcheck: "{{ service.healthcheck | default(omit) }}" healthcheck: "{{ service.healthcheck | default(omit) }}"
listen:
- zun-wsproxy container changed
- name: Restart zun-compute container - name: Restart zun-compute container
vars: vars:
@ -47,8 +43,6 @@
volumes: "{{ service.volumes | reject('equalto', '') | list }}" volumes: "{{ service.volumes | reject('equalto', '') | list }}"
dimensions: "{{ service.dimensions }}" dimensions: "{{ service.dimensions }}"
healthcheck: "{{ service.healthcheck | default(omit) }}" healthcheck: "{{ service.healthcheck | default(omit) }}"
listen:
- zun-compute container changed
- name: Restart zun-cni-daemon container - name: Restart zun-cni-daemon container
vars: vars:
@ -64,8 +58,6 @@
volumes: "{{ service.volumes | reject('equalto', '') | list }}" volumes: "{{ service.volumes | reject('equalto', '') | list }}"
dimensions: "{{ service.dimensions }}" dimensions: "{{ service.dimensions }}"
healthcheck: "{{ service.healthcheck | default(omit) }}" healthcheck: "{{ service.healthcheck | default(omit) }}"
listen:
- zun-cni-daemon container changed
- name: Copy loopback binary from zun-cni-daemon container to host - name: Copy loopback binary from zun-cni-daemon container to host
vars: vars:
@ -74,7 +66,6 @@
become: true become: true
command: "{{ kolla_container_engine }} cp {{ service.container_name }}:/opt/loopback /opt/cni/bin/" command: "{{ kolla_container_engine }} cp {{ service.container_name }}:/opt/loopback /opt/cni/bin/"
# NOTE(yoctozepto): it would be cleaner to listen only on image change # NOTE(yoctozepto): it would be cleaner to listen only on image change
# but there is no such mechanism (yet) and container change should be # but there is no such mechanism (yet)
# good enough (better than including config change triggers)
listen: listen:
- zun-cni-daemon container changed - Restart zun-cni-daemon container

View File

@ -1,18 +1,3 @@
--- ---
- name: Check zun containers - import_role:
become: true name: service-check-containers
kolla_container:
action: "compare_container"
common_options: "{{ docker_common_options }}"
name: "{{ item.value.container_name }}"
image: "{{ item.value.image }}"
privileged: "{{ item.value.privileged | default(False) }}"
volumes: "{{ item.value.volumes | reject('equalto', '') | list }}"
dimensions: "{{ item.value.dimensions }}"
healthcheck: "{{ item.value.healthcheck | default(omit) }}"
with_dict: "{{ zun_services | select_services_enabled_and_mapped_to_host }}"
notify:
# NOTE(yoctozepto): Zun differs from other projects because we want
# to differentiate between config change and container property
# change
- "{{ item.key }} container changed"

View File

@ -5,8 +5,6 @@
dest: "{{ node_config_directory }}/zun-compute/" dest: "{{ node_config_directory }}/zun-compute/"
mode: "0660" mode: "0660"
become: true become: true
notify:
- Restart zun-compute container
- name: Copy over Ceph keyring files for zun-compute - name: Copy over Ceph keyring files for zun-compute
copy: copy:
@ -15,8 +13,6 @@
mode: "0660" mode: "0660"
become: true become: true
when: external_ceph_cephx_enabled | bool when: external_ceph_cephx_enabled | bool
notify:
- Restart zun-compute container
- name: Ensuring config directory has correct owner and permission - name: Ensuring config directory has correct owner and permission
become: true become: true

View File

@ -0,0 +1,23 @@
---
features:
- |
Refactor services' check-containers and optimise
This might fix some hidden bugs where the check tasks forgot to
include params important for the service.
We also get a nice optimisation by using a filtered loop instead
of task skipping per service with 'when'. As proven in
https://review.opendev.org/c/openstack/kolla-ansible/+/914997
This refactoring allows for further optimisation and
fixing work to proceed with much less hassle. Including getting
rid of many notify statements as the restarts are now safely handled
by check-containers. Some notifies had to stay, because of special
edge cases eg. in rolling upgrades and loadbalancer config.
One downside is we remove the little optimisation for Zun that
ignored config change for copying loopback but this is an
acceptable tradeoff considering the benefits above.
`Blueprint performance-improvements <https://blueprints.launchpad.net/kolla-ansible/+spec/performance-improvements>`__