1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
--- # tasks file for python_pip - name: include assert.yml include_tasks: assert.yml run_once: yes - name: install python pip package: name: "{{ python_pip_packages }}" state: present - name: configure pip proxy ini_file: path: /etc/pip.conf section: global option: index-url value: "{{ python_pip_proxy }}" mode: "0644" when: - python_pip_proxy is defined - name: trust hosts ini_file: path: /etc/pip.conf section: global option: trusted-host value: "{{ python_pip_trusted_host }}" mode: "0644" when: - python_pip_trusted_host is defined - name: install requested modules pip: name: "{{ item.name }}" state: present version: "{{ item.version | default(omit) }}" loop: "{{ python_pip_modules }}" loop_control: label: "{{ item.name }}"