Created
November 13, 2017 04:41
-
-
Save kchandan/53addc4cc9fd9beda13b3f84a7d865e7 to your computer and use it in GitHub Desktop.
aws-ansible-script
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
# 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