From d0241f5640ece0c16c6713534da99827a25c4841 Mon Sep 17 00:00:00 2001 From: tsemerad Date: Tue, 3 Jun 2014 17:45:03 -0700 Subject: [PATCH] made nested lists diff lengths - caused confusion As a relatively-new user to Ansible, the Nested Loop example made me think it was looping through both lists together (`alice` would go with `clientdb`, `bob` with `employeedb`) and not actually nested. I realize now I was just being stupid, but I feel making the example lists different lengths would prevent such confusion in the future. --- docsite/rst/playbooks_loops.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docsite/rst/playbooks_loops.rst b/docsite/rst/playbooks_loops.rst index 9b869cc4fd1..41e2d932c9f 100644 --- a/docsite/rst/playbooks_loops.rst +++ b/docsite/rst/playbooks_loops.rst @@ -53,7 +53,7 @@ Loops can be nested as well:: - name: give users access to multiple databases mysql_user: name={{ item[0] }} priv={{ item[1] }}.*:ALL append_privs=yes password=foo with_nested: - - [ 'alice', 'bob', 'eve' ] + - [ 'alice', 'bob' ] - [ 'clientdb', 'employeedb', 'providerdb' ] As with the case of 'with_items' above, you can use previously defined variables. Just specify the variable's name without templating it with '{{ }}'::