| --- |
| # tasks file for apigee-opdk-setup-os-pip/ |
| |
| - name: Create pip config folder |
| file: |
| path: "{{ pip_conf_dir }}" |
| state: directory |
| when: pip_conf_dir is defined |
| |
| - name: Configure pip |
| template: |
| src: pip.conf.j2 |
| dest: "{{ pip_conf_dir }}/pip.conf" |
| when: pip_conf_dir is defined and pip_index_url is defined |
| |
| - block: |
| - name: Update pip with proxy |
| become: yes |
| pip: |
| name: pip |
| state: latest |
| register: result |
| environment: |
| http_proxy: "{{ http_proxy }}" |
| https_proxy: "{{ https_proxy }}" |
| no_proxy: "{{ no_proxy }}" |
| |
| rescue: |
| |
| - block: |
| - name: Install pip with proxy |
| become: yes |
| yum: |
| name: python-pip |
| state: latest |
| environment: |
| http_proxy: "{{ http_proxy }}" |
| https_proxy: "{{ https_proxy }}" |
| no_proxy: "{{ no_proxy }}" |
| |
| rescue: |
| - name: Install epel with proxy |
| become: yes |
| import_role: |
| name: apigee-opdk-setup-os-epel |
| |
| - name: Install pip with proxy |
| become: yes |
| yum: |
| name: python-pip |
| state: latest |
| environment: |
| http_proxy: "{{ http_proxy }}" |
| https_proxy: "{{ https_proxy }}" |
| no_proxy: "{{ no_proxy }}" |
| |
| become: yes |
| |
| - name: Update pip packages with proxy |
| tags: ['pip'] |
| become: yes |
| pip: |
| name: '{{ item }}' |
| state: present |
| with_items: "{{ pip_packages }}" |
| environment: |
| http_proxy: "{{ http_proxy }}" |
| https_proxy: "{{ https_proxy }}" |
| no_proxy: "{{ no_proxy }}" |
| |
| #- name: Download pip package manager with proxy |
| # become: yes |
| # tags: ['pip-manager'] |
| # get_url: |
| # url: https://bootstrap.pypa.io/get-pip.py |
| # dest: /tmp/get-pip.py |
| # validate_certs: no |
| # when: pip_conf_dir is not defined |
| # environment: |
| # http_proxy: "{{ http_proxy }}" |
| # https_proxy: "{{ https_proxy }}" |
| # no_proxy: "{{ no_proxy }}" |
| # |
| #- name: Install pip package manager with proxy |
| # become: yes |
| # tags: ['pip-manager'] |
| # shell: python /tmp/get-pip.py |
| # when: pip_conf_dir is not defined |
| # environment: |
| # http_proxy: "{{ http_proxy }}" |
| # https_proxy: "{{ https_proxy }}" |
| # no_proxy: "{{ no_proxy }}" |
| # |
| #- name: Update pip |
| # tags: ['pip'] |
| # become: yes |
| # pip: |
| # name: pip |
| # state: latest |
| # environment: |
| # http_proxy: "{{ http_proxy }}" |
| # https_proxy: "{{ https_proxy }}" |
| # no_proxy: "{{ no_proxy }}" |
| # |
| #- name: Update python packages with no proxy |
| # tags: ['pip'] |
| # become: yes |
| # pip: |
| # name: '{{ item }}' |
| # state: present |
| # with_items: "{{ pip_packages }}" |
| # environment: |
| # http_proxy: "{{ http_proxy }}" |
| # https_proxy: "{{ https_proxy }}" |
| # no_proxy: "{{ no_proxy }}" |