Browse Source

WIP Infra - Refactor terminate

* remove persistent disks from images
Jhon Honce 10 years ago
parent
commit
2808f726da

+ 11 - 9
playbooks/gce/origin-master/terminate.yml

@@ -25,15 +25,17 @@
         instance_names: "{{ groups['oo_hosts_to_terminate'] }}"
         disks: "{{ groups['oo_hosts_to_terminate'] }}"
       register: gce
-    
+
     - debug: var=gce
 
-#    - name: Remove disks of instances
-#      gce_pd:
-#        service_account_email: "{{ gce_service_account_email }}"
-#        pem_file: "{{ gce_pem_file }}"
-#        project_id: "{{ gce_project_id }}"
-#        name: "{{ item }}"
-#        state: deleted
-#      with_items: gce.instance_names
+    - name: Remove disks of instances
+      gce_pd:
+        service_account_email: "{{ gce_service_account_email }}"
+        pem_file: "{{ gce_pem_file }}"
+        project_id: "{{ gce_project_id }}"
+        name: "{{ item }}"
+        zone: "{{ gce.zone }}"
+        state: absent
+      with_items: gce.instance_names
+
 

+ 10 - 8
playbooks/gce/origin-minion/terminate.yml

@@ -28,12 +28,14 @@
 
     - debug: var=gce
 
-#    - name: Remove disks of instances
-#      gce_pd:
-#        service_account_email: "{{ gce_service_account_email }}"
-#        pem_file: "{{ gce_pem_file }}"
-#        project_id: "{{ gce_project_id }}"
-#        name: "{{ item }}"
-#        state: deleted
-#      with_items: gce.instance_names
+    - name: Remove disks of instances
+      gce_pd:
+        service_account_email: "{{ gce_service_account_email }}"
+        pem_file: "{{ gce_pem_file }}"
+        project_id: "{{ gce_project_id }}"
+        name: "{{ item }}"
+        zone: "{{ gce.zone }}"
+        state: absent
+      with_items: gce.instance_names
+
 

+ 9 - 8
playbooks/gce/os3-minion/terminate.yml

@@ -28,12 +28,13 @@
 
     - debug: var=gce
 
-#    - name: Remove disks of instances
-#      gce_pd:
-#        service_account_email: "{{ gce_service_account_email }}"
-#        pem_file: "{{ gce_pem_file }}"
-#        project_id: "{{ gce_project_id }}"
-#        name: "{{ item }}"
-#        state: deleted
-#      with_items: gce.instance_names
+    - name: Remove disks of instances
+      gce_pd:
+        service_account_email: "{{ gce_service_account_email }}"
+        pem_file: "{{ gce_pem_file }}"
+        project_id: "{{ gce_project_id }}"
+        name: "{{ item }}"
+        zone: "{{ gce.zone }}"
+        state: absent
+      with_items: gce.instance_names