Dot_Files/roles/zsh/tasks/install-pyenv.yml

81 lines
1.8 KiB
YAML
Raw Normal View History

2022-08-01 00:42:23 -05:00
---
- name: Set Pyenv install path if not set
ansible.builtin.set_fact:
2022-08-01 01:48:49 -05:00
pyenv_install_path: "{{ xdg_data_home + '/pyenv' }}"
2022-08-01 02:12:33 -05:00
when: pyenv_install_path is not defined
- name: Check if Pyenv installed
ansible.builtin.stat:
path: "{{ pyenv_install_path }}"
register: pyenv_installed
changed_when: false
2022-08-01 00:42:23 -05:00
- name: Get Pyenv from git
2022-08-01 02:12:33 -05:00
when: not pyenv_installed.stat.exists
2022-08-01 00:42:23 -05:00
ansible.builtin.git:
repo: https://github.com/pyenv/pyenv.git
dest: "{{ pyenv_install_path }}"
version: master
- name: Install Pyenv
2022-08-01 02:12:33 -05:00
when: not pyenv_installed.stat.exists
2022-08-01 00:42:23 -05:00
ansible.builtin.shell: >
cd "{{ pyenv_install_path }}" &&
src/configure &&
make -C src
changed_when: true
2022-08-01 04:12:29 -05:00
- name: Install Pyenv build dependencies for Debian based systems
ansible.builtin.apt:
update_cache: true
name:
- make
- build-essential
- libssl-dev
- zlib1g-dev
- libbz2-dev
- libreadline-dev
- libsqlite3-dev
- wget
- curl
- llvm
- libncursesw5-dev
- xz-utils
- tk-dev
- libxml2-dev
- libxmlsec1-dev
- libffi-dev
- liblzma-dev
state: present
when: ansible_facts.os_family == 'Debian'
- name: Install Pyenv build dependencies for Arch systems
community.general.pacman:
update_cache: true
name:
- base-devel
- openssl
- zlib
- xz
- tk
state: present
when: ansible_facts.distribution == 'Archlinux'
- name: Install Pyenv build depdencies for CentOS
ansible.builtin.dnf:
update_cache: true
name:
- gcc
- zlib-devel
- bzip2
- bzip2-devel
- readline-devel
- sqlite
- sqlite-devel
- openssl-devel
- tk-devel
- libffi-devel
- xz-devel
state: present
when: ansible_facts.distribution == 'CentOS'