Skip to content

Instantly share code, notes, and snippets.

@chicagobuss
Created March 14, 2016 22:31
Show Gist options
  • Save chicagobuss/b5d7bd69eb8fb7345996 to your computer and use it in GitHub Desktop.
Save chicagobuss/b5d7bd69eb8fb7345996 to your computer and use it in GitHub Desktop.
How do I provision several hosts at once?
- name: Create a zookeeper cluster
hosts: localhost
gather_facts: no
vars:
names: zoo1,zoo2,zoo3
type: g1-small
image: new-debian
network: new-network
tags: new
service_account_email: bootstrap@myproject.iam.gserviceaccount.com
credentials_file: creds.json
roles:
- launch
- name: Create spark master nodes
hosts: localhost
gather_facts: no
vars:
names: spark-master1,spark-master2
type: n1-standard-2
image: new-sparkm
network: new-network
tags: new
service_account_email: bootstrap@myproject.iam.gserviceaccount.com
credentials_file: creds.json
roles:
- launch
- name: Create spark worker nodes
hosts: localhost
gather_facts: no
vars:
names: spark-data1,spark-data2,spark-data3,spark-data4,spark-data5
type: n1-standard-2
image: new-sparkw
network: new-network
tags: new
service_account_email: bootstrap@myproject.iam.gserviceaccount.com
credentials_file: creds.json
roles:
- launch
- name: Create a monitoring host
hosts: localhost
gather_facts: no
vars:
names: spark-monitor
type: n1-standard-1
image: new-debian
network: new-network
tags: nat
service_account_email: bootstrap@myproject.iam.gserviceaccount.com
credentials_file: creds.json
roles:
- launch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment