Commit 7d930fe1 authored by nanahira's avatar nanahira

update python

parent 6ac6b54a
Pipeline #582 passed with stage
in 3 minutes and 45 seconds
...@@ -119,17 +119,16 @@ ...@@ -119,17 +119,16 @@
append: true append: true
groups: docker groups: docker
when: ansible_user_id != 'root' when: ansible_user_id != 'root'
- name: docker-compose - name: docker-compose requests workaround
become: true become: true
pip: pip:
name: docker-compose name: requests
when: not china_mirror_pip extra_args: --ignore-installed
- name: docker-compose 国内 when: ansible_python.version.major == 2
- name: docker-compose
become: true become: true
pip: pip:
name: docker-compose name: docker-compose
extra_args: -i https://mirrors.aliyun.com/pypi/simple/
when: china_mirror_pip
- name: docker 配置 创建目录 - name: docker 配置 创建目录
become: true become: true
file: file:
......
...@@ -15,6 +15,26 @@ ...@@ -15,6 +15,26 @@
file: file:
path: '{{ansible_user_dir}}/.pip' path: '{{ansible_user_dir}}/.pip'
state: absent state: absent
when: not china_mirror_pip
- name: pip dir
become: true
file:
path: '{{ansible_user_dir}}/.pip'
state: directory
owner: '{{ansible_user_id}}'
group: '{{ansible_user_id}}'
when: china_mirror_pip
- name: pip conf for china mirror
become: true
copy:
content: |
[global]
index-url = https://mirrors.aliyun.com/pypi/simple/
[install]
trusted-host = mirrors.aliyun.com
dest: '{{ansible_user_dir}}/.pip/pip.conf'
owner: '{{ansible_user_id}}'
group: '{{ansible_user_id}}'
- name: clean easy install - name: clean easy install
become: true become: true
file: file:
...@@ -32,14 +52,6 @@ ...@@ -32,14 +52,6 @@
name: pip name: pip
executable: '{{pip_executable_install}}' executable: '{{pip_executable_install}}'
state: latest state: latest
when: not china_mirror_pip
- name: upgrade pip China
become: true
pip:
name: pip
executable: '{{pip_executable_install}}'
state: latest
extra_args: -i https://mirrors.aliyun.com/pypi/simple/
when: china_mirror_pip when: china_mirror_pip
- name: pip package list - name: pip package list
set_fact: set_fact:
...@@ -48,10 +60,3 @@ ...@@ -48,10 +60,3 @@
become: true become: true
pip: pip:
name: '{{pip_package_list}}' name: '{{pip_package_list}}'
when: not china_mirror_pip
- name: pip packages China
become: true
pip:
name: '{{pip_package_list}}'
extra_args: -i https://mirrors.aliyun.com/pypi/simple/
when: china_mirror_pip
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment