summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGerben Geijteman <gerben.geijteman@fdmediagroep.nl>2016-03-02 13:12:30 +0100
committerGerben Geijteman <gerben.geijteman@fdmediagroep.nl>2016-03-21 14:35:05 +0100
commitc7e1a65da4ff06ead2202dcb3eea30787566ca86 (patch)
tree4f78b1b8c291285df55bdeb9501948ebe96a8b8f
parent9053d0468e005645dafb1a6b847eacb98ddd9c48 (diff)
downloadansible-c7e1a65da4ff06ead2202dcb3eea30787566ca86.tar.gz
Proposed change to documentation to elaborate on new notation style for with_items / with_subelements
-rw-r--r--docsite/rst/playbooks_loops.rst4
-rw-r--r--samples/with_subelements.yml2
2 files changed, 3 insertions, 3 deletions
diff --git a/docsite/rst/playbooks_loops.rst b/docsite/rst/playbooks_loops.rst
index 5d88da5af8..e329d7650d 100644
--- a/docsite/rst/playbooks_loops.rst
+++ b/docsite/rst/playbooks_loops.rst
@@ -204,7 +204,7 @@ It might happen like so::
- authorized_key: "user={{ item.0.name }} key='{{ lookup('file', item.1) }}'"
with_subelements:
- - users
+ - "{{ users }}"
- authorized
Given the mysql hosts and privs subkey lists, you can also iterate over a list in a nested subkey::
@@ -212,7 +212,7 @@ Given the mysql hosts and privs subkey lists, you can also iterate over a list i
- name: Setup MySQL users
mysql_user: name={{ item.0.name }} password={{ item.0.mysql.password }} host={{ item.1 }} priv={{ item.0.mysql.privs | join('/') }}
with_subelements:
- - users
+ - "{{ users }}"
- mysql.hosts
Subelements walks a list of hashes (aka dictionaries) and then traverses a list with a given (nested sub-)key inside of those
diff --git a/samples/with_subelements.yml b/samples/with_subelements.yml
index 95d0dda67c..0037f4a631 100644
--- a/samples/with_subelements.yml
+++ b/samples/with_subelements.yml
@@ -14,5 +14,5 @@
tasks:
- debug: msg="user={{ item.0.name }} key='{{ item.1 }}'"
with_subelements:
- - users
+ - "{{ users }}"
- authorized