Hi Brian, On 2018-05-02 16:55, Brian Coca wrote:> I'm unsure what the problem you state with strings is, `loop` also > accepts a list directly: > > debug: > msg: one line of {{ item }} > loop: > - item1 > - item2
Yeah, my fault, I took the very simple example where the new construct isn't really different from the old one. If I take the more complex example from the documentation: - name: give users access to multiple databases mysql_user: name: "{{ item[0] }}" priv: "{{ item[1] }}.*:ALL" append_privs: yes password: "foo" loop: "{{ query('nested', [ 'alice', 'bob' ], [ 'clientdb', 'employeedb', 'providerdb' ]) }}" It used to be: - 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' ] - [ 'clientdb', 'employeedb', 'providerdb' ] What I mean is that the loop's string with the query/lookup is now a string containing lists of strings, with no syntax highlighting and a worse readability (and some strange behaviours if you don't get the quoting right). As for the actual implementation, yours is as good as mine, important to my eyes is that it remains a YAML structure and no string. KR, Eric PS: sorry for the first private answer, hit the wrong button... -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from this group and stop receiving emails from it, send an email to ansible-project+unsubscr...@googlegroups.com. To post to this group, send email to ansible-project@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/ce27ffe5-5ba2-7713-87da-7c4033089855%40redhat.com. For more options, visit https://groups.google.com/d/optout.