Skip to content

Instantly share code, notes, and snippets.

@dougluce
Last active August 29, 2015 14:20
Show Gist options
  • Save dougluce/aa27b77d5490fe640d11 to your computer and use it in GitHub Desktop.
Save dougluce/aa27b77d5490fe640d11 to your computer and use it in GitHub Desktop.
Ansible playbook example -- can env be shared?
- hosts: localhost
name: Create a new EC2 instance
connection: local
gather_facts: False
vars_prompt:
- name: "env"
prompt: "Is this for production or dev"
default: "dev"
tasks:
- name: Display the type of box to create
debug: msg="I'll create a new {{ env }} box"
- name: Create new host group (with placeholder IP)
add_host: hostname=10.0.0.2 groups=ec2host
- hosts: ec2host
name: Configure a new EC2 instance
gather_facts: False
tasks:
- name: Display the type of box to configure
debug: msg="I'll configure a new {{ env }} box"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment