ansible/test/samples/with_subelements.yml

18 lines
383 B
YAML

- hosts: localhost
connection: local
gather_facts: no
vars:
users:
- name: alice
authorized:
- /tmp/alice/onekey.pub
- /tmp/alice/twokey.pub
- name: bob
authorized:
- /tmp/bob/id_rsa.pub
tasks:
- debug: msg="user={{ item.0.name }} key='{{ item.1 }}'"
with_subelements:
- "{{ users }}"
- authorized