Set changed_when to false for group_by tasks

This trivial patch is just turning off ansible
changed report for group_by tasks as it could
be confusing for user.

Change-Id: I7512af573782359a6f01290a55291ac7eb0de867
This commit is contained in:
Michal Arbet 2021-03-10 18:06:02 +01:00
parent 067a752206
commit 209dc1e9dc
6 changed files with 10 additions and 0 deletions

View File

@ -10,6 +10,7 @@
- name: Group hosts to determine when using --limit - name: Group hosts to determine when using --limit
group_by: group_by:
key: "all_using_limit_{{ (ansible_play_batch | length) != (groups['all'] | length) }}" key: "all_using_limit_{{ (ansible_play_batch | length) != (groups['all'] | length) }}"
changed_when: false
tags: always tags: always
# NOTE(pbourke): This case covers deploying subsets of hosts using --limit. The # NOTE(pbourke): This case covers deploying subsets of hosts using --limit. The

View File

@ -24,6 +24,7 @@
re_safe_address: "{{ kolla_internal_vip_address | regex_escape }}" re_safe_address: "{{ kolla_internal_vip_address | regex_escape }}"
group_by: group_by:
key: kolla_ha_is_master_{{ ip_addr_output.stdout is regex('\b' + re_safe_address + '\b') }} key: kolla_ha_is_master_{{ ip_addr_output.stdout is regex('\b' + re_safe_address + '\b') }}
changed_when: false
when: when:
- kolla_action != "config" - kolla_action != "config"
listen: listen:

View File

@ -16,6 +16,7 @@
- name: Group hosts by whether they are running keepalived - name: Group hosts by whether they are running keepalived
group_by: group_by:
key: "keepalived_running_{{ container_facts['keepalived'] is defined }}" key: "keepalived_running_{{ container_facts['keepalived'] is defined }}"
changed_when: false
when: when:
- enable_keepalived | bool - enable_keepalived | bool
- inventory_hostname in groups['haproxy'] - inventory_hostname in groups['haproxy']
@ -23,6 +24,7 @@
- name: Group hosts by whether they are running HAProxy - name: Group hosts by whether they are running HAProxy
group_by: group_by:
key: "haproxy_running_{{ container_facts['haproxy'] is defined }}" key: "haproxy_running_{{ container_facts['haproxy'] is defined }}"
changed_when: false
when: when:
- enable_haproxy | bool - enable_haproxy | bool
- inventory_hostname in groups['haproxy'] - inventory_hostname in groups['haproxy']

View File

@ -14,6 +14,7 @@
- name: Group nodes where keystone_fernet is running - name: Group nodes where keystone_fernet is running
group_by: group_by:
key: keystone_fernet_{{ container_facts['keystone_fernet'].State | default('bootstrap') }} key: keystone_fernet_{{ container_facts['keystone_fernet'].State | default('bootstrap') }}
changed_when: false
# NOTE(mgoddard): If we bootstrap Fernet keys on an existing cluster, this # NOTE(mgoddard): If we bootstrap Fernet keys on an existing cluster, this
# would overwrite existing keys, and invalidate tokens created from them. # would overwrite existing keys, and invalidate tokens created from them.

View File

@ -10,6 +10,7 @@
- name: Divide hosts by their MariaDB volume availability - name: Divide hosts by their MariaDB volume availability
group_by: group_by:
key: mariadb_had_volume_{{ mariadb_volume is not changed }} key: mariadb_had_volume_{{ mariadb_volume is not changed }}
changed_when: false
- name: Establish whether the cluster has already existed - name: Establish whether the cluster has already existed
set_fact: set_fact:
@ -29,6 +30,7 @@
- name: Divide hosts by their MariaDB service port liveness - name: Divide hosts by their MariaDB service port liveness
group_by: group_by:
key: mariadb_port_alive_{{ check_mariadb_port_liveness is success }} key: mariadb_port_alive_{{ check_mariadb_port_liveness is success }}
changed_when: false
- name: Fail on existing but stopped cluster - name: Fail on existing but stopped cluster
fail: fail:
@ -64,6 +66,7 @@
- name: Divide hosts by their MariaDB service WSREP sync status - name: Divide hosts by their MariaDB service WSREP sync status
group_by: group_by:
key: mariadb_sync_status_{{ mariadb_sync_status | default('NA') }} key: mariadb_sync_status_{{ mariadb_sync_status | default('NA') }}
changed_when: false
- name: Fail when MariaDB services are not synced across the whole cluster - name: Fail when MariaDB services are not synced across the whole cluster
fail: fail:

View File

@ -11,10 +11,12 @@
- name: Group hosts based on Kolla action - name: Group hosts based on Kolla action
group_by: group_by:
key: "kolla_action_{{ kolla_action }}" key: "kolla_action_{{ kolla_action }}"
changed_when: false
- name: Group hosts based on enabled services - name: Group hosts based on enabled services
group_by: group_by:
key: "{{ item }}" key: "{{ item }}"
changed_when: false
with_items: with_items:
- enable_aodh_{{ enable_aodh | bool }} - enable_aodh_{{ enable_aodh | bool }}
- enable_barbican_{{ enable_barbican | bool }} - enable_barbican_{{ enable_barbican | bool }}