mirror of
https://github.com/iiab/iiab.git
synced 2025-03-09 15:40:17 +00:00
Merge pull request #3527 from jvonau/python2_fix
Python2 fix [for KA Lite on Debian 12 or Ubuntu 23.04 / 23.10]
This commit is contained in:
commit
a4a7b3a6b5
5 changed files with 99 additions and 1 deletions
|
@ -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 or is_ubuntu_2310)
|
||||||
# 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 or is_ubuntu_2310
|
||||||
|
|
||||||
- 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
|
||||||
|
|
71
scripts/install_python2.sh
Executable file
71
scripts/install_python2.sh
Executable file
|
@ -0,0 +1,71 @@
|
||||||
|
#!/bin/bash
|
||||||
|
# https://packages.debian.org/bullseye/libpython2.7-stdlib
|
||||||
|
ARCH=$(dpkg --print-architecture)
|
||||||
|
|
||||||
|
apt -y install virtualenv
|
||||||
|
apt -y install mime-support #transitional package
|
||||||
|
#apt -y install libffi8
|
||||||
|
|
||||||
|
cd /tmp
|
||||||
|
case $ARCH in
|
||||||
|
"arm64")
|
||||||
|
wget http://ftp.debian.org/debian/pool/main/o/openssl/libssl1.1_1.1.1n-0+deb11u4_arm64.deb
|
||||||
|
apt install ./libssl1.1_1.1.1n-0+deb11u4_arm64.deb
|
||||||
|
|
||||||
|
wget http://ftp.debian.org/debian/pool/main/libf/libffi/libffi7_3.3-6_arm64.deb
|
||||||
|
apt install ./libffi7_3.3-6_arm64.deb
|
||||||
|
|
||||||
|
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/libpython2.7-stdlib_2.7.18-8_arm64.deb
|
||||||
|
apt install ./libpython2.7-stdlib_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
|
||||||
|
|
||||||
|
wget http://ftp.debian.org/debian/pool/main/p/python2.7/python2.7_2.7.18-8_arm64.deb
|
||||||
|
apt install ./python2.7_2.7.18-8_arm64.deb
|
||||||
|
;;
|
||||||
|
|
||||||
|
"amd64")
|
||||||
|
wget http://security.ubuntu.com/ubuntu/pool/main/o/openssl/libssl1.1_1.1.1f-1ubuntu2.17_amd64.deb
|
||||||
|
apt install ./libssl1.1_1.1.1f-1ubuntu2.17_amd64.deb
|
||||||
|
|
||||||
|
wget http://mirrors.edge.kernel.org/ubuntu/pool/universe/libf/libffi7/libffi7_3.3-5ubuntu1_amd64.deb
|
||||||
|
apt install ./libffi7_3.3-5ubuntu1_amd64.deb
|
||||||
|
|
||||||
|
wget http://mirrors.edge.kernel.org/ubuntu/pool/universe/p/python2.7/libpython2.7-minimal_2.7.18-13ubuntu2_amd64.deb
|
||||||
|
apt install ./libpython2.7-minimal_2.7.18-13ubuntu2_amd64.deb
|
||||||
|
|
||||||
|
wget http://mirrors.edge.kernel.org/ubuntu/pool/universe/p/python2.7/libpython2.7-stdlib_2.7.18-13ubuntu2_amd64.deb
|
||||||
|
apt install ./libpython2.7-stdlib_2.7.18-13ubuntu2_amd64.deb
|
||||||
|
|
||||||
|
wget http://mirrors.edge.kernel.org/ubuntu/pool/universe/p/python2.7/python2.7-minimal_2.7.18-13ubuntu2_amd64.deb
|
||||||
|
apt install ./python2.7-minimal_2.7.18-13ubuntu2_amd64.deb
|
||||||
|
|
||||||
|
wget http://mirrors.kernel.org/ubuntu/pool/universe/p/python2.7/python2.7_2.7.18-13ubuntu2_amd64.deb
|
||||||
|
apt install ./python2.7_2.7.18-13ubuntu2_amd64.deb
|
||||||
|
;;
|
||||||
|
|
||||||
|
"armhf")
|
||||||
|
wget http://archive.raspberrypi.org/debian/pool/main/o/openssl/libssl1.1_1.1.1n-0+deb11u4+rpt1_armhf.deb
|
||||||
|
apt install ./libssl1.1_1.1.1n-0+deb11u4+rpt1_armhf.deb
|
||||||
|
|
||||||
|
wget http://raspbian.raspberrypi.org/raspbian/pool/main/libf/libffi/libffi7_3.3-6_armhf.deb
|
||||||
|
apt install ./libffi7_3.3-6_armhf.deb
|
||||||
|
|
||||||
|
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/libpython2.7-stdlib_2.7.18-13.2_armhf.deb
|
||||||
|
apt install ./libpython2.7-stdlib_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 ./python2.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 ./python2.7_2.7.18-13.2_armhf.deb
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
rm *.deb
|
|
@ -84,6 +84,7 @@ case $OS_VER in
|
||||||
"ubuntu-2204" | \
|
"ubuntu-2204" | \
|
||||||
"ubuntu-2210" | \
|
"ubuntu-2210" | \
|
||||||
"ubuntu-2304" | \
|
"ubuntu-2304" | \
|
||||||
|
"ubuntu-2310" | \
|
||||||
"linuxmint-21" | \
|
"linuxmint-21" | \
|
||||||
"raspbian-11" | \
|
"raspbian-11" | \
|
||||||
"raspbian-12")
|
"raspbian-12")
|
||||||
|
|
|
@ -773,6 +773,7 @@ pbx_http_port: 83
|
||||||
is_debuntu: False # Covers all 4: Ubuntu, Linux Mint, Debian, Raspberry Pi OS (Raspbian)
|
is_debuntu: False # Covers all 4: Ubuntu, Linux Mint, Debian, Raspberry Pi OS (Raspbian)
|
||||||
|
|
||||||
is_ubuntu: False # Covers: Ubuntu, Linux Mint
|
is_ubuntu: False # Covers: Ubuntu, Linux Mint
|
||||||
|
is_ubuntu_2310: False
|
||||||
is_ubuntu_2304: False
|
is_ubuntu_2304: False
|
||||||
is_ubuntu_2210: False
|
is_ubuntu_2210: False
|
||||||
is_ubuntu_2204: False
|
is_ubuntu_2204: False
|
||||||
|
|
21
vars/ubuntu-2310.yml
Normal file
21
vars/ubuntu-2310.yml
Normal file
|
@ -0,0 +1,21 @@
|
||||||
|
# Every is_<OS_VER> var is initially set to 'False' at the bottom of
|
||||||
|
# /opt/iiab/iiab/vars/default_vars.yml -- these 'True' lines override that:
|
||||||
|
is_debuntu: True
|
||||||
|
is_ubuntu: True # Opposite of is_debian for now
|
||||||
|
is_ubuntu_2310: True
|
||||||
|
|
||||||
|
# proxy: squid
|
||||||
|
# proxy_user: proxy
|
||||||
|
# apache_service: apache2
|
||||||
|
# apache_user: www-data
|
||||||
|
# smb_service: smbd
|
||||||
|
# nmb_service: nmbd
|
||||||
|
# systemctl_program: /bin/systemctl
|
||||||
|
# mysql_service: mariadb
|
||||||
|
# sshd_package: openssh-server
|
||||||
|
# sshd_service: ssh
|
||||||
|
# systemd_location: /lib/systemd/system
|
||||||
|
# php_version: "8.1"
|
||||||
|
# postgresql_version: 14
|
||||||
|
# python_version: "3.10"
|
||||||
|
|
Loading…
Add table
Reference in a new issue