From 6b50401d0c2021fe691ee4f2be083b059d991c8b Mon Sep 17 00:00:00 2001 From: Guillaume Abrioux Date: Tue, 13 Jul 2021 17:11:22 +0200 Subject: [PATCH] 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 --- infrastructure-playbooks/purge-cluster.yml | 100 ++++++++---------- .../purge-container-cluster.yml | 92 ++++++++-------- 2 files changed, 87 insertions(+), 105 deletions(-) diff --git a/infrastructure-playbooks/purge-cluster.yml b/infrastructure-playbooks/purge-cluster.yml index 914b2ae35..dbdc5b5ef 100644 --- a/infrastructure-playbooks/purge-cluster.yml +++ b/infrastructure-playbooks/purge-cluster.yml @@ -32,15 +32,15 @@ - name: gather facts on all hosts hosts: - - "{{ 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') }}" - - "{{ mgr_group_name | default('mgrs') }}" - - "{{ monitoring_group_name | default('monitoring') }}" + - mons + - osds + - mdss + - rgws + - rbdmirrors + - nfss + - clients + - mgrs + - monitoring become: true tasks: - debug: @@ -48,8 +48,9 @@ - name: check there's no ceph kernel threads present - hosts: "{{ client_group_name | default('clients') }}" + hosts: clients become: true + gather_facts: false any_errors_fatal: true tasks: - import_role: @@ -108,9 +109,7 @@ - name: purge ceph nfs cluster - vars: - nfs_group_name: nfss - hosts: "{{ nfs_group_name | default('nfss') }}" + hosts: nfss gather_facts: false # Already gathered previously become: true tasks: @@ -124,16 +123,15 @@ - name: purge node-exporter hosts: - - "{{ 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') }}" - - "{{ mgr_group_name | default('mgrs') }}" - - "{{ monitoring_group_name | default('monitoring') }}" + - mons + - osds + - mdss + - rgws + - rbdmirrors + - nfss - clients + - mgrs + - monitoring - iscsigws become: true tasks: @@ -225,9 +223,7 @@ - name: purge ceph mds cluster - vars: - mds_group_name: mdss - hosts: "{{ mds_group_name | default('mdss') }}" + hosts: mdss gather_facts: false # Already gathered previously become: true tasks: @@ -240,9 +236,7 @@ - name: purge ceph mgr cluster - vars: - mgr_group_name: mgrs - hosts: "{{ mgr_group_name | default('mgrs') }}" + hosts: mgrs gather_facts: false # Already gathered previously become: true tasks: @@ -256,10 +250,7 @@ - name: purge rgwloadbalancer cluster - vars: - rgwloadbalancer_group_name: rgwloadbalancers - hosts: - - "{{ rgwloadbalancer_group_name | default('rgwloadbalancers') }}" + hosts: rgwloadbalancers gather_facts: false # Already gathered previously become: true tasks: @@ -272,9 +263,7 @@ - name: purge ceph rgw cluster - vars: - rgw_group_name: rgws - hosts: "{{ rgw_group_name | default('rgws') }}" + hosts: rgws gather_facts: false # Already gathered previously become: true tasks: @@ -295,9 +284,7 @@ - name: purge ceph rbd-mirror cluster - vars: - rbdmirror_group_name: rbdmirrors - hosts: "{{ rbdmirror_group_name | default('rbdmirrors') }}" + hosts: rbdmirrors gather_facts: false # Already gathered previously become: true tasks: @@ -310,9 +297,8 @@ - name: purge ceph osd cluster vars: - osd_group_name: osds reboot_osd_node: False - hosts: "{{ osd_group_name | default('osds') }}" + hosts: osds gather_facts: false # Already gathered previously become: true handlers: @@ -561,9 +547,7 @@ - name: purge ceph mon cluster - vars: - mon_group_name: mons - hosts: "{{ mon_group_name|default('mons') }}" + hosts: mons gather_facts: false # already gathered previously become: true tasks: @@ -593,12 +577,12 @@ - name: purge ceph-crash daemons hosts: - - "{{ 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') }}" - - "{{ mgr_group_name | default('mgrs') }}" + - mons + - osds + - mdss + - rgws + - rbdmirrors + - mgrs gather_facts: false become: true tasks: @@ -648,15 +632,15 @@ - keepalived - haproxy hosts: - - "{{ 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') }}" - - "{{ mgr_group_name | default('mgrs') }}" - - "{{ monitoring_group_name | default('monitoring') }}" + - mons + - osds + - mdss + - rgws + - rbdmirrors + - nfss + - clients + - mgrs + - monitoring gather_facts: false # Already gathered previously become: true handlers: diff --git a/infrastructure-playbooks/purge-container-cluster.yml b/infrastructure-playbooks/purge-container-cluster.yml index a2f771231..b9d7d9433 100644 --- a/infrastructure-playbooks/purge-container-cluster.yml +++ b/infrastructure-playbooks/purge-container-cluster.yml @@ -31,7 +31,7 @@ - name: check there's no ceph kernel threads present - hosts: "{{ client_group_name|default('clients') }}" + hosts: clients become: true any_errors_fatal: true tasks: @@ -91,7 +91,7 @@ - name: purge ceph nfs cluster - hosts: "{{ nfs_group_name | default('nfss') }}" + hosts: nfss become: true tasks: - name: disable ceph nfs service @@ -117,7 +117,7 @@ - name: purge ceph mds cluster - hosts: "{{ mds_group_name | default('mdss') }}" + hosts: mdss become: true tasks: - name: disable ceph mds service @@ -134,7 +134,7 @@ - name: purge ceph iscsigws cluster - hosts: "{{ iscsi_gw_group_name | default('iscsigws') }}" + hosts: iscsigws become: true tasks: - name: disable ceph iscsigw services @@ -160,7 +160,7 @@ - name: purge ceph mgr cluster - hosts: "{{ mgr_group_name | default('mgrs') }}" + hosts: mgrs become: true tasks: - name: disable ceph mgr service @@ -177,7 +177,7 @@ - name: purge ceph rgw cluster - hosts: "{{ rgw_group_name | default('rgws') }}" + hosts: rgws become: true tasks: - import_role: @@ -202,7 +202,7 @@ - name: purge ceph rbd-mirror cluster - hosts: "{{ rbdmirror_group_name | default('rbdmirrors') }}" + hosts: rbdmirrors become: true tasks: - name: disable ceph rbd-mirror service @@ -219,8 +219,7 @@ - name: purge ceph osd cluster - hosts: "{{ osd_group_name | default('osds') }}" - gather_facts: true + hosts: osds become: true tasks: - import_role: @@ -310,7 +309,7 @@ - name: purge ceph mon cluster - hosts: "{{ mon_group_name|default('mons') }}" + hosts: mons become: true tasks: # since mgr are now collocated with mons by default @@ -335,14 +334,14 @@ - name: purge node-exporter hosts: - - "{{ 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') }}" - - "{{ mgr_group_name | default('mgrs') }}" - - "{{ monitoring_group_name | default('monitoring') }}" + - mons + - osds + - mdss + - rgws + - rbdmirrors + - nfss + - mgrs + - monitoring - iscsigws - clients gather_facts: false @@ -437,12 +436,12 @@ - name: purge ceph-crash containers hosts: - - "{{ 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') }}" - - "{{ mgr_group_name | default('mgrs') }}" + - mons + - osds + - mdss + - rgws + - rbdmirrors + - mgrs gather_facts: false become: true tasks: @@ -467,14 +466,13 @@ - name: check container hosts hosts: - - "{{ 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') }}" - - "{{ mgr_group_name | default('mgrs') }}" - gather_facts: true + - mons + - osds + - mdss + - rgws + - rbdmirrors + - nfss + - mgrs become: true tasks: - import_role: @@ -509,14 +507,14 @@ - name: final cleanup hosts: - - "{{ 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') }}" - - "{{ mgr_group_name | default('mgrs') }}" - - "{{ monitoring_group_name | default('monitoring') }}" + - mons + - osds + - mdss + - rgws + - rbdmirrors + - nfss + - mgrs + - monitoring become: true tags: with_pkg tasks: @@ -625,13 +623,13 @@ - name: purge ceph directories hosts: - - "{{ 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') }}" - - "{{ mgr_group_name | default('mgrs') }}" + - mons + - osds + - mdss + - rgws + - rbdmirrors + - nfss + - mgrs gather_facts: false # Already gathered previously become: true tasks: