Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- - name: Create ec2 instance
- hosts: some-group # getting this value would need to be determined
- gather_facts: no
- tasks:
- - name: create instances
- local_action: ec2
- args:
- key_name: mykey
- instance_type: t2.micro
- image: ami-123456
- wait: yes
- group: webserver
- count: 3
- vpc_subnet_id: subnet-29e63245
- assign_public_ip: yes
- - name: wait for ssh to come up
- local_action: wait_for
- args:
- host: "{{ ansible_ssh_host }}"
- state: started
- delay: 10
- timeout: 300
- port: "{{ ansible_ssh_port | default(22) }}"
- search_regex: OpenSSH
- - name: gather facts, now that we can connect to instance
- setup:
- gather_subset: all
- # should be able to continue on
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement