Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python2 fix [for KA Lite on Debian 12 or Ubuntu 23.04 / 23.10] #3527

Merged
merged 7 commits into from
Apr 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 5 additions & 1 deletion roles/kalite/tasks/install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 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.

- 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
pip:
name: setuptools==44
Expand Down
71 changes: 71 additions & 0 deletions scripts/install_python2.sh
Original file line number Diff line number Diff line change
@@ -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
1 change: 1 addition & 0 deletions scripts/local_facts.fact
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ case $OS_VER in
"ubuntu-2204" | \
"ubuntu-2210" | \
"ubuntu-2304" | \
"ubuntu-2310" | \
"linuxmint-21" | \
"raspbian-11" | \
"raspbian-12")
Expand Down
1 change: 1 addition & 0 deletions vars/default_vars.yml
Original file line number Diff line number Diff line change
Expand Up @@ -773,6 +773,7 @@ pbx_http_port: 83
is_debuntu: False # Covers all 4: Ubuntu, Linux Mint, Debian, Raspberry Pi OS (Raspbian)

is_ubuntu: False # Covers: Ubuntu, Linux Mint
is_ubuntu_2310: False
is_ubuntu_2304: False
is_ubuntu_2210: False
is_ubuntu_2204: False
Expand Down
21 changes: 21 additions & 0 deletions vars/ubuntu-2310.yml
Original file line number Diff line number Diff line change
@@ -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"