update
This commit is contained in:
parent
e79bd61730
commit
0f09bb0691
9
roles/game_py38.yml
Normal file
9
roles/game_py38.yml
Normal file
@ -0,0 +1,9 @@
|
||||
---
|
||||
|
||||
- hosts: dev
|
||||
gather_facts: false
|
||||
remote_user: root
|
||||
roles:
|
||||
- dependencies
|
||||
- openssh
|
||||
- python
|
BIN
roles/game_pytho38/files/Python-3.8.6.tgz
(Stored with Git LFS)
Normal file
BIN
roles/game_pytho38/files/Python-3.8.6.tgz
(Stored with Git LFS)
Normal file
Binary file not shown.
3
roles/game_pytho38/files/pip.conf
Normal file
3
roles/game_pytho38/files/pip.conf
Normal file
@ -0,0 +1,3 @@
|
||||
[global]
|
||||
index-url = https://pypi.douban.com/simple
|
||||
trusted-host = pypi.douban.com
|
33
roles/game_pytho38/tasks/install.yml
Normal file
33
roles/game_pytho38/tasks/install.yml
Normal file
@ -0,0 +1,33 @@
|
||||
---
|
||||
|
||||
- name: 创建下载目录
|
||||
file:
|
||||
path: /data/xdata_software
|
||||
state: directory
|
||||
|
||||
- name: 解压缩
|
||||
unarchive:
|
||||
src: Python-3.8.6.tgz
|
||||
dest: /data/xdata_software
|
||||
|
||||
- name: 设置编译
|
||||
shell:
|
||||
chdir: /data/xdata_software/Python-3.8.6
|
||||
cmd: ./configure --prefix=/usr/local/python3 --enable-optimizations --with-openssl=/usr/local/openssl
|
||||
|
||||
- name: 编译安装
|
||||
shell:
|
||||
chdir: /data/xdata_software/Python-3.8.6
|
||||
cmd: make && make install
|
||||
|
||||
- name: python3软连接
|
||||
file:
|
||||
src: /usr/local/python3/bin/python3
|
||||
dest: /usr/local/bin/python3
|
||||
state: link
|
||||
|
||||
- name: pip3软连接
|
||||
file:
|
||||
src: /usr/local/python3/bin/pip3
|
||||
dest: /usr/local/bin/pip3
|
||||
state: link
|
6
roles/game_pytho38/tasks/install_pkg.yml
Normal file
6
roles/game_pytho38/tasks/install_pkg.yml
Normal file
@ -0,0 +1,6 @@
|
||||
---
|
||||
- name: 安装pymongo
|
||||
shell:
|
||||
chdir: ~
|
||||
cmd: pip3 install pymongo==3.11.1
|
||||
|
14
roles/game_pytho38/tasks/main.yml
Normal file
14
roles/game_pytho38/tasks/main.yml
Normal file
@ -0,0 +1,14 @@
|
||||
---
|
||||
|
||||
- name: 检查Python安装
|
||||
stat:
|
||||
path: /usr/local/python3
|
||||
register: python3_stat_result
|
||||
|
||||
- name: 安装Python3
|
||||
include: install.yml
|
||||
when: not python3_stat_result.stat.exists
|
||||
|
||||
|
||||
- name: 安装必须的Python包
|
||||
include: install_pkg.yml
|
5
roles/game_pytho38/tasks/setpip.yml
Normal file
5
roles/game_pytho38/tasks/setpip.yml
Normal file
@ -0,0 +1,5 @@
|
||||
---
|
||||
- name: 设置pip源
|
||||
copy:
|
||||
src: pip.conf
|
||||
dest: /root/.pip/pip.conf
|
Loading…
Reference in New Issue
Block a user