Merge pull request #1349 from ceph/rhbz-1354700

purge-cluster: do not set group name vars at playbook level
pull/1355/head
Sébastien Han 2017-03-08 18:02:30 +01:00 committed by GitHub
commit 78631c3ccf
4 changed files with 63 additions and 252 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

View File

@ -46,21 +46,12 @@
- name: purge ceph mds cluster
vars:
mds_group_name: mdss
hosts:
- "{{ mds_group_name }}"
- "{{ mds_group_name|default('mdss') }}"
become: true
tasks:
- include_vars: roles/ceph-common/defaults/main.yml
- include_vars: roles/ceph-mds/defaults/main.yml
- include_vars: group_vars/all.yml
failed_when: false
- include_vars: group_vars/{{ mds_group_name }}.yml
failed_when: false
- name: disable ceph mds service
service:
@ -93,21 +84,12 @@
- name: purge ceph rgw cluster
vars:
rgw_group_name: rgws
hosts:
- "{{ rgw_group_name }}"
- "{{ rgw_group_name|default('rgws') }}"
become: true
tasks:
- include_vars: roles/ceph-common/defaults/main.yml
- include_vars: roles/ceph-rgw/defaults/main.yml
- include_vars: group_vars/all.yml
failed_when: false
- include_vars: group_vars/{{ rgw_group_name }}.yml
failed_when: false
- name: disable ceph rgw service
service:
@ -140,21 +122,12 @@
- name: purge ceph rbd-mirror cluster
vars:
rbdmirror_group_name: rbd-mirrors
hosts:
- "{{ rbdmirror_group_name }}"
- "{{ rbdmirror_group_name|default('rbdmirrors') }}"
become: true
tasks:
- include_vars: roles/ceph-common/defaults/main.yml
- include_vars: roles/ceph-rbd-mirror/defaults/main.yml
- include_vars: group_vars/all.yml
failed_when: false
- include_vars: group_vars/{{ rbdmirror_group_name }}.yml
failed_when: false
- name: disable ceph rbd-mirror service
service:
@ -187,21 +160,12 @@
- name: purge ceph nfs cluster
vars:
nfs_group_name: nfss
hosts:
- "{{ nfs_group_name }}"
- "{{ nfs_group_name|default('nfss') }}"
become: true
tasks:
- include_vars: roles/ceph-common/defaults/main.yml
- include_vars: roles/ceph-nfs/defaults/main.yml
- include_vars: group_vars/all.yml
failed_when: false
- include_vars: group_vars/{{ nfs_group_name }}.yml
failed_when: false
- name: disable ceph nfs service
service:
@ -243,21 +207,12 @@
- name: purge ceph osd cluster
vars:
osd_group_name: osds
hosts:
- "{{ osd_group_name }}"
- "{{ osd_group_name|default('osds') }}"
become: true
tasks:
- include_vars: roles/ceph-common/defaults/main.yml
- include_vars: roles/ceph-osd/defaults/main.yml
- include_vars: group_vars/all.yml
failed_when: false
- include_vars: group_vars/{{ osd_group_name }}.yml
failed_when: false
- name: disable ceph osd service
service:
@ -331,25 +286,12 @@
- name: purge ceph mon cluster
vars:
mon_group_name: mons
restapi_group_name: restapis
hosts:
- "{{ mon_group_name }}"
- "{{ mon_group_name|default('mons') }}"
become: true
tasks:
- include_vars: roles/ceph-common/defaults/main.yml
- include_vars: roles/ceph-mon/defaults/main.yml
- include_vars: roles/ceph-restapi/defaults/main.yml
- include_vars: group_vars/all.yml
failed_when: false
- include_vars: group_vars/{{ mon_group_name }}.yml
failed_when: false
- include_vars: group_vars/{{ restapi_group_name }}.yml
failed_when: false
- name: disable ceph mon service
service:
@ -389,21 +331,13 @@
- name: remove installed packages
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
hosts:
- "{{ mon_group_name }}"
- "{{ osd_group_name }}"
- "{{ mds_group_name }}"
- "{{ rgw_group_name }}"
- "{{ rbdmirror_group_name }}"
- "{{ nfs_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') }}"
become: true
@ -559,21 +493,13 @@
- name: purge ceph directories
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
hosts:
- "{{ mon_group_name }}"
- "{{ osd_group_name }}"
- "{{ mds_group_name }}"
- "{{ rgw_group_name }}"
- "{{ rbdmirror_group_name }}"
- "{{ nfs_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') }}"
gather_facts: false # Already gathered previously
@ -592,38 +518,17 @@
- name: purge fetch directory
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
restapi_group_name: restapis
hosts:
- localhost
gather_facts: false
tasks:
- include_vars: roles/ceph-common/defaults/main.yml
- include_vars: group_vars/all.yml
failed_when: false
- include_vars: group_vars/{{ mds_group_name }}.yml
failed_when: false
- include_vars: group_vars/{{ rgw_group_name }}.yml
failed_when: false
- include_vars: group_vars/{{ rbdmirror_group_name }}.yml
failed_when: false
- include_vars: group_vars/{{ nfs_group_name }}.yml
failed_when: false
- include_vars: group_vars/{{ osd_group_name }}.yml
failed_when: false
- include_vars: group_vars/{{ mon_group_name }}.yml
failed_when: false
- include_vars: group_vars/{{ restapi_group_name }}.yml
failed_when: false
- name: set fetch_directory value if not set
set_fact:
fetch_directory: "fetch/"
when: fetch_directory is not defined
- name: purge fetch directory for localhost
file:

View File

@ -34,17 +34,12 @@
- name: gather facts and check the init system
vars:
mon_group_name: mons
osd_group_name: osds
mds_group_name: mdss
rgw_group_name: rgws
hosts:
- "{{ mon_group_name }}"
- "{{ osd_group_name }}"
- "{{ mds_group_name }}"
- "{{ rgw_group_name }}"
- "{{ mon_group_name|default('mons') }}"
- "{{ osd_group_name|default('osds') }}"
- "{{ mds_group_name|default('mdss') }}"
- "{{ rgw_group_name|default('rgws') }}"
become: True
tasks:
@ -55,13 +50,12 @@
- name: upgrade ceph mon cluster
vars:
mon_group_name: mons
health_mon_check_retries: 5
health_mon_check_delay: 10
upgrade_ceph_packages: True
hosts:
- "{{ mon_group_name }}"
- "{{ mon_group_name|default('mons') }}"
serial: 1
become: True
@ -170,13 +164,12 @@
- name: upgrade ceph osds cluster
vars:
osd_group_name: osds
health_osd_check_retries: 40
health_osd_check_delay: 30
upgrade_ceph_packages: True
hosts:
- "{{ osd_group_name }}"
- "{{ osd_group_name|default('osds') }}"
serial: 1
become: True
@ -314,11 +307,10 @@
- name: upgrade ceph mdss cluster
vars:
mds_group_name: mdss
upgrade_ceph_packages: True
hosts:
- "{{ mds_group_name }}"
- "{{ mds_group_name|default('mdss') }}"
serial: 1
become: True
@ -387,11 +379,10 @@
- name: upgrade ceph rgws cluster
vars:
rgw_group_name: rgws
upgrade_ceph_packages: True
hosts:
- "{{ rgw_group_name }}"
- "{{ rgw_group_name|default('rgws') }}"
serial: 1
become: True

View File

@ -28,21 +28,13 @@
- name: make sure docker is present and started
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
hosts:
- "{{ mon_group_name }}"
- "{{ osd_group_name }}"
- "{{ mds_group_name }}"
- "{{ rgw_group_name }}"
- "{{ rbdmirror_group_name }}"
- "{{ nfs_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') }}"
become: true
@ -97,21 +89,12 @@
restapi_group_name: restapis
hosts:
- "{{ mon_group_name }}"
- "{{ mon_group_name|default('mons') }}"
serial: 1
become: true
tasks:
- include_vars: roles/ceph-common/defaults/main.yml
- include_vars: roles/ceph-mon/defaults/main.yml
- include_vars: roles/ceph-restapi/defaults/main.yml
- include_vars: group_vars/all.yml
failed_when: false
- include_vars: group_vars/{{ mon_group_name }}.yml
failed_when: false
- include_vars: group_vars/{{ restapi_group_name }}.yml
failed_when: false
- name: select a running monitor
set_fact: mon_host={{ item }}
@ -187,18 +170,12 @@
osd_group_name: osds
hosts:
- "{{ osd_group_name }}"
- "{{ osd_group_name|default('osds') }}"
serial: 1
become: true
tasks:
- include_vars: roles/ceph-common/defaults/main.yml
- include_vars: roles/ceph-osd/defaults/main.yml
- include_vars: group_vars/all.yml
failed_when: false
- include_vars: group_vars/{{ osd_group_name }}.yml
failed_when: false
- name: collect osd ids
shell: |
@ -288,22 +265,13 @@
- name: switching from non-containerized to containerized ceph mds
vars:
mds_group_name: mdss
hosts:
- "{{ mds_group_name }}"
- "{{ mds_group_name|default('mdss') }}"
serial: 1
become: true
tasks:
- include_vars: roles/ceph-common/defaults/main.yml
- include_vars: roles/ceph-mds/defaults/main.yml
- include_vars: group_vars/all.yml
failed_when: false
- include_vars: group_vars/{{ mds_group_name }}.yml
failed_when: false
- name: stop ceph mds service
service:
@ -348,22 +316,13 @@
- name: switching from non-containerized to containerized ceph rgw
vars:
rgw_group_name: rgws
hosts:
- "{{ rgw_group_name }}"
- "{{ rgw_group_name|default('rgws') }}"
serial: 1
become: true
tasks:
- include_vars: roles/ceph-common/defaults/main.yml
- include_vars: roles/ceph-rgw/defaults/main.yml
- include_vars: group_vars/all.yml
failed_when: false
- include_vars: group_vars/{{ rgw_group_name }}.yml
failed_when: false
- name: stop ceph rgw service
service:
@ -409,22 +368,13 @@
- name: switching from non-containerized to containerized ceph rbd-mirror
vars:
rbdmirror_group_name: rbd-mirrors
hosts:
- "{{ rbdmirror_group_name }}"
- "{{ rbdmirror_group_name|default('rbdmirrors') }}"
serial: 1
become: true
tasks:
- include_vars: roles/ceph-common/defaults/main.yml
- include_vars: roles/ceph-rbd-mirror/defaults/main.yml
- include_vars: group_vars/all.yml
failed_when: false
- include_vars: group_vars/{{ rbdmirror_group_name }}.yml
failed_when: false
- name: stop ceph rbd mirror service
service:
@ -468,22 +418,13 @@
- name: switching from non-containerized to containerized ceph nfs
vars:
nfs_group_name: nfss
hosts:
- "{{ nfs_group_name }}"
- "{{ nfs_group_name|default('nfss') }}"
serial: 1
become: true
tasks:
- include_vars: roles/ceph-common/defaults/main.yml
- include_vars: roles/ceph-nfs/defaults/main.yml
- include_vars: group_vars/all.yml
failed_when: false
- include_vars: group_vars/{{ nfs_group_name }}.yml
failed_when: false
- name: stop ceph nfs service
service: