Lots of updated roles

This commit is contained in:
2020-05-12 17:07:38 -06:00
parent 5a9254097e
commit 6bb3e3f34f
35 changed files with 264 additions and 125 deletions

View File

@@ -12,8 +12,4 @@ if command -v pyenv 1>/dev/null 2>&1; then
eval "$(pyenv init -)"
fi
# Python aliases
alias pv='echo "Version:" && python --version && echo && echo "Interpreter Path:" && python -c "import sys;print(sys.prefix)" && echo && echo "Paths:" && python -c "import sys;print(sys.path);"'
alias activate='source env/bin/activate && pv'
alias pips='pipenv shell && echo "pipenv shell has been deactivated" && echo && pv'
# Python aliases for pv, activate and pips should already be defined in shared/server

View File

@@ -17,6 +17,8 @@
- libgdbm-dev
- libc6-dev
- libbz2-dev
- libffi-dev
when: ansible_os_family == "Debian" and ansible_distribution_major_version == "9"
# Debian 10
- name: Installing build-essential and pyenv dependencies
@@ -34,21 +36,19 @@
- libc6-dev
- libbz2-dev
- libffi-dev
when: ansible_os_family == "Debian" and ansible_distribution_major_version == "10"
when: ansible_os_family == "Debian" and ansible_distribution_major_version == "10"
# Install pyenv using git clone
# Install pyenv using git clone
- name: Installing pyenv using git clone
git:
repo: https://github.com/pyenv/pyenv.git
dest: /usr/local/lib/pyenv
force: yes
depth: 1
# Set users and permissions
# There is also a files/bin/pyenv-fix-permissions.sh that mirror the below
# which you can run manually after you install a new version (pyenv sets mask and ignores setfacl)
- command: chown toor:staff /usr/local/lib/pyenv -R
- command: chmod 2775 /usr/local/lib/pyenv
- file: 'path=/usr/local/lib/pyenv owner={{ superuser }} group={{ supergroup }} state=directory recurse=yes mode=2775'
- command: find /usr/local/lib/pyenv -type d -exec chmod 2775 {} \;
- command: setfacl -R -d -m user::rwx,group::rwx /usr/local/lib/pyenv

View File

@@ -0,0 +1,20 @@
---
# Pre output
- debug:
msg: 'Pyenv about to install python {{ item }}'
with_items: '{{ python_versions }}'
# Install python versions via pyenv
- name: 'Installing Python version(s) via pyenv'
become_user: '{{ superuser }}'
shell: 'source /etc/profile.d/pyenv.sh && /usr/local/lib/pyenv/bin/pyenv install --skip-existing {{ item }}'
args:
executable: /bin/bash
with_items: '{{ python_versions }}'
# Set pyenv global python versions
- name: 'Setting pyenv global python versions'
become_user: '{{ superuser }}'
shell: 'source /etc/profile.d/pyenv.sh && /usr/local/lib/pyenv/bin/pyenv global {{ python_global_versions }}'
args:
executable: /bin/bash

View File

@@ -1,9 +1,13 @@
---
# Install pyenv
- include_tasks: install-pyenv.yml
# Copy profiles to /etc/profile.d/
- include_tasks: ../../../functions/copy_etc-profile.d.yml
# Copy scripts to /usr/local/bin
- include_tasks: ../../../functions/copy_usr-local-bin.yml
# Install pyenv
- include_tasks: install-pyenv.yml
# Install python versions
- include_tasks: install-python.yml

View File

@@ -7,7 +7,7 @@
# mReschke 2019-04-19
path=/usr/local/lib/pyenv
chown toor:staff $path -R
chown {{ superuser }}:{{ supergroup }} $path -R
chmod 2775 $path
find $path -type d -exec chmod 2775 {} \;
setfacl -R -d -m user::rwx,group::rwx $path