saltstack安装python3.7.2

python3-file:
file.managed:
- unless: test -d /opt/Python-3.7.2.tgz
- source: salt://python3/Python-3.7.2.tgz
- name: /opt/Python-3.7.2.tgz
- user: root
- group: root

python3-tar:
cmd.run:
- name: cd /opt && tar -zxvf Python-3.7.2.tgz
- unless: test -d Python3.7.2
- require:
- file: python3-file


python3-make:
cmd.run:
- name: cd /opt && mv Python-3.7.2 python3.7 && cd python3.7 && ./configure --enable-optimization
- unless: test -d python3.7

python3-make-install:
cmd.run:
- name: cd /opt/python3.7 && make && make install

python3-rmtgz:
file.absent:
- name: /opt/Python-3.7.2.tgz
- require:
- cmd: python3-make-install

猜你喜欢

转载自www.cnblogs.com/li0920/p/12072614.html