]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
infra: add independant purge-iscsi-gateways.yml
authorSébastien Han <seb@redhat.com>
Sun, 8 Oct 2017 13:54:36 +0000 (15:54 +0200)
committerSébastien Han <seb@redhat.com>
Mon, 9 Oct 2017 15:25:44 +0000 (17:25 +0200)
The current inclusion of purge-iscsi-gateways.yml in purge-cluster.yml
is not working well and blocking the CI too. So removing it from
purge-cluster.yml and re-add the original purge-iscsi-gateways.yml.

Signed-off-by: Sébastien Han <seb@redhat.com>
infrastructure-playbooks/purge-cluster.yml
infrastructure-playbooks/purge-iscsi-gateways.yml [new file with mode: 0644]

index 3216ea0e4f0baa77ff4181d1e107f0fe637a464b..5c2dc27afb664637a4c08489d85233bef443320e 100644 (file)
       - /var/lib/ceph/tmp
 
 
-- name: purge iscsi gateway(s)
-
-  vars:
-    igw_purge_type: all
-
-  hosts:
-    - "{{ iscsi_gw_group_name|default('iscsi-gws') }}"
-
-  gather_facts: false # already gathered previously
-
-  become: true
-
-  tasks:
-
-  - name: igw_purge | purging the gateway configuration
-    igw_purge:
-      mode: "gateway"
-
-  - name: igw_purge | deleting configured rbd devices
-    igw_purge:
-      mode: "disks"
-    when:
-      - igw_purge_type == 'all'
-
-  - name: restart rbd-target-gw daemons
-    service:
-      name: rbd-target-gw
-      state: restarted
-    when:
-      - ansible_service_mgr == 'systemd'
-
-
 - name: final cleanup - check any running ceph, purge ceph packages, purge config and remove data
 
   vars:
diff --git a/infrastructure-playbooks/purge-iscsi-gateways.yml b/infrastructure-playbooks/purge-iscsi-gateways.yml
new file mode 100644 (file)
index 0000000..157dce4
--- /dev/null
@@ -0,0 +1,37 @@
+---
+
+- name: Confirm removal of the iSCSI gateway configuration
+  hosts: localhost
+
+  vars_prompt:
+    - name: purge_config
+      prompt: Which configuration elements should be purged? (all, lio or abort)
+      default: 'abort'
+      private: no
+
+  tasks:
+    - name: Exit playbook if user aborted the purge
+      fail:
+        msg: >
+          "You have aborted the purge of the iSCSI gateway configuration"
+      when: purge_config == 'abort'
+
+    - set_fact:
+        igw_purge_type: "{{ purge_config }}"
+
+- name: Removing the gateway configuration
+  hosts: ceph-iscsi-gw
+  vars:
+    - igw_purge_type: "{{hostvars['localhost']['igw_purge_type']}}"
+
+  tasks:
+    - name: igw_purge | purging the gateway configuration
+      igw_purge: mode="gateway"
+
+    - name: igw_purge | deleting configured rbd devices
+      igw_purge: mode="disks"
+      when: igw_purge_type == 'all'
+
+    - name: restart rbd-target-gw daemons
+      service: name=rbd-target-gw state=restarted
+