Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ---
- - name: Spin up EC2 Instance
- hosts: 127.0.0.1
- connection: local
- tasks:
- - name: Launch instances
- local_action:
- module: ec2
- region: eu-east-1c
- keypair: developer
- group: default
- instance_type: c1.medium
- image: ami-d34d35ba
- count: 1
- wait: yes
- register: ec2
- - name: Add instance to host group
- local_action: add_host hostname=test groupname=default
- with_items: ec2.instances
- - name: Tag instances
- local_action: ec2_tag resource= region=eu-east-1c state=present
- with_items: ec2.instances
- args:
- tags:
- Name: Plusserver
- - name: Give everyone a minute
- pause: minutes=1
- - name: Install Plusserver
- hosts: default
- user: root
- sudo: True
- tasks:
- - include: plusservers.yml
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement