purge: drop variables from 'hosts' sections

Those variables are useless given this is not possible to override them.
Let's replace them with the hardcoded name instead.

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
(cherry picked from commit 6b50401d0c)
pull/6747/head
Guillaume Abrioux 2021-07-13 17:11:22 +02:00 committed by Dimitri Savineau
parent e54c8e93ee
commit fc5440b71c
2 changed files with 87 additions and 105 deletions

View File

@ -32,15 +32,15 @@
- name: gather facts on all hosts - name: gather facts on all hosts
hosts: hosts:
- "{{ mon_group_name | default('mons') }}" - mons
- "{{ osd_group_name | default('osds') }}" - osds
- "{{ mds_group_name | default('mdss') }}" - mdss
- "{{ rgw_group_name | default('rgws') }}" - rgws
- "{{ rbdmirror_group_name | default('rbdmirrors') }}" - rbdmirrors
- "{{ nfs_group_name | default('nfss') }}" - nfss
- "{{ client_group_name | default('clients') }}" - clients
- "{{ mgr_group_name | default('mgrs') }}" - mgrs
- "{{ monitoring_group_name | default('monitoring') }}" - monitoring
become: true become: true
tasks: tasks:
- debug: - debug:
@ -48,8 +48,9 @@
- name: check there's no ceph kernel threads present - name: check there's no ceph kernel threads present
hosts: "{{ client_group_name | default('clients') }}" hosts: clients
become: true become: true
gather_facts: false
any_errors_fatal: true any_errors_fatal: true
tasks: tasks:
- import_role: - import_role:
@ -108,9 +109,7 @@
- name: purge ceph nfs cluster - name: purge ceph nfs cluster
vars: hosts: nfss
nfs_group_name: nfss
hosts: "{{ nfs_group_name | default('nfss') }}"
gather_facts: false # Already gathered previously gather_facts: false # Already gathered previously
become: true become: true
tasks: tasks:
@ -124,16 +123,15 @@
- name: purge node-exporter - name: purge node-exporter
hosts: hosts:
- "{{ mon_group_name | default('mons') }}" - mons
- "{{ osd_group_name | default('osds') }}" - osds
- "{{ mds_group_name | default('mdss') }}" - mdss
- "{{ rgw_group_name | default('rgws') }}" - rgws
- "{{ rbdmirror_group_name | default('rbdmirrors') }}" - rbdmirrors
- "{{ nfs_group_name | default('nfss') }}" - nfss
- "{{ client_group_name | default('clients') }}"
- "{{ mgr_group_name | default('mgrs') }}"
- "{{ monitoring_group_name | default('monitoring') }}"
- clients - clients
- mgrs
- monitoring
- iscsigws - iscsigws
become: true become: true
tasks: tasks:
@ -225,9 +223,7 @@
- name: purge ceph mds cluster - name: purge ceph mds cluster
vars: hosts: mdss
mds_group_name: mdss
hosts: "{{ mds_group_name | default('mdss') }}"
gather_facts: false # Already gathered previously gather_facts: false # Already gathered previously
become: true become: true
tasks: tasks:
@ -240,9 +236,7 @@
- name: purge ceph mgr cluster - name: purge ceph mgr cluster
vars: hosts: mgrs
mgr_group_name: mgrs
hosts: "{{ mgr_group_name | default('mgrs') }}"
gather_facts: false # Already gathered previously gather_facts: false # Already gathered previously
become: true become: true
tasks: tasks:
@ -256,10 +250,7 @@
- name: purge rgwloadbalancer cluster - name: purge rgwloadbalancer cluster
vars: hosts: rgwloadbalancers
rgwloadbalancer_group_name: rgwloadbalancers
hosts:
- "{{ rgwloadbalancer_group_name | default('rgwloadbalancers') }}"
gather_facts: false # Already gathered previously gather_facts: false # Already gathered previously
become: true become: true
tasks: tasks:
@ -272,9 +263,7 @@
- name: purge ceph rgw cluster - name: purge ceph rgw cluster
vars: hosts: rgws
rgw_group_name: rgws
hosts: "{{ rgw_group_name | default('rgws') }}"
gather_facts: false # Already gathered previously gather_facts: false # Already gathered previously
become: true become: true
tasks: tasks:
@ -295,9 +284,7 @@
- name: purge ceph rbd-mirror cluster - name: purge ceph rbd-mirror cluster
vars: hosts: rbdmirrors
rbdmirror_group_name: rbdmirrors
hosts: "{{ rbdmirror_group_name | default('rbdmirrors') }}"
gather_facts: false # Already gathered previously gather_facts: false # Already gathered previously
become: true become: true
tasks: tasks:
@ -310,9 +297,8 @@
- name: purge ceph osd cluster - name: purge ceph osd cluster
vars: vars:
osd_group_name: osds
reboot_osd_node: False reboot_osd_node: False
hosts: "{{ osd_group_name | default('osds') }}" hosts: osds
gather_facts: false # Already gathered previously gather_facts: false # Already gathered previously
become: true become: true
handlers: handlers:
@ -561,9 +547,7 @@
- name: purge ceph mon cluster - name: purge ceph mon cluster
vars: hosts: mons
mon_group_name: mons
hosts: "{{ mon_group_name|default('mons') }}"
gather_facts: false # already gathered previously gather_facts: false # already gathered previously
become: true become: true
tasks: tasks:
@ -593,12 +577,12 @@
- name: purge ceph-crash daemons - name: purge ceph-crash daemons
hosts: hosts:
- "{{ mon_group_name | default('mons') }}" - mons
- "{{ osd_group_name | default('osds') }}" - osds
- "{{ mds_group_name | default('mdss') }}" - mdss
- "{{ rgw_group_name | default('rgws') }}" - rgws
- "{{ rbdmirror_group_name | default('rbdmirrors') }}" - rbdmirrors
- "{{ mgr_group_name | default('mgrs') }}" - mgrs
gather_facts: false gather_facts: false
become: true become: true
tasks: tasks:
@ -648,15 +632,15 @@
- keepalived - keepalived
- haproxy - haproxy
hosts: hosts:
- "{{ mon_group_name | default('mons') }}" - mons
- "{{ osd_group_name | default('osds') }}" - osds
- "{{ mds_group_name | default('mdss') }}" - mdss
- "{{ rgw_group_name | default('rgws') }}" - rgws
- "{{ rbdmirror_group_name | default('rbdmirrors') }}" - rbdmirrors
- "{{ nfs_group_name | default('nfss') }}" - nfss
- "{{ client_group_name | default('clients') }}" - clients
- "{{ mgr_group_name | default('mgrs') }}" - mgrs
- "{{ monitoring_group_name | default('monitoring') }}" - monitoring
gather_facts: false # Already gathered previously gather_facts: false # Already gathered previously
become: true become: true
handlers: handlers:

View File

@ -31,7 +31,7 @@
- name: check there's no ceph kernel threads present - name: check there's no ceph kernel threads present
hosts: "{{ client_group_name|default('clients') }}" hosts: clients
become: true become: true
any_errors_fatal: true any_errors_fatal: true
tasks: tasks:
@ -91,7 +91,7 @@
- name: purge ceph nfs cluster - name: purge ceph nfs cluster
hosts: "{{ nfs_group_name | default('nfss') }}" hosts: nfss
become: true become: true
tasks: tasks:
- name: disable ceph nfs service - name: disable ceph nfs service
@ -117,7 +117,7 @@
- name: purge ceph mds cluster - name: purge ceph mds cluster
hosts: "{{ mds_group_name | default('mdss') }}" hosts: mdss
become: true become: true
tasks: tasks:
- name: disable ceph mds service - name: disable ceph mds service
@ -134,7 +134,7 @@
- name: purge ceph iscsigws cluster - name: purge ceph iscsigws cluster
hosts: "{{ iscsi_gw_group_name | default('iscsigws') }}" hosts: iscsigws
become: true become: true
tasks: tasks:
- name: disable ceph iscsigw services - name: disable ceph iscsigw services
@ -160,7 +160,7 @@
- name: purge ceph mgr cluster - name: purge ceph mgr cluster
hosts: "{{ mgr_group_name | default('mgrs') }}" hosts: mgrs
become: true become: true
tasks: tasks:
- name: disable ceph mgr service - name: disable ceph mgr service
@ -177,7 +177,7 @@
- name: purge ceph rgw cluster - name: purge ceph rgw cluster
hosts: "{{ rgw_group_name | default('rgws') }}" hosts: rgws
become: true become: true
tasks: tasks:
- import_role: - import_role:
@ -202,7 +202,7 @@
- name: purge ceph rbd-mirror cluster - name: purge ceph rbd-mirror cluster
hosts: "{{ rbdmirror_group_name | default('rbdmirrors') }}" hosts: rbdmirrors
become: true become: true
tasks: tasks:
- name: disable ceph rbd-mirror service - name: disable ceph rbd-mirror service
@ -219,8 +219,7 @@
- name: purge ceph osd cluster - name: purge ceph osd cluster
hosts: "{{ osd_group_name | default('osds') }}" hosts: osds
gather_facts: true
become: true become: true
tasks: tasks:
- import_role: - import_role:
@ -310,7 +309,7 @@
- name: purge ceph mon cluster - name: purge ceph mon cluster
hosts: "{{ mon_group_name|default('mons') }}" hosts: mons
become: true become: true
tasks: tasks:
# since mgr are now collocated with mons by default # since mgr are now collocated with mons by default
@ -335,14 +334,14 @@
- name: purge node-exporter - name: purge node-exporter
hosts: hosts:
- "{{ mon_group_name | default('mons') }}" - mons
- "{{ osd_group_name | default('osds') }}" - osds
- "{{ mds_group_name | default('mdss') }}" - mdss
- "{{ rgw_group_name | default('rgws') }}" - rgws
- "{{ rbdmirror_group_name | default('rbdmirrors') }}" - rbdmirrors
- "{{ nfs_group_name | default('nfss') }}" - nfss
- "{{ mgr_group_name | default('mgrs') }}" - mgrs
- "{{ monitoring_group_name | default('monitoring') }}" - monitoring
- iscsigws - iscsigws
- clients - clients
gather_facts: false gather_facts: false
@ -437,12 +436,12 @@
- name: purge ceph-crash containers - name: purge ceph-crash containers
hosts: hosts:
- "{{ mon_group_name | default('mons') }}" - mons
- "{{ osd_group_name | default('osds') }}" - osds
- "{{ mds_group_name | default('mdss') }}" - mdss
- "{{ rgw_group_name | default('rgws') }}" - rgws
- "{{ rbdmirror_group_name | default('rbdmirrors') }}" - rbdmirrors
- "{{ mgr_group_name | default('mgrs') }}" - mgrs
gather_facts: false gather_facts: false
become: true become: true
tasks: tasks:
@ -467,14 +466,13 @@
- name: check container hosts - name: check container hosts
hosts: hosts:
- "{{ mon_group_name | default('mons') }}" - mons
- "{{ osd_group_name | default('osds') }}" - osds
- "{{ mds_group_name | default('mdss') }}" - mdss
- "{{ rgw_group_name | default('rgws') }}" - rgws
- "{{ rbdmirror_group_name | default('rbdmirrors') }}" - rbdmirrors
- "{{ nfs_group_name | default('nfss') }}" - nfss
- "{{ mgr_group_name | default('mgrs') }}" - mgrs
gather_facts: true
become: true become: true
tasks: tasks:
- import_role: - import_role:
@ -509,14 +507,14 @@
- name: final cleanup - name: final cleanup
hosts: hosts:
- "{{ mon_group_name | default('mons') }}" - mons
- "{{ osd_group_name | default('osds') }}" - osds
- "{{ mds_group_name | default('mdss') }}" - mdss
- "{{ rgw_group_name | default('rgws') }}" - rgws
- "{{ rbdmirror_group_name | default('rbdmirrors') }}" - rbdmirrors
- "{{ nfs_group_name | default('nfss') }}" - nfss
- "{{ mgr_group_name | default('mgrs') }}" - mgrs
- "{{ monitoring_group_name | default('monitoring') }}" - monitoring
become: true become: true
tags: with_pkg tags: with_pkg
tasks: tasks:
@ -625,13 +623,13 @@
- name: purge ceph directories - name: purge ceph directories
hosts: hosts:
- "{{ mon_group_name | default('mons') }}" - mons
- "{{ osd_group_name | default('osds') }}" - osds
- "{{ mds_group_name | default('mdss') }}" - mdss
- "{{ rgw_group_name | default('rgws') }}" - rgws
- "{{ rbdmirror_group_name | default('rbdmirrors') }}" - rbdmirrors
- "{{ nfs_group_name | default('nfss') }}" - nfss
- "{{ mgr_group_name | default('mgrs') }}" - mgrs
gather_facts: false # Already gathered previously gather_facts: false # Already gathered previously
become: true become: true
tasks: tasks: