|
@@ -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
|
|
|
|