There are some other internals inside of ansible/runner/__init__.py that do the 
behind the scenes magic required for the with_items stuff that is done for yum 
and apt:

https://github.com/ansible/ansible/blob/devel/lib/ansible/runner/__init__.py#L497

So, in short, it requires modifications to that __init__.py file to make it 
work.
-- 
Matt Martz
[email protected]

On January 6, 2014 at 6:06:04 PM, Dmitry Makovey ([email protected]) wrote:

I'm playing with my module and would like to cram most operations into one 
transaction under 'with_items' according to the docs 'yum' and 'apt' modules 
can combine multiple operations generated by 'with_items' into one. However I'm 
a bit puzzled as to what is causing it to behave that way. 

http://pastebin.com/hU2csR6b is the code. and here's the playbook:

  - name: Testing Foo
    foo: name={{ item }} state=present
    with_items:
    - 1
    - 2
    - 3

I expect /tmp/foo to contain 1,2,3 (it seems like that is how yum is receiving 
it's list of packages) but I end up with '3' every time (result of file being 
overwritten 2 times). I'm definitely missing something, but what?
--
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].
For more options, visit https://groups.google.com/groups/opt_out.

-- 
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].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to