On 09. juli 2017 00:09, Anfield wrote:
Hi,

Thanks for the reponse. This works but I dont quite understand it...

So copylist  is now basically a list with two listed values
    - src
    - src

How does it pick up dest when its not really designated as a list item with
a dash (-)?
I wouldve expected -dest to be listed aswell twice

The dash indicate start of a list item.
And item contains a dictionary, this has two element src and dest.

You can write a list of dictionary in two ways

copylist:
  - src: /home/ansible/tom/tom.txt
    dest: /home/ansible/tom1
  - src: /home/ansible/fred/fred.txt
    dest: /home/ansible/fred1

or

copylist:
  - {'src':'/home/ansible/tom/tom.txt', 'dest':'/home/ansible/tom1'}
  - {'src':'/home/ansible/fred/fred.txt', 'dest':'/home/ansible/fred1'}

Which syntax used, come down to personal preferences.

--
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 ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/067c02d0-11f9-bbab-148a-43935607c746%40olstad.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to