Browse code

updated better yaml host examples

Brian Coca authored on 2017/03/09 04:51:38
Showing 1 changed files
... ...
@@ -4,15 +4,16 @@
4 4
 #
5 5
 #   - Comments begin with the '#' character
6 6
 #   - Blank lines are ignored
7
-#   - Top level entries are assumed to be groups
7
+#   - Top level entries are assumed to be groups, start with 'all' to have a full hierchy
8 8
 #   - Hosts must be specified in a group's hosts:
9 9
 #     and they must be a key (: terminated)
10 10
 #   - groups can have children, hosts and vars keys
11 11
 #   - Anything defined under a hosts is assumed to be a var
12 12
 #   - You can enter hostnames or ip addresses
13 13
 #   - A hostname/ip can be a member of multiple groups
14
-# Ex 1: Ungrouped hosts, put in 'ungrouped' group
15
-##ungrouped:
14
+
15
+# Ex 1: Ungrouped hosts, put in 'all' or 'ungrouped' group
16
+##all:
16 17
 ##  hosts:
17 18
 ##      green.example.com:
18 19
 ##          ansible_ssh_host: 191.168.100.32
... ...
@@ -21,23 +22,29 @@
21 21
 ##      192.168.100.10:
22 22
 
23 23
 # Ex 2: A collection of hosts belonging to the 'webservers' group
24
-
25
-##webservers:
26
-##  hosts:
27
-##      alpha.example.org:
28
-##      beta.example.org:
29
-##      192.168.1.100:
30
-##      192.168.1.110:
24
+##  children:
25
+##    webservers:
26
+##      hosts:
27
+##        alpha.example.org:
28
+##        beta.example.org:
29
+##        192.168.1.100:
30
+##        192.168.1.110:
31 31
 
32 32
 # Ex 3: You can create hosts using ranges and add children groups and vars to a group
33 33
 # The child group can define anything you would normally add to a group
34 34
 
35
-##testing:
36
-##  hosts:
37
-##      www[001:006].example.com:
35
+##    testing:
36
+##      hosts:
37
+##        www[001:006].example.com:
38
+##      vars:
39
+##        testing1: value1
40
+##      children:
41
+##        webservers:
42
+##            hosts:
43
+##                beta.example.org:
44
+
45
+# Ex 4: all vars
46
+# keeping withing 'all' group you can define common 'all' vars here with lowest precedence
47
+
38 48
 ##  vars:
39
-##      testing1: value1
40
-##  children:
41
-##      webservers:
42
-##          hosts:
43
-##              beta.example.org:
49
+##      commontoall: thisvar