You seem to be running into this issue
https://github.com/ansible/ansible/issues/8233


On Fri, Jul 10, 2015 at 11:16 AM, Vineet Naik <[email protected]> wrote:
> Hi,
>
> I am using the pip module to install python dependencies. What I am trying
> to achieve is -
>
> To be able to define the dependencies in one of the vars_files as follows
>
> ```
> pydeps:
>   - name: requests
>     virtualenv: /tmp/testvenv
>   - name: boto
>     editable: yes
>   - requirements: /tmp/requirements.txt
>     virtualenv: /tmp/anothertestenv
> ```
>
> Basically, the fields in the above list of dicts can be any valid options
> accepted by the pip module - http://docs.ansible.com/pip_module.html.
> Those options that are not required can be omitted just like they can be
> omitted when specifying the args to the module.
>
> And then in tasks,
>
> ```
>     - name: Install using pip
>       pip: "{% for k, v in item.items() %}{{ k }}={{ v }} {% endfor %}"
>       with_items: pydeps
> ```
>
> However, this fails with the following error:
>
> ```
> TASK: [Install using pip]
> *****************************************************
> fatal: [localhost] => A variable inserted a new parameter into the module
> args. Be sure to quote variables if they contain equal signs (for example:
> "{{var}}").
>
> FATAL: all hosts have already failed -- aborting
> ```
>
> None of the fields contain an equal sign.
>
> I have also tried the following:
>
> ```
>     - name: Install using pip
>       pip: >
>         name={{ item.name }}
>         {{ 'chdir='~item.chdir if item.get('chdir') else '' }}
>         {{ 'virtualenv='~item.virtualenv if item.get('virtualenv') else ''
> }}
>         # ... and so on
>       with_items: pydeps
> ```
>
> But it also fails with the same error if any of the key is missing for an
> item.
>
> What's the correct way to do this?
>
> Thanks
>
> --
> 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/be3a5ed3-cdc9-493b-90ae-5d0916b8a505%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.



-- 
With Regards,
Mehul Ved

-- 
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/CADTL0oa%2BL0%3DShdRMuW0w47NGNpg8R3BBSRgM0rBuBm7pBAuHdA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to