diff options
author | Jhon Honce <jhonce@redhat.com> | 2015-03-23 09:15:08 -0700 |
---|---|---|
committer | Jhon Honce <jhonce@redhat.com> | 2015-03-24 11:26:30 -0700 |
commit | 557cc0ca9ecc22a9d90f9cf9ce549186fe286492 (patch) | |
tree | 01cbd6a151e81400ba972fe7b593625007762fae | |
parent | 8b68846806d5294b5f43d14772d59aa2b8cf5e73 (diff) | |
download | openshift-557cc0ca9ecc22a9d90f9cf9ce549186fe286492.tar.gz openshift-557cc0ca9ecc22a9d90f9cf9ce549186fe286492.tar.bz2 openshift-557cc0ca9ecc22a9d90f9cf9ce549186fe286492.tar.xz openshift-557cc0ca9ecc22a9d90f9cf9ce549186fe286492.zip |
* Updates from code reviews
-rwxr-xr-x | bin/cluster | 14 | ||||
-rw-r--r-- | playbooks/gce/openshift-cluster/launch_instances.yml | 2 | ||||
-rw-r--r-- | playbooks/gce/openshift-master/terminate.yml | 1 | ||||
-rw-r--r-- | playbooks/gce/openshift-node/terminate.yml | 1 |
4 files changed, 14 insertions, 4 deletions
diff --git a/bin/cluster b/bin/cluster index af908155c..823f50671 100755 --- a/bin/cluster +++ b/bin/cluster @@ -83,9 +83,10 @@ class Cluster(object): sys.stderr.write('RUN [{}]\n'.format(command)) sys.stderr.flush() - error = os.system(command) - if error != 0: - raise Exception("Ansible run failed with exit code %d".format(error)) + status = os.system(command) + if status != 0: + sys.stderr.write("RUN [{}] failed with exit status %d".format(command, status)) + exit(status) @@ -100,4 +101,11 @@ if __name__ == '__main__': parser.add_argument('cluster_id', help='prefix for cluster VM names') args = parser.parse_args() + if 'terminate' == args.action: + sys.stderr.write("This will terminate the ENTIRE {} environment. Are you sure? [y/N] ".format(args.cluster_id)) + sys.stderr.flush() + answer = sys.stdin.read(1) + if answer not in ['y', 'Y']: + exit(0) + Cluster(args).apply() diff --git a/playbooks/gce/openshift-cluster/launch_instances.yml b/playbooks/gce/openshift-cluster/launch_instances.yml index 443e763de..20e31d990 100644 --- a/playbooks/gce/openshift-cluster/launch_instances.yml +++ b/playbooks/gce/openshift-cluster/launch_instances.yml @@ -12,7 +12,7 @@ pem_file: "{{ lookup('env', 'gce_service_account_pem_file_path') }}" project_id: "{{ lookup('env', 'gce_project_id') }}" tags: - - "created-by-{{ cluster }}" + - "created-by-{{ lookup('env', 'LOGNAME') |default(cluster, true) }}" - "env-{{ cluster }}" - "host-type-{{ type }}" - "env-host-type-{{ cluster }}-openshift-{{ type }}" diff --git a/playbooks/gce/openshift-master/terminate.yml b/playbooks/gce/openshift-master/terminate.yml index f1345874a..9e027cf41 100644 --- a/playbooks/gce/openshift-master/terminate.yml +++ b/playbooks/gce/openshift-master/terminate.yml @@ -15,6 +15,7 @@ - name: Terminate master instances hosts: localhost connection: local + gather_facts: no tasks: - name: Terminate master instances gce: diff --git a/playbooks/gce/openshift-node/terminate.yml b/playbooks/gce/openshift-node/terminate.yml index d4555084b..9aa8a48c1 100644 --- a/playbooks/gce/openshift-node/terminate.yml +++ b/playbooks/gce/openshift-node/terminate.yml @@ -15,6 +15,7 @@ - name: Terminate node instances hosts: localhost connection: local + gather_facts: no tasks: - name: Terminate node instances gce: |