]> git.apps.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
purge: drop variables from 'hosts' sections
authorGuillaume Abrioux <gabrioux@redhat.com>
Tue, 13 Jul 2021 15:11:22 +0000 (17:11 +0200)
committerDimitri Savineau <savineau.dimitri@gmail.com>
Thu, 22 Jul 2021 21:10:01 +0000 (17:10 -0400)
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 6b50401d0c2021fe691ee4f2be083b059d991c8b)

infrastructure-playbooks/purge-cluster.yml
infrastructure-playbooks/purge-container-cluster.yml

index 7e3b7002e9b5b83df31bb614912cffe9f929689b..dd0335c5974e3b55a919b9bfb2b83f13f0afa037 100644 (file)
 
 - 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') }}"
+    - mons
+    - osds
+    - mdss
+    - rgws
+    - rbdmirrors
+    - nfss
+    - clients
+    - mgrs
     - grafana-server
-
   become: true
   tasks:
     - debug:
@@ -49,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:
 
 
 - 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:
 
 - 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') }}"
-    - grafana-server
+    - mons
+    - osds
+    - mdss
+    - rgws
+    - rbdmirrors
+    - nfss
     - clients
+    - mgrs
+    - grafana-server
     - iscsigws
   become: true
   tasks:
 
 
 - 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:
 
 
 - 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:
 
 
 - 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:
 
 
 - 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:
 
 
 - 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:
 
 - 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:
 
 
 - 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:
 
 - 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:
       - 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') }}"
+    - mons
+    - osds
+    - mdss
+    - rgws
+    - rbdmirrors
+    - nfss
+    - clients
+    - mgrs
     - grafana-server
-
   gather_facts: false # Already gathered previously
   become: true
   handlers:
index 53239a1dcbb88048c6ff1bca2da0d4a921f19e7f..03b09be36f6f24882a401b928aa19be37d7feed2 100644 (file)
@@ -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
 
 
 - name: purge ceph mds cluster
-  hosts: "{{ mds_group_name | default('mdss') }}"
+  hosts: mdss
   become: true
   tasks:
     - name: disable ceph mds service
 
 
 - name: purge ceph iscsigws cluster
-  hosts: "{{ iscsi_gw_group_name | default('iscsigws') }}"
+  hosts: iscsigws
   become: true
   tasks:
     - name: disable ceph iscsigw services
 
 
 - name: purge ceph mgr cluster
-  hosts: "{{ mgr_group_name | default('mgrs') }}"
+  hosts: mgrs
   become: true
   tasks:
     - name: disable ceph mgr service
 
 
 - name: purge ceph rgw cluster
-  hosts: "{{ rgw_group_name | default('rgws') }}"
+  hosts: rgws
   become: true
   tasks:
     - import_role:
 
 
 - name: purge ceph rbd-mirror cluster
-  hosts: "{{ rbdmirror_group_name | default('rbdmirrors') }}"
+  hosts: rbdmirrors
   become: true
   tasks:
     - name: disable ceph rbd-mirror service
 
 
 - name: purge ceph osd cluster
-  hosts: "{{ osd_group_name | default('osds') }}"
-  gather_facts: true
+  hosts: osds
   become: true
   tasks:
     - import_role:
 
 
 - 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
 
 - 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') }}"
+    - mons
+    - osds
+    - mdss
+    - rgws
+    - rbdmirrors
+    - nfss
+    - mgrs
     - grafana-server
     - iscsigws
     - clients
 
 - 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:
 
 - 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:
 
 - 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') }}"
-    - "{{ grafana_server_group_name | default('grafana-server') }}"
-
+    - mons
+    - osds
+    - mdss
+    - rgws
+    - rbdmirrors
+    - nfss
+    - mgrs
+    - grafana-server
   become: true
   tags: with_pkg
   tasks:
 
 - 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: