mirror of
https://github.com/iiab/iiab.git
synced 2025-03-09 15:40:17 +00:00
workaround python2 being unavailable
This commit is contained in:
parent
a6b8a5bfc8
commit
9f87beb9c9
2 changed files with 30 additions and 1 deletions
|
@ -17,9 +17,13 @@
|
|||
- python-setuptools # Provides setuptools-44 on recent OS's (last version compatible with python2)
|
||||
- virtualenv # Drags in 'python3-virtualenv' which in turn drags in 'python3-pip' -- for Ansible module 'pip' when used with 'virtualenv_command: /usr/bin/virtualenv' and 'virtualenv_python: python2.7' -- compare package 'python3-venv' used by roles {calibre-web, jupyterhub, lokole}
|
||||
state: present
|
||||
#when: not (is_debian_9 or is_debian_10 or is_ubuntu_16 or is_ubuntu_17 or is_ubuntu_18 or is_ubuntu_19)
|
||||
when: not (is_debian_12 or is_ubuntu_2304)
|
||||
# 2020-03-31: Testing for {is_raspbian_9, is_raspbian_10} is not currently nec, as testing for {is_debian_9, is_debian_10} covers that already.
|
||||
|
||||
- name: Use scripts/install_python2.sh to install python2 and virtualenv
|
||||
command: "{{ iiab_dir }}/scripts/install_python2.sh"
|
||||
when: is_debian_12 or is_ubuntu_2304
|
||||
|
||||
- name: Use pip to pin setuptools to 44 in {{ kalite_venv }} # WAS: if Raspbian/Debian > 10 or Ubuntu > 19
|
||||
pip:
|
||||
name: setuptools==44
|
||||
|
|
25
scripts/install_python2.sh
Executable file
25
scripts/install_python2.sh
Executable file
|
@ -0,0 +1,25 @@
|
|||
#!/bin/bash
|
||||
ARCH=$(dpkg --print-architecture)
|
||||
cd /tmp
|
||||
case $ARCH in
|
||||
"arm64")
|
||||
wget http://ftp.debian.org/debian/pool/main/p/python2.7/libpython2.7-minimal_2.7.18-8_arm64.deb
|
||||
apt install ./libpython2.7-minimal_2.7.18-8_arm64.deb
|
||||
wget http://ftp.debian.org/debian/pool/main/p/python2.7/python2.7-minimal_2.7.18-8_arm64.deb
|
||||
apt install ./python2.7-minimal_2.7.18-8_arm64.deb
|
||||
;;
|
||||
"amd64")
|
||||
wget http://ftp.debian.org/debian/pool/main/p/python2.7/libpython2.7-minimal_2.7.18-8_amd64.deb
|
||||
apt install ./libpython2.7-minimal_2.7.18-8_amd64.deb
|
||||
wget http://ftp.debian.org/debian/pool/main/p/python2.7/python2.7-minimal_2.7.18-8_amd64.deb
|
||||
apt install ./python2.7-minimal_2.7.18-8_amd64.deb
|
||||
;;
|
||||
"armhf")
|
||||
wget http://raspbian.raspberrypi.org/raspbian/pool/main/p/python2.7/libpython2.7-minimal_2.7.18-13.2_armhf.deb
|
||||
apt install ./libpython2.7-minimal_2.7.18-13.2_armhf.deb
|
||||
wget http://raspbian.raspberrypi.org/raspbian/pool/main/p/python2.7/python2.7-minimal_2.7.18-13.2_armhf.deb
|
||||
apt install ./libpython2.7-minimal_2.7.18-13.2_armhf.deb
|
||||
;;
|
||||
esac
|
||||
rm *.deb
|
||||
apt -y install virtualenv
|
Loading…
Add table
Add a link
Reference in a new issue