Skip to content

Instantly share code, notes, and snippets.

@kchandan
Created November 13, 2017 04:41
Show Gist options
  • Save kchandan/53addc4cc9fd9beda13b3f84a7d865e7 to your computer and use it in GitHub Desktop.
Save kchandan/53addc4cc9fd9beda13b3f84a7d865e7 to your computer and use it in GitHub Desktop.
aws-ansible-script
---
# Talk to all hosts just so we can learn about them...
- name: Create a sandbox instance
hosts: localhost
gather_facts: False
vars:
keypair: my_keypair
instance_type: t2.micro
image: ami-d1315fb1
region: us-west-1
tasks:
- name: Launch instance
ec2:
key_name: "{{ keypair }}"
group: default
instance_type: "{{ instance_type }}"
image: "{{ image }}"
wait: true
region: "{{ region }}"
register: ec2
- name: Print all ec2 variables
debug: var=ec2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment