This commit is contained in:
Gitea 2021-01-19 10:27:34 +08:00
parent e79bd61730
commit 0f09bb0691
7 changed files with 73 additions and 0 deletions

9
roles/game_py38.yml Normal file
View 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

Binary file not shown.

View File

@ -0,0 +1,3 @@
[global]
index-url = https://pypi.douban.com/simple
trusted-host = pypi.douban.com

View 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

View File

@ -0,0 +1,6 @@
---
- name: 安装pymongo
shell:
chdir: ~
cmd: pip3 install pymongo==3.11.1

View 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

View File

@ -0,0 +1,5 @@
---
- name: 设置pip源
copy:
src: pip.conf
dest: /root/.pip/pip.conf