From a682a0292d82ae3beaaaf485d3e64e07229d401c Mon Sep 17 00:00:00 2001 From: rabin-io Date: Thu, 7 Feb 2019 21:15:40 +0200 Subject: [PATCH] Update yaml.py example to include A colon for single host in a group (#51830) * Update yaml.py exmaple to include A colon took me some time to find that out, you can have a single host under a group without the A colon, but if you add another host also w/o A colon, they will be parsed as a single line. * Update yaml.py --- lib/ansible/plugins/inventory/yaml.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/ansible/plugins/inventory/yaml.py b/lib/ansible/plugins/inventory/yaml.py index d013fc4837..d8b9599365 100644 --- a/lib/ansible/plugins/inventory/yaml.py +++ b/lib/ansible/plugins/inventory/yaml.py @@ -45,7 +45,14 @@ all: # keys must be unique, i.e. only one 'hosts' per group children: group_x: hosts: - test5 + test5 # Note that one machine will work without a colon + #group_x: + # hosts: + # test5 # But this won't + # test7 # + group_y: + hosts: + test6: # So always use a colon vars: g2_var2: value3 hosts: