Skip to content

Instantly share code, notes, and snippets.

@sidneiweber
Created December 27, 2019 21:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sidneiweber/d7d3704c942ef1baf4d25995d96be36a to your computer and use it in GitHub Desktop.
Save sidneiweber/d7d3704c942ef1baf4d25995d96be36a to your computer and use it in GitHub Desktop.
# cat roles/build-ami/tasks/main.yml
- name: Create AMI
ec2_ami:
region: "{{ target_aws_region }}"
instance_id: "{{ item.id }}"
name: "windows-personalizado"
wait: yes
state: present
with_items: "{{ ec2_result.tagged_instances }}"
register: ami
- name: Set New AMI id variable
set_fact:
ami_result: "{{ (ami.results | first).image_id }}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment