Filter excluded nodes from ansible delegates

This would allow external_(deploy/update/upgrade)_tasks
to honor excluded nodes during deploy/update/upgrade.

Depends-On: https://review.opendev.org/c/openstack/tripleo-common/+/856407
Change-Id: Ia9d3c8d0a3098191b2d8b12fc24eee4517c6c521
This commit is contained in:
Rabi Mishra 2022-09-08 12:21:18 +05:30 committed by Takashi Kajinami
parent 03c043242f
commit cc38db4c99
48 changed files with 58 additions and 58 deletions

View File

@ -387,4 +387,4 @@ outputs:
tripleo_containers_to_stop:
- aodh_api
- aodh_api_cron
tripleo_delegate_to: "{{ groups['aodh_api'] | default([]) }}"
tripleo_delegate_to: "{{ groups['aodh_api'] | difference(groups['excluded_overcloud']) }}"

View File

@ -153,4 +153,4 @@ outputs:
vars:
tripleo_containers_to_stop:
- aodh_evaluator
tripleo_delegate_to: "{{ groups['aodh_evaluator'] | default([]) }}"
tripleo_delegate_to: "{{ groups['aodh_evaluator'] | difference(groups['excluded_overcloud']) }}"

View File

@ -152,4 +152,4 @@ outputs:
vars:
tripleo_containers_to_stop:
- aodh_listener
tripleo_delegate_to: "{{ groups['aodh_listener'] | default([]) }}"
tripleo_delegate_to: "{{ groups['aodh_listener'] | difference(groups['excluded_overcloud']) }}"

View File

@ -153,4 +153,4 @@ outputs:
vars:
tripleo_containers_to_stop:
- aodh_notifier
tripleo_delegate_to: "{{ groups['aodh_notifier'] | default([]) }}"
tripleo_delegate_to: "{{ groups['aodh_notifier'] | difference(groups['excluded_overcloud']) }}"

View File

@ -849,4 +849,4 @@ outputs:
vars:
tripleo_containers_to_stop:
- barbican_api
tripleo_delegate_to: "{{ groups['barbican_api'] | default([]) }}"
tripleo_delegate_to: "{{ groups['barbican_api'] | difference(groups['excluded_overcloud']) }}"

View File

@ -196,4 +196,4 @@ outputs:
vars:
tripleo_containers_to_stop:
- ceilometer_agent_central
tripleo_delegate_to: "{{ groups['ceilometer_agent_central'] | default([]) }}"
tripleo_delegate_to: "{{ groups['ceilometer_agent_central'] | difference(groups['excluded_overcloud']) }}"

View File

@ -237,4 +237,4 @@ outputs:
vars:
tripleo_containers_to_stop:
- ceilometer_agent_notification
tripleo_delegate_to: "{{ groups['ceilometer_agent_notification'] | default([]) }}"
tripleo_delegate_to: "{{ groups['ceilometer_agent_notification'] | difference(groups['excluded_overcloud']) }}"

View File

@ -401,7 +401,7 @@ outputs:
block: &cinder_online_db_migration
- name: Online data migration for Cinder
command: "{{ container_cli }} exec cinder_api cinder-manage db online_data_migrations"
delegate_to: "{{ groups['cinder_api'][0] }}"
delegate_to: "{{ (groups['cinder_api'] | difference(groups['excluded_overcloud']))[0] }}"
become: true
tags:
- online_upgrade
@ -419,7 +419,7 @@ outputs:
tripleo_containers_to_stop:
- cinder_api
- cinder_api_cron
tripleo_delegate_to: "{{ groups['cinder_api'] | default([]) }}"
tripleo_delegate_to: "{{ groups['cinder_api'] | difference(groups['excluded_overcloud']) }}"
external_update_tasks:
- when: step|int == 1
block: *cinder_online_db_migration

View File

@ -331,4 +331,4 @@ outputs:
vars:
tripleo_containers_to_stop:
- cinder_backup
tripleo_delegate_to: "{{ groups['cinder_backup'] | default([]) }}"
tripleo_delegate_to: "{{ groups['cinder_backup'] | difference(groups['excluded_overcloud']) }}"

View File

@ -180,4 +180,4 @@ outputs:
vars:
tripleo_containers_to_stop:
- cinder_scheduler
tripleo_delegate_to: "{{ groups['cinder_scheduler'] | default([]) }}"
tripleo_delegate_to: "{{ groups['cinder_scheduler'] | difference(groups['excluded_overcloud']) }}"

View File

@ -370,4 +370,4 @@ outputs:
vars:
tripleo_containers_to_stop:
- cinder_volume
tripleo_delegate_to: "{{ groups['cinder_volume'] | default([]) }}"
tripleo_delegate_to: "{{ groups['cinder_volume'] | difference(groups['excluded_overcloud']) }}"

View File

@ -318,4 +318,4 @@ outputs:
- - if:
- {get_param: EnableInternalTLS}
- - redis_tls_proxy
tripleo_delegate_to: "{{ groups['redis'] | default([]) }}"
tripleo_delegate_to: "{{ groups['redis'] | difference(groups['excluded_overcloud']) }}"

View File

@ -222,7 +222,7 @@ outputs:
delegate_facts: true
with_together:
- "{{ dns_listen_ips }}"
- "{{ groups.designate_bind }}"
- "{{ groups['designate_bind'] | difference(groups['excluded_overcloud']) }}"
- name: Configure ports to allow bind to collocate with other services listening on DNS ports
when:

View File

@ -878,6 +878,6 @@ outputs:
tripleo_containers_to_stop:
- glance_api
- glance_api_cron
tripleo_delegate_to: "{{ groups['glance_api'] | default([]) }}"
tripleo_delegate_to: "{{ groups['glance_api'] | difference(groups['excluded_overcloud']) }}"
deploy_steps_tasks:
get_attr: [TLSProxyBase, role_data, deploy_steps_tasks]

View File

@ -487,4 +487,4 @@ outputs:
vars:
tripleo_containers_to_stop:
- gnocchi_api
tripleo_delegate_to: "{{ groups['gnocchi_api'] | default([]) }}"
tripleo_delegate_to: "{{ groups['gnocchi_api'] | difference(groups['excluded_overcloud']) }}"

View File

@ -232,4 +232,4 @@ outputs:
vars:
tripleo_containers_to_stop:
- gnocchi_metricd
tripleo_delegate_to: "{{ groups['gnocchi_metricd'] | default([]) }}"
tripleo_delegate_to: "{{ groups['gnocchi_metricd'] | difference(groups['excluded_overcloud']) }}"

View File

@ -224,4 +224,4 @@ outputs:
vars:
tripleo_containers_to_stop:
- gnocchi_statsd
tripleo_delegate_to: "{{ groups['gnocchi_statsd'] | default([]) }}"
tripleo_delegate_to: "{{ groups['gnocchi_statsd'] | difference(groups['excluded_overcloud']) }}"

View File

@ -369,7 +369,7 @@ outputs:
vars:
tripleo_containers_to_stop:
- haproxy
tripleo_delegate_to: "{{ groups['haproxy'] | default([]) }}"
tripleo_delegate_to: "{{ groups['haproxy'] | difference(groups['excluded_overcloud']) }}"
host_prep_tasks:
list_concat:
- {get_attr: [HAProxyPublicTLS, role_data, host_prep_tasks]}

View File

@ -251,4 +251,4 @@ outputs:
vars:
tripleo_containers_to_stop:
- heat_api_cfn
tripleo_delegate_to: "{{ groups['heat_api_cfn'] | default([]) }}"
tripleo_delegate_to: "{{ groups['heat_api_cfn'] | difference(groups['excluded_overcloud']) }}"

View File

@ -325,4 +325,4 @@ outputs:
tripleo_containers_to_stop:
- heat_api
- heat_api_cron
tripleo_delegate_to: "{{ groups['heat_api'] | default([]) }}"
tripleo_delegate_to: "{{ groups['heat_api'] | difference(groups['excluded_overcloud']) }}"

View File

@ -322,4 +322,4 @@ outputs:
vars:
tripleo_containers_to_stop:
- heat_engine
tripleo_delegate_to: "{{ groups['heat_engine'] | default([]) }}"
tripleo_delegate_to: "{{ groups['heat_engine'] | | difference(groups['excluded_overcloud']) }}"

View File

@ -421,4 +421,4 @@ outputs:
vars:
tripleo_containers_to_stop:
- horizon
tripleo_delegate_to: "{{ groups['horizon'] | default([]) }}"
tripleo_delegate_to: "{{ groups['horizon'] | difference(groups['excluded_overcloud']) }}"

View File

@ -105,7 +105,7 @@ outputs:
tripleo_ipa_delegate_server: "{{ item }}"
tripleo_ipa_base_server_fqdn: "{{ hostvars[item]['fqdn_canonical'] }}"
tripleo_ipa_server_metadata: "{{ hostvars[item]['service_metadata_settings'] | to_json }}"
loop: "{{ groups.ipaservice }}"
loop: "{{ groups['ipaservice'] | difference(groups['excluded_overcloud']) }}"
- include_role:
name: tripleo_ipa_dns
vars:
@ -132,14 +132,14 @@ outputs:
stat:
path: /etc/ipa/default.conf
register: ipa_conf_exists
loop: "{{ groups.ipaservice }}"
loop: "{{ groups['ipaservice'] | difference(groups['excluded_overcloud']) }}"
- name: install openssl-perl
delegate_to: "{{ item }}"
become: true
package:
name: openssl-perl
state: present
loop: "{{ groups.ipaservice }}"
loop: "{{ groups['ipaservice'] | difference(groups['excluded_overcloud']) }}"
when:
- ipaclient_install_packages|bool
- name: register as an ipa client
@ -173,7 +173,7 @@ outputs:
when:
- idm_enroll_base_server|bool
- not outer_item.1.stat.exists
loop: "{{ groups.ipaservice|zip(ipa_conf_exists.results)|list }}"
loop: "{{ groups['ipaservice']|zip(ipa_conf_exists.results)|list | difference(groups['excluded_overcloud']) }}"
loop_control:
loop_var: outer_item
- name: restart certmonger service
@ -186,7 +186,7 @@ outputs:
when:
- idm_enroll_base_server|bool
- not item.1.stat.exists
loop: "{{ groups.ipaservice|zip(ipa_conf_exists.results)|list }}"
loop: "{{ groups['ipaservice']|zip(ipa_conf_exists.results)|list | difference(groups['excluded_overcloud']) }}"
- name: set discovered ipa realm
delegate_to: "{{ item }}"
delegate_facts: true
@ -200,7 +200,7 @@ outputs:
yaql:
expression: $.data.toUpper()
data: {get_param: IdMDomain}
loop: "{{ groups.ipaservice }}"
loop: "{{ groups['ipaservice'] | difference(groups['excluded_overcloud']) }}"
scale_tasks:
- when: step|int == 1
tags: down

View File

@ -90,7 +90,7 @@ outputs:
delegate_facts: true
no_log: "{{ hide_sensitive_logs | bool }}"
with_items:
- "{{ groups.ipsec }}"
- "{{ groups['ipsec'] | difference(groups['excluded_overcloud']) }}"
deploy_steps_tasks:
- name: IPSEC configuration on step 1
when: step|int == 1

View File

@ -390,7 +390,7 @@ outputs:
block: &ironic_online_db_migration
- name: Online data migration for Ironic
command: "{{ container_cli }} exec ironic_api ironic-dbsync --config-file /etc/ironic/ironic.conf online_data_migrations"
delegate_to: "{{ groups['ironic_api'][0] }}"
delegate_to: "{{ (groups['ironic_api'] | difference(groups['excluded_overcloud']))[0] }}"
become: true
tags:
- online_upgrade
@ -408,7 +408,7 @@ outputs:
vars:
tripleo_containers_to_stop:
- ironic_api
tripleo_delegate_to: "{{ groups['ironic_api'] | default([]) }}"
tripleo_delegate_to: "{{ groups['ironic_api'] | difference(groups['excluded_overcloud']) }}"
external_update_tasks:
- when: step|int == 1
block: *ironic_online_db_migration

View File

@ -761,4 +761,4 @@ outputs:
vars:
tripleo_containers_to_stop:
- ironic_conductor
tripleo_delegate_to: "{{ groups['ironic_conductor'] | default([]) }}"
tripleo_delegate_to: "{{ groups['ironic_conductor'] | difference(groups['excluded_overcloud']) }}"

View File

@ -622,4 +622,4 @@ outputs:
tripleo_containers_to_stop:
- ironic_inspector
- ironic_inspector_dnsmasq
tripleo_delegate_to: "{{ groups['ironic_inspector'] | default([]) }}"
tripleo_delegate_to: "{{ groups['ironic_inspector'] | difference(groups['excluded_overcloud']) }}"

View File

@ -205,4 +205,4 @@ outputs:
tripleo_containers_to_stop:
- ironic_pxe_tftp
- ironic_pxe_http
tripleo_delegate_to: "{{ groups['ironic_pxe'] | default([]) }}"
tripleo_delegate_to: "{{ groups['ironic_pxe'] | difference(groups['excluded_overcloud']) }}"

View File

@ -923,4 +923,4 @@ outputs:
tripleo_containers_to_stop:
- keystone
- keystone_cron
tripleo_delegate_to: "{{ groups['keystone'] | default([]) }}"
tripleo_delegate_to: "{{ groups['keystone'] | difference(groups['excluded_overcloud']) }}"

View File

@ -195,4 +195,4 @@ outputs:
vars:
tripleo_containers_to_stop:
- logrotate_crond
tripleo_delegate_to: "{{ groups['logrotate_crond'] | default([]) }}"
tripleo_delegate_to: "{{ groups['logrotate_crond'] | difference(groups['excluded_overcloud']) }}"

View File

@ -401,4 +401,4 @@ outputs:
vars:
tripleo_containers_to_stop:
- manila_api
tripleo_delegate_to: "{{ groups['manila_api'] | default([]) }}"
tripleo_delegate_to: "{{ groups['manila_api'] | difference(groups['excluded_overcloud']) }}"

View File

@ -146,4 +146,4 @@ outputs:
vars:
tripleo_containers_to_stop:
- manila_scheduler
tripleo_delegate_to: "{{ groups['manila_scheduler'] | default([]) }}"
tripleo_delegate_to: "{{ groups['manila_scheduler'] | difference(groups['excluded_overcloud']) }}"

View File

@ -231,4 +231,4 @@ outputs:
vars:
tripleo_containers_to_stop:
- manila_share
tripleo_delegate_to: "{{ groups['manila_share'] | default([]) }}"
tripleo_delegate_to: "{{ groups['manila_share'] | difference(groups['excluded_overcloud']) }}"

View File

@ -389,4 +389,4 @@ outputs:
vars:
tripleo_containers_to_stop:
- memcached
tripleo_delegate_to: "{{ groups['memcached'] | default([]) }}"
tripleo_delegate_to: "{{ groups['memcached'] | difference(groups['excluded_overcloud']) }}"

View File

@ -666,4 +666,4 @@ outputs:
vars:
tripleo_containers_to_stop:
- neutron_api
tripleo_delegate_to: "{{ groups['neutron_api'] | default([]) }}"
tripleo_delegate_to: "{{ groups['neutron_api'] | difference(groups['excluded_overcloud']) }}"

View File

@ -708,4 +708,4 @@ outputs:
tripleo_containers_to_stop:
- nova_api
- nova_api_cron
tripleo_delegate_to: "{{ groups['nova_api'] | default([]) }}"
tripleo_delegate_to: "{{ groups['nova_api'] | difference(groups['excluded_overcloud']) }}"

View File

@ -249,7 +249,7 @@ outputs:
block: &nova_online_db_migration
- name: Online data migration for Nova
command: "{{ container_cli }} exec nova_conductor nova-manage db online_data_migrations"
delegate_to: "{{ groups['nova_conductor'][0] }}"
delegate_to: "{{ (groups['nova_conductor'] | difference(groups['excluded_overcloud']))[0] }}"
become: true
tags:
- online_upgrade
@ -267,7 +267,7 @@ outputs:
vars:
tripleo_containers_to_stop:
- nova_conductor
tripleo_delegate_to: "{{ groups['nova_conductor'] | default([]) }}"
tripleo_delegate_to: "{{ groups['nova_conductor'] | difference(groups['excluded_overcloud']) }}"
external_update_tasks:
- when: step|int == 1
block: *nova_online_db_migration

View File

@ -246,4 +246,4 @@ outputs:
vars:
tripleo_containers_to_stop:
- nova_compute
tripleo_delegate_to: "{{ groups['nova_ironic'] | default([]) }}"
tripleo_delegate_to: "{{ groups['nova_ironic'] | difference(groups['excluded_overcloud']) }}"

View File

@ -312,4 +312,4 @@ outputs:
vars:
tripleo_containers_to_stop:
- nova_metadata
tripleo_delegate_to: "{{ groups['nova_metadata'] | default([]) }}"
tripleo_delegate_to: "{{ groups['nova_metadata'] | difference(groups['excluded_overcloud']) }}"

View File

@ -339,4 +339,4 @@ outputs:
vars:
tripleo_containers_to_stop:
- nova_scheduler
tripleo_delegate_to: "{{ groups['nova_scheduler'] | default([]) }}"
tripleo_delegate_to: "{{ groups['nova_scheduler'] | difference(groups['excluded_overcloud']) }}"

View File

@ -428,5 +428,5 @@ outputs:
vars:
tripleo_containers_to_stop:
- nova_vnc_proxy
tripleo_delegate_to: "{{ groups['nova_vnc_proxy'] | default([]) }}"
tripleo_delegate_to: "{{ groups['nova_vnc_proxy'] | difference(groups['excluded_overcloud']) }}"

View File

@ -493,4 +493,4 @@ outputs:
vars:
tripleo_containers_to_stop:
- octavia_api
tripleo_delegate_to: "{{ groups['octavia_api'] | default([]) }}"
tripleo_delegate_to: "{{ groups['octavia_api'] | difference(groups['excluded_overcloud']) }}"

View File

@ -231,4 +231,4 @@ outputs:
vars:
tripleo_containers_to_stop:
- octavia_health_manager
tripleo_delegate_to: "{{ groups['octavia_health_manager'] | default([]) }}"
tripleo_delegate_to: "{{ groups['octavia_health_manager'] | difference(groups['excluded_overcloud']) }}"

View File

@ -183,4 +183,4 @@ outputs:
vars:
tripleo_containers_to_stop:
- octavia_housekeeping
tripleo_delegate_to: "{{ groups['octavia_housekeeping'] | default([]) }}"
tripleo_delegate_to: "{{ groups['octavia_housekeeping'] | difference(groups['excluded_overcloud']) }}"

View File

@ -186,4 +186,4 @@ outputs:
vars:
tripleo_containers_to_stop:
- octavia_worker
tripleo_delegate_to: "{{ groups['octavia_worker'] | default([]) }}"
tripleo_delegate_to: "{{ groups['octavia_worker'] | difference(groups['excluded_overcloud']) }}"

View File

@ -465,7 +465,7 @@ outputs:
when: step|int == 1
tags: ovn
become: true
loop: "{{ groups['ovn_controller'] }}"
loop: "{{ groups['ovn_controller'] | difference(groups['excluded_overcloud']) }}"
delegate_to: "{{ item }}"
async: {get_param: OVNControllerUpdateTimeout}
poll: 0

View File

@ -145,4 +145,4 @@ outputs:
vars:
tripleo_containers_to_stop:
- clustercheck
tripleo_delegate_to: "{{ groups['clustercheck'] | default([]) }}"
tripleo_delegate_to: "{{ groups['clustercheck'] | difference(groups['excluded_overcloud']) }}"

View File

@ -230,7 +230,7 @@ outputs:
cluster_recreate: "{{ tripleo_transfer_flag_stat.stat.exists|bool }}"
- name: Check pacemaker cluster running before upgrade
tags: validation
# NOTE: We are intentionally not using the community version of
# NOTE: We are intentionally not using the community version of
# pacemaker_cluster here due to variances between the two:
# https://bugs.launchpad.net/tripleo/+bug/1938967
pacemaker_cluster: state=online check_and_fail=true
@ -334,11 +334,11 @@ outputs:
/usr/sbin/pcs cluster stop --force
fi
delegate_to: "{{ item }}"
with_items: "{{ groups['pacemaker'] | default([]) }}"
with_items: "{{ groups['pacemaker'] | difference(groups['excluded_overcloud']) }}"
update_tasks:
- name: Check pacemaker cluster running before the minor update
when: step|int == 0 # TODO(marios) disabling validations?
# NOTE: We are intentionally not using the community version of
# NOTE: We are intentionally not using the community version of
# pacemaker_cluster here due to variances between the two:
# https://bugs.launchpad.net/tripleo/+bug/1938967
pacemaker_cluster: state=online check_and_fail=true