From b8045bc29e2d64d7d13d6f9d6a8bfc5780746371 Mon Sep 17 00:00:00 2001 From: Chelsea Robb Date: Thu, 30 May 2013 08:05:14 +1000 Subject: [PATCH] Updated loop documentation with explicit example of hash usage --- docsite/latest/rst/playbooks2.rst | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/docsite/latest/rst/playbooks2.rst b/docsite/latest/rst/playbooks2.rst index 5309e43eef9..a5075105cf1 100644 --- a/docsite/latest/rst/playbooks2.rst +++ b/docsite/latest/rst/playbooks2.rst @@ -414,7 +414,11 @@ The yum and apt modules use with_items to execute fewer package manager transact Note that the types of items you iterate over with 'with_items' do not have to be simple lists of strings. If you have a list of hashes, you can reference subkeys using things like:: - {{ item.subKeyName }} + - name: add several users + action: user name={{ item.name }} state=present groups={{ item.groups }} + with_items: + - { name: 'testuser1', groups: 'wheel' } + - { name: 'testuser2', groups: 'root' } Lookup Plugins - Accessing Outside Data ```````````````````````````````````````