merge task blocks if their execution is based on same conditions

Signed-off-by: Rishabh Dave <ridave@redhat.com>
pull/3764/head
Rishabh Dave 2019-03-28 14:17:26 +05:30 committed by mergify[bot]
parent e0beaf123a
commit 4241b6403f
2 changed files with 52 additions and 51 deletions

View File

@ -54,9 +54,12 @@
tags:
with_pkg
- name: red hat 7 based systems tasks
- name: red hat based systems tasks
when:
- ansible_os_family == 'RedHat'
block:
- name: red hat 7 based systems tasks
when:
- ansible_distribution_major_version == '7'
block:
- name: install python-docker-py on red hat / centos
@ -83,9 +86,8 @@
tags:
with_pkg
- name: red hat 8 based systems tasks
- name: red hat 8 based systems tasks
when:
- ansible_os_family == 'RedHat'
- ansible_distribution_major_version == '8'
block:
- name: install podman

View File

@ -62,7 +62,7 @@
- "{{ groups.get(mon_group_name) if groups.get(mgr_group_name, []) | length == 0 else groups.get(mgr_group_name, []) }}"
delegate_to: "{{ groups[mon_group_name][0] }}"
- name: copy keys to the ansible server
- name: copy keys to the ansible server
fetch:
src: "{{ item }}"
dest: "{{ fetch_directory }}/{{ fsid }}/{{ item }}"
@ -75,5 +75,4 @@
- /var/lib/ceph/bootstrap-rbd-mirror/{{ cluster }}.keyring
- /etc/ceph/{{ cluster }}.client.admin.keyring
when:
- cephx
- inventory_hostname == groups[mon_group_name] | last