ansible / ansible.builtin / v2.8.20 / lookup / nested composes a list with nested elements of other lists | "added in version" 1.1 of ansible.builtin" Authors: unknownansible.builtin.nested (v2.8.20) — lookup
pip
Install with pip install ansible==2.8.20
Takes the input lists and returns a list with elements that are lists composed of the elements of the input lists
- 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' ]
# As with the case of 'with_items' above, you can use previously defined variables.: - name: here, 'users' contains the above list of employees mysql_user: name: "{{ item[0] }}" priv: "{{ item[1] }}.*:ALL" append_privs: yes password: "foo" with_nested: - "{{ users }}" - [ 'clientdb', 'employeedb', 'providerdb' ]
_raw: description: - a set of lists required: true
_list: description: - A list composed of lists paring the elements of the input lists type: list