читайте with_dict
openvpn_users:
- {name: test, ip: "ifconfig-push 10.111.8.8 255.255.255.0"}
- {name: test2, ip: "ifconfig-push 10.111.8.8 255.255.255.0"}
- name: Adding new user with static IP
template:
src: cleanfile.j2
dest: "/etc/openvpn/server/ccd/{{ item.key.name }}"
owner: "{{ user }}"
group: "{{ group }}"
mode: 0744
with_dict: "{{ openvpn_users }}"
tags: adduser
atal: [openvpn-test-01]: FAILED! => {"msg": "The task includes an option with an undefined variable. The error was: 'ansible.utils.unsafe_proxy.AnsibleUnsafeText object' has no attribute 'name'\
блин ну что не так то