This repository has been archived by the owner on Sep 7, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 19
Inventories
jlin21 edited this page Jan 6, 2016
·
3 revisions
Inventory can take up to 3 keys at the top: groups
, host_vars
, global_vars
Under groups
, you can specify various group names and they can have hosts
and vars
applicable to the group of hosts. host_vars
allow overrides at individual host level. global_vars
are vars that can be used throughout the entire plan (reference plan section for more details on vars).
groups
, and hosts
are both required keys. In addition, a group name cannot be named hosts
.
groups:
all:
hosts:
- 192.168.33.10
vars:
test: 10
zookeeper:
hosts:
- z1
- z2
- z3
host_vars:
"192.168.33.10":
test: 20
global_vars:
service: iptables
test: 50
In addition, henchman transport variables can also be overridden. Henchman transport variables at the hosts_vars level take the highest precedence, then group level, and finally global level. A few henchman transport variables include henchman_keyfile, henchman_username
.
Example:
groups:
g1:
hosts:
- 10.224.192.11
vars:
henchman_username: "vagrant_jr"
henchman_keyfile: "~/.ssh/all_private_key"
g2:
hosts:
- 10.224.192.12
- 10.224.192.13
vars:
sysadmin_email: "foobar2@apigee.com"
henchman_keyfile: "~/.ssh/all_private_key"
hostvars:
"10.224.192.12":
henchman_keyfile: "~/.ssh/g2_private_key"
global_vars:
henchman_username: "vagrant"