Re: [ansible-project] with_items combined with with_first_file ?

2014-07-25 Thread Klokkie
Just out of curiosity, if not with lookup('first_found',...) how would you do with_items: itemlistvar with_first_found: - file1 - file2 - etc.. Are you suggesting: with_nested: - itemlistvar - lookup('first_found', ... ) On Tuesday, 14 January 2014 15:16:01 UTC, Michael DeHaan wro

Re: [ansible-project] with_items combined with with_first_file ?

2014-01-14 Thread Michael DeHaan
It's not really intended that first_found be used in this way, because it's a plugin that returns lists to iterate on, as opposed to 'file'. However, it is definitely something that will continue to work. It just wouldn't make sense using with_items with, say, 'items' in the lookup, for that, go

Re: [ansible-project] with_items combined with with_first_file ?

2014-01-14 Thread martin
Hi Serge, This worked great. I didn't realize that you could use the with_* functions with lookup(), now things makes more sense. Thank you! Best regards, /Martin Something like this might work: > ​​ > - name: Copy zone files > copy: src={{ > ​lookup('first_found', ['path/to/zones/' + ​ > it

Re: [ansible-project] with_items combined with with_first_file ?

2014-01-14 Thread martin
Hi Serge, This worked great, thank you. I didn't realize that you could use the with_* functions with lookup(), now things makes a lot more sense. Best regards, /Martin Something like this might work: > ​​ > - name: Copy zone files > copy: src={{ > ​lookup('first_found', ['path/to/zones/' +

Re: [ansible-project] with_items combined with with_first_file ?

2014-01-13 Thread Serge van Ginderachter
On 13 January 2014 14:18, wrote: > - name: Copy zone files > copy: src=zones/{{ item }} dest=/var/named/zones/{{ item }} > with_first_file: > - path/to/zones/{{ item }}.db > - path/to/zones/default.db > with_items: > - list_of_zones > Something like this might work: - name: Co

[ansible-project] with_items combined with with_first_file ?

2014-01-13 Thread martin
I've been looking for a solutions for this, but I can't seem to figure it out. Here is what I want to do: I'm writing a playbook to manage a number of DNS servers. I have a list of zones in my vars file, like so: list_of_zones: - a.com - b.com - c.com etc... I then have a dir with each z