On 29.06.2016 23:41, Tiglath wrote:
pip install <package>==<version>

I can see that you can do


pip: name={{ item }} state=present
with_items:
  - <package>
  - <package>
   ...

But how can I specify the version in a loop?

I do this

- pip:
    name={{ item.name }}
    version={{ item.version | default(omit) }}
  with_items:
    - name: pack1
      version: 1.1
    - name: pack2
    - name: pack3
    - name: pack4
      version: 5.0

As you can see, you'll be able to mix packages with or without version requirement.

--
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/2b35ea409894c58294be90e5c92efc7b%40olstad.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to