You've already forked base
54 lines
1.2 KiB
YAML
54 lines
1.2 KiB
YAML
---
|
|
- name: python | install python3 packages
|
|
apt:
|
|
name: "{{ item }}"
|
|
state: present
|
|
with_items:
|
|
- python3-venv
|
|
- python3-pip
|
|
when:
|
|
- ansible_distribution == 'Debian'
|
|
|
|
- name: python | install package (legacy)
|
|
pip:
|
|
name:
|
|
- ps_mem
|
|
- bpytop
|
|
executable: pip3
|
|
when:
|
|
- ansible_distribution == 'Debian'
|
|
- ansible_distribution_major_version | int < 12
|
|
|
|
- name: python | create venv directory
|
|
file:
|
|
path: /opt/python/venv
|
|
state: directory
|
|
mode: '0755'
|
|
when:
|
|
- ansible_distribution == 'Debian'
|
|
- ansible_distribution_major_version | int >= 12
|
|
|
|
- name: python | install packages in venv
|
|
pip:
|
|
name:
|
|
- ps_mem
|
|
- bpytop
|
|
virtualenv: /opt/python/venv/brainsys
|
|
virtualenv_command: /usr/bin/python3 -m venv
|
|
when:
|
|
- ansible_distribution == 'Debian'
|
|
- ansible_distribution_major_version | int >= 12
|
|
|
|
- name: python | link binaries
|
|
file:
|
|
src: "/opt/python/venv/brainsys/bin/{{ item }}"
|
|
dest: "/usr/local/bin/{{ item }}"
|
|
state: link
|
|
loop:
|
|
- ps_mem
|
|
- bpytop
|
|
when:
|
|
- ansible_distribution == 'Debian'
|
|
- ansible_distribution_major_version | int >= 12
|
|
|