summaryrefslogtreecommitdiffstats
path: root/playbooks/gce/openshift-cluster/terminate.yml
diff options
context:
space:
mode:
authorThomas Wiest <twiest@users.noreply.github.com>2015-10-05 13:48:41 -0400
committerThomas Wiest <twiest@users.noreply.github.com>2015-10-05 13:48:41 -0400
commit3073d1f729f9dcd202088f6b318b465567c6344b (patch)
treec86ab69cda7d6a1402c779968bb20b41c8fd4012 /playbooks/gce/openshift-cluster/terminate.yml
parent7918909dc7c6877a4ce2b9fab830d0c41c1c92fd (diff)
downloadopenshift-3073d1f729f9dcd202088f6b318b465567c6344b.tar.gz
openshift-3073d1f729f9dcd202088f6b318b465567c6344b.tar.bz2
openshift-3073d1f729f9dcd202088f6b318b465567c6344b.tar.xz
openshift-3073d1f729f9dcd202088f6b318b465567c6344b.zip
Revert "GCE support"
Diffstat (limited to 'playbooks/gce/openshift-cluster/terminate.yml')
-rw-r--r--playbooks/gce/openshift-cluster/terminate.yml55
1 files changed, 21 insertions, 34 deletions
diff --git a/playbooks/gce/openshift-cluster/terminate.yml b/playbooks/gce/openshift-cluster/terminate.yml
index f705745d9..098b0df73 100644
--- a/playbooks/gce/openshift-cluster/terminate.yml
+++ b/playbooks/gce/openshift-cluster/terminate.yml
@@ -1,18 +1,25 @@
---
- name: Terminate instance(s)
hosts: localhost
- connection: local
gather_facts: no
vars_files:
- vars.yml
tasks:
- - set_fact: scratch_group=tag_env-{{ cluster_id }}
+ - set_fact: scratch_group=tag_env-host-type-{{ cluster_id }}-openshift-node
- add_host:
name: "{{ item }}"
- groups: oo_hosts_to_terminate
+ groups: oo_hosts_to_terminate, oo_nodes_to_terminate
ansible_ssh_user: "{{ deployment_vars[deployment_type].ssh_user | default(ansible_ssh_user, true) }}"
ansible_sudo: "{{ deployment_vars[deployment_type].sudo }}"
- with_items: groups[scratch_group] | default([]) | difference(['localhost']) | difference(groups.status_terminated | default([]))
+ with_items: groups[scratch_group] | default([]) | difference(['localhost']) | difference(groups.status_terminated)
+
+ - set_fact: scratch_group=tag_env-host-type-{{ cluster_id }}-openshift-master
+ - add_host:
+ name: "{{ item }}"
+ groups: oo_hosts_to_terminate, oo_masters_to_terminate
+ ansible_ssh_user: "{{ deployment_vars[deployment_type].ssh_user | default(ansible_ssh_user, true) }}"
+ ansible_sudo: "{{ deployment_vars[deployment_type].sudo }}"
+ with_items: groups[scratch_group] | default([]) | difference(['localhost']) | difference(groups.status_terminated)
- name: Unsubscribe VMs
hosts: oo_hosts_to_terminate
@@ -25,34 +32,14 @@
lookup('oo_option', 'rhel_skip_subscription') | default(rhsub_skip, True) |
default('no', True) | lower in ['no', 'false']
-- name: Terminate instances(s)
- hosts: localhost
- connection: local
- gather_facts: no
- vars_files:
- - vars.yml
- tasks:
-
- - name: Terminate instances that were previously launched
- local_action:
- module: gce
- state: 'absent'
- name: "{{ item }}"
- service_account_email: "{{ lookup('env', 'gce_service_account_email_address') }}"
- pem_file: "{{ lookup('env', 'gce_service_account_pem_file_path') }}"
- project_id: "{{ lookup('env', 'gce_project_id') }}"
- zone: "{{ lookup('env', 'zone') }}"
- with_items: groups['oo_hosts_to_terminate'] | default([])
- when: item is defined
+- include: ../openshift-node/terminate.yml
+ vars:
+ gce_service_account_email: "{{ lookup('env', 'gce_service_account_email_address') }}"
+ gce_pem_file: "{{ lookup('env', 'gce_service_account_pem_file_path') }}"
+ gce_project_id: "{{ lookup('env', 'gce_project_id') }}"
-#- include: ../openshift-node/terminate.yml
-# vars:
-# gce_service_account_email: "{{ lookup('env', 'gce_service_account_email_address') }}"
-# gce_pem_file: "{{ lookup('env', 'gce_service_account_pem_file_path') }}"
-# gce_project_id: "{{ lookup('env', 'gce_project_id') }}"
-#
-#- include: ../openshift-master/terminate.yml
-# vars:
-# gce_service_account_email: "{{ lookup('env', 'gce_service_account_email_address') }}"
-# gce_pem_file: "{{ lookup('env', 'gce_service_account_pem_file_path') }}"
-# gce_project_id: "{{ lookup('env', 'gce_project_id') }}"
+- include: ../openshift-master/terminate.yml
+ vars:
+ gce_service_account_email: "{{ lookup('env', 'gce_service_account_email_address') }}"
+ gce_pem_file: "{{ lookup('env', 'gce_service_account_pem_file_path') }}"
+ gce_project_id: "{{ lookup('env', 'gce_project_id') }}"