blob: 1ff13fb36ea2edaeaa2f16661dea124fe67a1d7f [file] [log] [blame]
---
- block:
- name: Update pip with proxy
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
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
import_role:
name: apigee-opdk-setup-os-epel
- name: Install pip with proxy
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 }}"