summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorMonty Taylor <mordred@redhat.com>2018-11-29 14:22:48 -0600
committerAlicia Cozine <879121+acozine@users.noreply.github.com>2018-11-29 14:22:48 -0600
commit2e8f166b8a1aaeea6b9b8c681a1c1bcc5da684ec (patch)
tree8a016dc659ee11bf063200c28ee959c3b599b374 /examples
parente70030961858566592c922435cb6ed5fa3ed7baf (diff)
downloadansible-2e8f166b8a1aaeea6b9b8c681a1c1bcc5da684ec.tar.gz
Add comment about group merge in yaml inventory example (#24986)
* Add comment about group merge in yaml inventory example, w/bcoca feedback
Diffstat (limited to 'examples')
-rw-r--r--examples/hosts.yaml11
1 files changed, 9 insertions, 2 deletions
diff --git a/examples/hosts.yaml b/examples/hosts.yaml
index 02f879010d..e16d7f665a 100644
--- a/examples/hosts.yaml
+++ b/examples/hosts.yaml
@@ -8,6 +8,8 @@
# - Hosts must be specified in a group's hosts:
# and they must be a key (: terminated)
# - groups can have children, hosts and vars keys
+# - groups are unique and global - if you define a group in multiple locations, Ansible aggregates all the data to the global name.
+# - If you define a group as a child of 2 different groups, it will be the child of both, any hosts and variables assigned will not be dependent on the parents, they will all be associated with the group.
# - Anything defined under a host is assumed to be a var
# - You can enter hostnames or IP addresses
# - A hostname/IP can be a member of multiple groups
@@ -32,7 +34,12 @@
## 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
+# The child group can define anything you would normally add to a group.
+# webservers is added as a child group of testing. gamma.example.org is added
+# to the existing webservers group. All references to webservers will
+# get alpha.example.org, beta.example.org, gamma.example.org, 192.168.1.100
+# and 192.168.1.110. References to testing will get all of those hosts plus
+# any host matching www[001:006].example.com
## testing:
## hosts:
@@ -42,7 +49,7 @@
## children:
## webservers:
## hosts:
-## beta.example.org:
+## gamma.example.org:
# Ex 4: all vars
# keeping within 'all' group you can define common 'all' vars here with lowest precedence