Skip to content

Instantly share code, notes, and snippets.

@markuman
Created March 15, 2019 09:46
Show Gist options
  • Save markuman/922b3e00b7d2de3448793181fa76d170 to your computer and use it in GitHub Desktop.
Save markuman/922b3e00b7d2de3448793181fa76d170 to your computer and use it in GitHub Desktop.
---
- hosts: localhost
connection: local
gather_facts: False
tasks:
- name: Launch the new EC2 Instance
ec2:
...
register: instance
- name: Wait for SSH to come up
delegate_to: "{{ instance.instances[0].private_ip_address }} "
wait_for_connection:
delay: 60
timeout: 320
- hosts: "{{ tag_name }}"
gather_facts: True
become: True
tasks:
- name: Configure instance(s)
hosts:
yum:
name: "{{ packages }}"
vars:
packages:
- docker
- htop
- nano
- python3
- python3-pip
- mariadb
- ncdu
- nmap
- screen
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment