Files
Linux-Shell/Ansible-Playbook/install_python3.yml
2026-04-19 16:37:10 +08:00

20 lines
450 B
YAML

- name: bootstrap python3
hosts: all
gather_facts: false
tasks:
- name: check python3 exists
raw: command -v python3
register: py3_check
ignore_errors: true
- name: install python3 (debian/ubuntu)
raw: |
apt update &&
apt install -y python3 python3-apt
when: py3_check.rc != 0
- name: install python3 (centos)
raw: |
yum install -y python3
when: py3_check.rc != 0