1
0
Fork 0
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:
Jerry Vonau 2023-04-05 13:02:43 -05:00
parent a6b8a5bfc8
commit 9f87beb9c9
2 changed files with 30 additions and 1 deletions

View file

@ -17,9 +17,13 @@
- python-setuptools # Provides setuptools-44 on recent OS's (last version compatible with python2) - 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} - 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 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. # 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 - name: Use pip to pin setuptools to 44 in {{ kalite_venv }} # WAS: if Raspbian/Debian > 10 or Ubuntu > 19
pip: pip:
name: setuptools==44 name: setuptools==44

25
scripts/install_python2.sh Executable file
View 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