summaryrefslogtreecommitdiffstats
path: root/roles/openshift_aws/tasks
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2018-02-08 10:56:21 -0800
committerGitHub <noreply@github.com>2018-02-08 10:56:21 -0800
commit1ab6b4201af2474106d68265515de8d0c63b285d (patch)
treeac8c9afb9755fbfb0f5f40f7615cd2380d07caac /roles/openshift_aws/tasks
parent5f056317c44486bd38ed58aba865189b1d0b4f64 (diff)
parent94b2f03d5bd9ada69527a1f420067e10246ac4c8 (diff)
downloadopenshift-1ab6b4201af2474106d68265515de8d0c63b285d.tar.gz
openshift-1ab6b4201af2474106d68265515de8d0c63b285d.tar.bz2
openshift-1ab6b4201af2474106d68265515de8d0c63b285d.tar.xz
openshift-1ab6b4201af2474106d68265515de8d0c63b285d.zip
Merge pull request #7060 from mwoodson/master
Automatic merge from submit-queue. aws ami: make it so the tags from the orinal AMI are used with the newly created AMI
Diffstat (limited to 'roles/openshift_aws/tasks')
-rw-r--r--roles/openshift_aws/tasks/seal_ami.yml15
1 files changed, 14 insertions, 1 deletions
diff --git a/roles/openshift_aws/tasks/seal_ami.yml b/roles/openshift_aws/tasks/seal_ami.yml
index 74877d5c7..c1cb37a3b 100644
--- a/roles/openshift_aws/tasks/seal_ami.yml
+++ b/roles/openshift_aws/tasks/seal_ami.yml
@@ -10,6 +10,19 @@
delay: 3
until: instancesout.instances|length > 0
+- name: fetch the ami used to create the instance
+ ec2_ami_find:
+ region: "{{ openshift_aws_region }}"
+ ami_id: "{{ instancesout.instances[0]['image_id'] }}"
+ register: original_ami_out
+ retries: 20
+ delay: 3
+ until: original_ami_out.results|length > 0
+
+- name: combine the tags of the original ami with newly created ami
+ set_fact:
+ l_openshift_aws_ami_tags: "{{ original_ami_out.results[0]['tags'] | combine(openshift_aws_ami_tags) }}"
+
- name: bundle ami
ec2_ami:
instance_id: "{{ instancesout.instances.0.instance_id }}"
@@ -17,7 +30,7 @@
state: present
description: "This was provisioned {{ ansible_date_time.iso8601 }}"
name: "{{ openshift_aws_ami_name }}"
- tags: "{{ openshift_aws_ami_tags }}"
+ tags: "{{ l_openshift_aws_ami_tags }}"
wait: yes
register: amioutput