purge-cluster: do not set group name vars at playbook level

This has the behavior of overriding custom values set in group_vars.
I've added defaults to the rest of the group names so that if they are
not overridden in group_vars then defaults will be used.

See: https://bugzilla.redhat.com/show_bug.cgi?id=1354700

Signed-off-by: Andrew Schoen <aschoen@redhat.com>
pull/1349/head
Andrew Schoen 2017-03-07 10:16:09 -06:00
parent 1a36e38a6d
commit 4fe6607004
1 changed files with 20 additions and 46 deletions

View File

@ -33,23 +33,14 @@
- name: gather facts on all hosts
vars:
mon_group_name: mons
osd_group_name: osds
mds_group_name: mdss
rgw_group_name: rgws
rbdmirror_group_name: rbd-mirrors
nfs_group_name: nfss
client_group_name: clients
hosts:
- "{{ mon_group_name }}"
- "{{ osd_group_name }}"
- "{{ mds_group_name }}"
- "{{ rgw_group_name }}"
- "{{ rbdmirror_group_name }}"
- "{{ nfs_group_name }}"
- "{{ client_group_name }}"
- "{{ mon_group_name|default('mons') }}"
- "{{ osd_group_name|default('osds') }}"
- "{{ mds_group_name|default('mdss') }}"
- "{{ rgw_group_name|default('rgws') }}"
- "{{ rbdmirror_group_name|default('rbdmirrors') }}"
- "{{ nfs_group_name|default('nfss') }}"
- "{{ client_group_name|default('clients') }}"
become: true
@ -62,7 +53,7 @@
mds_group_name: mdss
hosts:
- "{{ mds_group_name }}"
- "{{ mds_group_name|default('mdss') }}"
gather_facts: false # Already gathered previously
@ -93,7 +84,7 @@
rgw_group_name: rgws
hosts:
- "{{ rgw_group_name }}"
- "{{ rgw_group_name|default('rgws') }}"
gather_facts: false # Already gathered previously
@ -124,7 +115,7 @@
rbdmirror_group_name: rbd-mirrors
hosts:
- "{{ rbdmirror_group_name }}"
- "{{ rbdmirror_group_name|default('rbdmirrors') }}"
gather_facts: false # Already gathered previously
@ -150,7 +141,7 @@
nfs_group_name: nfss
hosts:
- "{{ nfs_group_name }}"
- "{{ nfs_group_name|default('nfss') }}"
gather_facts: false # Already gathered previously
@ -180,7 +171,7 @@
osd_group_name: osds
hosts:
- "{{ osd_group_name }}"
- "{{ osd_group_name|default('osds') }}"
gather_facts: false # Already gathered previously
@ -358,7 +349,7 @@
restapi_group_name: restapis
hosts:
- "{{ mon_group_name }}"
- "{{ mon_group_name|default('mons') }}"
gather_facts: false # Already gathered previously
@ -390,14 +381,6 @@
- name: final cleanup - check any running ceph, purge ceph packages, purge config and remove data
vars:
mon_group_name: mons
osd_group_name: osds
mds_group_name: mdss
rgw_group_name: rgws
rbdmirror_group_name: rbd-mirrors
nfs_group_name: nfss
client_group_name: clients
# When set to true both groups of packages are purged.
# This can cause problem with qemu-kvm
purge_all_packages: true
@ -423,13 +406,13 @@
- python-rbd
hosts:
- "{{ mon_group_name }}"
- "{{ osd_group_name }}"
- "{{ mds_group_name }}"
- "{{ rgw_group_name }}"
- "{{ rbdmirror_group_name }}"
- "{{ nfs_group_name }}"
- "{{ client_group_name }}"
- "{{ mon_group_name|default('mons') }}"
- "{{ osd_group_name|default('osds') }}"
- "{{ mds_group_name|default('mdss') }}"
- "{{ rgw_group_name|default('rgws') }}"
- "{{ rbdmirror_group_name|default('rbdmirrors') }}"
- "{{ nfs_group_name|default('nfss') }}"
- "{{ client_group_name|default('clients') }}"
gather_facts: false # Already gathered previously
@ -554,15 +537,6 @@
- name: purge fetch directory
vars:
mon_group_name: mons
osd_group_name: osds
mds_group_name: mdss
rgw_group_name: rgws
rbdmirror_group_name: rbdmirrors
nfs_group_name: nfss
restapi_group_name: restapis
hosts:
- localhost