On 01. sep. 2016 16:57, [email protected] wrote:
Hi,
Is there a way to do the same as "with_items" but globally for the playbook?
For example something like :
variable1:
- {url: 'http://someting', dest: 'something', src: 'something'}
- {url: 'http://someting2', dest: 'something2', src: 'something2'}
This will work.
and use it like this in the playbook.
- name: Download something
get_url:
url="{{ variable1.url }}"
dest="/tmp/{{ variable1.dest}}"
and in an other place use the same infos
- name: Extract
unarchive:
src=/tmp/{{ variable1.src}}
dest=/tmp/ copy=no
But this will not. Since it is a list you need to specify which list
item you want.
Fist item (someting):
{{ variable1[0].url }}
Second item (someting2):
{{ variable1[1].url }}
--
Kai Stian Olstad
--
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/f7d7f5d7-cb8c-7f61-e596-ab84b275f9a3%40olstad.com.
For more options, visit https://groups.google.com/d/optout.