summaryrefslogtreecommitdiffstats
path: root/playbooks/aws/openshift-cluster/terminate.yml
diff options
context:
space:
mode:
authorScott Dodson <sdodson@redhat.com>2016-10-17 10:43:16 -0400
committerGitHub <noreply@github.com>2016-10-17 10:43:16 -0400
commit844137e9e968fb0455b9cf5128342c3e449c8abb (patch)
tree070f227571aaeaf9d3b93d5dd13ed7842f697762 /playbooks/aws/openshift-cluster/terminate.yml
parent94af651106711912a7bce866517af088f4d1d0bf (diff)
parent12b17e1af352748d00d8ba2cf3b99a623ec61641 (diff)
downloadopenshift-844137e9e968fb0455b9cf5128342c3e449c8abb.tar.gz
openshift-844137e9e968fb0455b9cf5128342c3e449c8abb.tar.bz2
openshift-844137e9e968fb0455b9cf5128342c3e449c8abb.tar.xz
openshift-844137e9e968fb0455b9cf5128342c3e449c8abb.zip
Merge pull request #2608 from abutcher/template-with-items
Template with_items for upstream ansible-2.2 compat.
Diffstat (limited to 'playbooks/aws/openshift-cluster/terminate.yml')
-rw-r--r--playbooks/aws/openshift-cluster/terminate.yml12
1 files changed, 6 insertions, 6 deletions
diff --git a/playbooks/aws/openshift-cluster/terminate.yml b/playbooks/aws/openshift-cluster/terminate.yml
index fb13e1839..7a8375d0e 100644
--- a/playbooks/aws/openshift-cluster/terminate.yml
+++ b/playbooks/aws/openshift-cluster/terminate.yml
@@ -12,7 +12,7 @@
groups: oo_hosts_to_terminate
ansible_ssh_user: "{{ deployment_vars[deployment_type].ssh_user }}"
ansible_become: "{{ deployment_vars[deployment_type].become }}"
- with_items: (groups['tag_clusterid_' ~ cluster_id] | default([])) | difference(['localhost'])
+ with_items: "{{ (groups['tag_clusterid_' ~ cluster_id] | default([])) | difference(['localhost']) }}"
- name: Unsubscribe VMs
hosts: oo_hosts_to_terminate
@@ -39,7 +39,7 @@
clusterid: "{{ hostvars[item]['ec2_tag_clusterid'] }}"
host-type: "{{ hostvars[item]['ec2_tag_host-type'] }}"
sub_host_type: "{{ hostvars[item]['ec2_tag_sub-host-type'] }}"
- with_items: groups.oo_hosts_to_terminate
+ with_items: "{{ groups.oo_hosts_to_terminate }}"
when: "'oo_hosts_to_terminate' in groups"
- name: Terminate instances
@@ -49,7 +49,7 @@
region: "{{ hostvars[item].ec2_region }}"
ignore_errors: yes
register: ec2_term
- with_items: groups.oo_hosts_to_terminate
+ with_items: "{{ groups.oo_hosts_to_terminate }}"
when: "'oo_hosts_to_terminate' in groups"
# Fail if any of the instances failed to terminate with an error other
@@ -57,7 +57,7 @@
- fail:
msg: "Terminating instance {{ item.ec2_id }} failed with message {{ item.msg }}"
when: "'oo_hosts_to_terminate' in groups and item.has_key('failed') and item.failed"
- with_items: ec2_term.results
+ with_items: "{{ ec2_term.results }}"
- name: Stop instance if termination failed
ec2:
@@ -66,12 +66,12 @@
region: "{{ item.item.ec2_region }}"
register: ec2_stop
when: "'oo_hosts_to_terminate' in groups and item.has_key('failed') and item.failed"
- with_items: ec2_term.results
+ with_items: "{{ ec2_term.results }}"
- name: Rename stopped instances
ec2_tag: resource={{ item.item.item.ec2_id }} region={{ item.item.item.ec2_region }} state=present
args:
tags:
Name: "{{ item.item.item.ec2_tag_Name }}-terminate"
- with_items: ec2_stop.results
+ with_items: "{{ ec2_stop.results }}"
when: ec2_stop | changed