Skip to content

Commit

Permalink
Fix provision for CentOS, AmazonLinux and RHEL
Browse files Browse the repository at this point in the history
  • Loading branch information
fcaffieri committed Jan 6, 2025
1 parent d4713ac commit f33c69d
Showing 1 changed file with 17 additions and 3 deletions.
20 changes: 17 additions & 3 deletions .github/workflows/ansible-playbooks/provision.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
fi
fi
- name: Check if the system is Ubuntu 16 and install Python
- name: Check if the system is Ubuntu 16 and Ubuntu 18 and install Python
raw: |
if [ -f /etc/lsb-release ]; then
if grep -q -i -E "ubuntu.*16" /etc/lsb-release; then
Expand All @@ -58,6 +58,14 @@
cd /usr/lib/python3/dist-packages
sudo ln -s apt_inst.cpython-35m-x86_64-linux-gnu.so apt_inst.so
sudo ln -s apt_pkg.cpython-35m-x86_64-linux-gnu.so apt_pkg.so
elif grep -q -i -E "ubuntu.*18" /etc/lsb-release; then
add-apt-repository -y ppa:jblgf0/python
apt-get update
apt-get install -y python3.7 python3-apt
update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.7 1
cd /usr/lib/python3/dist-packages
sudo ln -s apt_inst.cpython-35m-x86_64-linux-gnu.so apt_inst.so
sudo ln -s apt_pkg.cpython-35m-x86_64-linux-gnu.so apt_pkg.so
fi
fi
Expand Down Expand Up @@ -103,6 +111,9 @@
- name: Set up Python 3.9 repository
apt_repository:
repo: 'ppa:deadsnakes/ppa'
when:
- ansible_distribution == "Ubuntu"
- ansible_distribution_release == "jammy"

- name: Install Python3.9 on Ubuntu Jammy
ansible.builtin.package:
Expand All @@ -112,6 +123,9 @@
- python3-apt
state: present
update_cache: yes
when:
- ansible_distribution == "Ubuntu"
- ansible_distribution_release == "jammy"

- name: Change Python link Ubuntu Jammy
command: ln -sf /usr/bin/python3.9 /usr/bin/python3
Expand Down Expand Up @@ -152,7 +166,7 @@
when:
- ansible_os_family == 'Debian'
- ansible_distribution == "Ubuntu"
- ansible_distribution_release in ['bionic']
- ansible_distribution_release in ['bionic','xenial']

when:
- install_python is defined
Expand All @@ -172,7 +186,7 @@
dest: "{{ tmp_path }}"
version: "{{ reference }}"
depth: 1
force: true
force: t e

- name: Generate Installation assistant
command: "bash {{ tmp_path }}/builder.sh -i"
Expand Down

0 comments on commit f33c69d

Please sign in to comment.