2019-01-16 13:57:02 +08:00
|
|
|
---
|
|
|
|
- name: check for python
|
|
|
|
stat:
|
|
|
|
path: /usr/bin/python
|
|
|
|
ignore_errors: yes
|
|
|
|
register: systempython
|
|
|
|
|
|
|
|
- name: install python for debian based systems
|
|
|
|
raw: apt-get -y install python-simplejson
|
|
|
|
ignore_errors: yes
|
2019-02-18 22:45:36 +08:00
|
|
|
register: result
|
2019-04-01 23:46:15 +08:00
|
|
|
when: systempython.stat is undefined or not systempython.stat.exists
|
2019-02-18 22:45:36 +08:00
|
|
|
until: result is succeeded
|
2019-01-16 13:57:02 +08:00
|
|
|
|
|
|
|
- name: install python for fedora
|
|
|
|
raw: dnf -y install python3; ln -sf /usr/bin/python3 /usr/bin/python creates=/usr/bin/python
|
|
|
|
ignore_errors: yes
|
2019-02-18 22:45:36 +08:00
|
|
|
register: result
|
2019-04-01 23:46:15 +08:00
|
|
|
when: systempython.stat is undefined or not systempython.stat.exists
|
2019-02-23 01:17:25 +08:00
|
|
|
until: (result is succeeded) and ('Failed' not in result.stdout)
|
2019-01-16 13:57:02 +08:00
|
|
|
|
|
|
|
- name: install python for opensuse
|
|
|
|
raw: zypper -n install python-base creates=/usr/bin/python2.7
|
|
|
|
ignore_errors: yes
|
2019-02-18 22:45:36 +08:00
|
|
|
register: result
|
2019-04-01 23:46:15 +08:00
|
|
|
when: systempython.stat is undefined or not systempython.stat.exists
|
|
|
|
until: result is succeeded
|