Leo Gaspard
unread,Sep 30, 2015, 9:45:06 AM9/30/15Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Ansible Project
Hello,
This being my first post on this mailing list, please tell me if I break
any custom.
I am trying to write a role that uses `with_items` along with `roles`.
However, I am currently stumbling upon a weird thing: I cannot use {{
item }} for role variable definitions.
Here is a MWE:
File vpnclients.yml
==========8<==========
---
- hosts: vpnclients
roles:
- role: openvpn-client
openvpn_client_server: "{{ item }}"
with_items: "{{ groups['vpnservers'] }}"
==========>8==========
File roles/openvpn-client/tasks/main.yml
==========8<==========
---
- debug: msg='calling for server {{ openvpn_client_server }}'
==========>8==========
Error message
==========8<===========
fatal: [hostname]: FAILED! => {"failed": true, "msg": "ERROR! ERROR!
'item' is undefined"}
==========>8==========
Without the {{ openvpn_client_server }} part, it works.
Hoping for any help, and thanking you in advance,
Leo Gaspard