I created the following playbook, and this works as expected, but I don't
understand it in context to what you recommended:
---
- hosts: localhost
vars:
x: ['a','b','c']
y: ['1','2','3']
z: ['first','second','third']
tasks:
- name: Testing
debug: msg="x is {{ item.0 }}, y is {{ item.1 }} and z is {{ item.2
}}"
with_together:
- "{{ x }}"
- "{{ y }}"
- "{{ z }}"
Results:
PLAY [localhost]
*************************************************************************************************************************************************************************************************************************
TASK [Gathering Facts]
*******************************************************************************************************************************************************************************************************************
ok: [localhost]
TASK [Testing]
***************************************************************************************************************************************************************************************************************************
ok: [localhost] => (item=[u'a', u'1', u'first']) => {
"changed": false,
"item": [
"a",
"1",
"first"
],
"msg": "x is a, y is 1 and z is first"
}
ok: [localhost] => (item=[u'b', u'2', u'second']) => {
"changed": false,
"item": [
"b",
"2",
"second"
],
"msg": "x is b, y is 2 and z is second"
}
ok: [localhost] => (item=[u'c', u'3', u'third']) => {
"changed": false,
"item": [
"c",
"3",
"third"
],
"msg": "x is c, y is 3 and z is third"
}
--
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 [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/0262aa76-3786-454c-a6e0-b3c1dc754ea0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.