mirror of
https://github.com/cwchristerw/tjas-infra
synced 2025-08-08 21:24:33 +00:00
Add Python3 to installer tasks
This commit is contained in:
@@ -1,4 +1,37 @@
|
|||||||
---
|
---
|
||||||
|
- name: "Init : Python 3 : Install"
|
||||||
|
ansible.builtin.raw: apt install -y python3 python3-pip python3-setuptools python3-venv python3-dev
|
||||||
|
register: task
|
||||||
|
changed_when:
|
||||||
|
- "task.stdout.find('0 upgraded, 0 newly installed, 0 to remove') == -1"
|
||||||
|
|
||||||
|
- name: "Init: Python 3 : Libraries - APT"
|
||||||
|
ansible.builtin.raw: apt install -y python3-apt
|
||||||
|
register: task
|
||||||
|
changed_when:
|
||||||
|
- "task.stdout.find('0 upgraded, 0 newly installed, 0 to remove') == -1"
|
||||||
|
|
||||||
|
- name: "Init : Python 3 : Configure - Virtual Environment : Test"
|
||||||
|
ansible.builtin.raw: "/opt/ansible/bin/pip3"
|
||||||
|
register: task632
|
||||||
|
changed_when: false
|
||||||
|
failed_when: false
|
||||||
|
|
||||||
|
- name: "Init : Python 3 : Configure - Virtual Environment : Delete"
|
||||||
|
ansible.builtin.file:
|
||||||
|
path: "/opt/ansible"
|
||||||
|
state: absent
|
||||||
|
when:
|
||||||
|
- "task632.stdout.find(\"ModuleNotFoundError: No module named 'pip'\") != -1"
|
||||||
|
|
||||||
|
- name: "Init : Python 3 : Configure - Virtual Environment : Create"
|
||||||
|
ansible.builtin.pip:
|
||||||
|
name: pip
|
||||||
|
state: latest
|
||||||
|
extra_args: --upgrade
|
||||||
|
virtualenv: /opt/ansible
|
||||||
|
virtualenv_command: "python3 -m venv"
|
||||||
|
|
||||||
- name: "Installer : Tools : Install"
|
- name: "Installer : Tools : Install"
|
||||||
ansible.builtin.apt:
|
ansible.builtin.apt:
|
||||||
name: "{{ package }}"
|
name: "{{ package }}"
|
||||||
|
Reference in New Issue
Block a user