summaryrefslogtreecommitdiff
path: root/examples/hosts.yaml
diff options
context:
space:
mode:
authorBrian Coca <brian.coca+git@gmail.com>2017-03-08 14:51:38 -0500
committerBrian Coca <brian.coca+git@gmail.com>2017-03-08 14:51:52 -0500
commitced73389de4f05121ee63d344af87eaaa89749b3 (patch)
tree2de29f3eaa0163ce3659821e1a77a255a3b27fa4 /examples/hosts.yaml
parent41f5648c4462feaf06120af99c90a44dffffa7ba (diff)
downloadansible-ced73389de4f05121ee63d344af87eaaa89749b3.tar.gz
updated better yaml host examples
Diffstat (limited to 'examples/hosts.yaml')
-rw-r--r--examples/hosts.yaml43
1 files changed, 25 insertions, 18 deletions
diff --git a/examples/hosts.yaml b/examples/hosts.yaml
index 0cb42f5bb0..d29e081b21 100644
--- a/examples/hosts.yaml
+++ b/examples/hosts.yaml
@@ -4,15 +4,16 @@
#
# - Comments begin with the '#' character
# - Blank lines are ignored
-# - Top level entries are assumed to be groups
+# - Top level entries are assumed to be groups, start with 'all' to have a full hierchy
# - Hosts must be specified in a group's hosts:
# and they must be a key (: terminated)
# - groups can have children, hosts and vars keys
# - Anything defined under a hosts is assumed to be a var
# - You can enter hostnames or ip addresses
# - A hostname/ip can be a member of multiple groups
-# Ex 1: Ungrouped hosts, put in 'ungrouped' group
-##ungrouped:
+
+# Ex 1: Ungrouped hosts, put in 'all' or 'ungrouped' group
+##all:
## hosts:
## green.example.com:
## ansible_ssh_host: 191.168.100.32
@@ -21,23 +22,29 @@
## 192.168.100.10:
# Ex 2: A collection of hosts belonging to the 'webservers' group
-
-##webservers:
-## hosts:
-## alpha.example.org:
-## beta.example.org:
-## 192.168.1.100:
-## 192.168.1.110:
+## children:
+## webservers:
+## hosts:
+## alpha.example.org:
+## beta.example.org:
+## 192.168.1.100:
+## 192.168.1.110:
# Ex 3: You can create hosts using ranges and add children groups and vars to a group
# The child group can define anything you would normally add to a group
-##testing:
-## hosts:
-## www[001:006].example.com:
+## testing:
+## hosts:
+## www[001:006].example.com:
+## vars:
+## testing1: value1
+## children:
+## webservers:
+## hosts:
+## beta.example.org:
+
+# Ex 4: all vars
+# keeping withing 'all' group you can define common 'all' vars here with lowest precedence
+
## vars:
-## testing1: value1
-## children:
-## webservers:
-## hosts:
-## beta.example.org:
+## commontoall: thisvar