Skip to content

Commit

Permalink
Merge pull request #1470 from elfosardo/support-ubuntu-noble
Browse files Browse the repository at this point in the history
Add support for Ubuntu 24.04
  • Loading branch information
metal3-io-bot authored Nov 22, 2024
2 parents a8b1cf3 + 740b28e commit 758476e
Show file tree
Hide file tree
Showing 5 changed files with 57 additions and 4 deletions.
2 changes: 2 additions & 0 deletions 01_prepare_host.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ if [[ "${OS}" = "ubuntu" ]]; then
sudo update-alternatives --install /usr/bin/python python /usr/bin/python3.8 1
elif [[ "${DISTRO}" = "ubuntu22" ]]; then
sudo update-alternatives --install /usr/bin/python python /usr/bin/python3.10 1
elif [[ "${DISTRO}" = "ubuntu24" ]]; then
sudo update-alternatives --install /usr/bin/python python /usr/bin/python3.12 1
fi
elif [[ "${OS}" = "centos" ]] || [[ "${OS}" = "rhel" ]]; then
sudo dnf upgrade -y --nobest
Expand Down
6 changes: 4 additions & 2 deletions lib/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ source /etc/os-release
export DISTRO="${ID}${VERSION_ID%.*}"
export OS="${ID}"
export OS_VERSION_ID="${VERSION_ID}"
export SUPPORTED_DISTROS=(centos9 rhel9 ubuntu20 ubuntu22)
export SUPPORTED_DISTROS=(centos9 rhel9 ubuntu20 ubuntu22 ubuntu24)

if [[ ! "${SUPPORTED_DISTROS[*]}" =~ ${DISTRO} ]]; then
echo "Supported OS distros for the host are: CentOS Stream 9 or RHEL9 or Ubuntu20.04 or Ubuntu 22.04"
Expand Down Expand Up @@ -374,7 +374,9 @@ export TILT_SHA256="${TILT_SHA256:-b30ebbba68d4fd04f8afa11efc439515241dbcc2582ea
# Older ubuntu version do no support 7.0.0 because of older python versions
# Ansible 7.0.0 or newer requires python 3.10+
# TODO: Ansible pinning
if [[ "${DISTRO}" = "ubuntu22" ]]; then
if [[ "${DISTRO}" = "ubuntu24" ]]; then
export ANSIBLE_VERSION="${ANSIBLE_VERSION:-10.6.0}"
elif [[ "${DISTRO}" = "ubuntu22" ]]; then
export ANSIBLE_VERSION="${ANSIBLE_VERSION:-8.0.0}"
else
export ANSIBLE_VERSION="${ANSIBLE_VERSION:-6.7.0}"
Expand Down
11 changes: 10 additions & 1 deletion vm-setup/roles/packages_installation/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ packages:
- libpolkit-agent-1-0
- libpolkit-gobject-1-0
- apache2-utils
- netcat
podman:
packages:
- apt-transport-https
Expand All @@ -39,6 +38,16 @@ packages:
- libvirt-daemon
- libvirt-daemon-system
- libssl-dev
- netcat
noble:
packages:
- apparmor
- apparmor-profiles-extra
- apparmor-utils
- libvirt-daemon
- libvirt-daemon-system
- libssl-dev
- netcat-traditional
pip3:
- python-apt
- kubernetes==25.3.0
Expand Down
14 changes: 14 additions & 0 deletions vm-setup/roles/packages_installation/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@
name: "{{ packages.ubuntu.focal_jammy.packages}}"
state: present
become: yes
- name: Install packages using standard package manager for Ubuntu 24.04
when: ansible_distribution_version == "24.04"
package:
name: "{{ packages.ubuntu.noble.packages}}"
state: present
become: yes
- name: Install packages specific to Podman
package:
name: "{{ packages.ubuntu.podman.packages}}"
Expand All @@ -23,6 +29,14 @@
executable: "{{ ANSIBLE_VENV | default('/usr') }}/bin/pip"
name: "{{ packages.ubuntu.pip3 }}"
state: present
when: ansible_distribution_version != "24.04"
- name: Install packages using pip3 on Ubuntu Noble
pip:
break_system_packages: true
executable: "{{ ANSIBLE_VENV | default('/usr') }}/bin/pip"
name: "{{ packages.ubuntu.pip3 }}"
state: present
when: ansible_distribution_version == "24.04"
- name: Add TPM emulator
block:
- name: Add TPM emulator PPA
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,28 @@
apt_repository:
repo: "deb https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/xUbuntu_{{ OS_VERSION_ID }}/ /"
state: absent

- name: Remove Ubuntu Noble old repository (without gpg key file location)
apt_repository:
repo: "deb https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/unstable/xUbuntu_{{ OS_VERSION_ID }}/ /"
state: absent
when: ansible_distribution_release == "noble"

- name: Fetch OS release key
get_url:
url: "https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/xUbuntu_{{ OS_VERSION_ID }}/Release.key"
dest: /usr/share/keyrings/libcontainers-archive-keyring.asc
mode: '0644'
force: true
when: ansible_distribution_release != "noble"

- name: Fetch Ubuntu Noble release key
get_url:
url: "https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/unstable/xUbuntu_{{ OS_VERSION_ID }}/Release.key"
dest: /usr/share/keyrings/libcontainers-archive-keyring.asc
mode: '0644'
force: true
when: ansible_distribution_release == "noble"

- name: Dearmor Release key
shell: |
Expand All @@ -31,6 +46,17 @@
owner: root
group: root
mode: '0644'
when: ansible_distribution_release != "noble"

- name: Add Ubuntu Noble repository
lineinfile:
path: /etc/apt/sources.list.d/devel:kubic:libcontainers:unstable.list
line: "deb [signed-by=/usr/share/keyrings/libcontainers-archive-keyring.gpg] https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/unstable/xUbuntu_{{ OS_VERSION_ID }}/ /"
create: yes
owner: root
group: root
mode: '0644'
when: ansible_distribution_release == "noble"

- name: Update all packages to their latest version
apt:
Expand Down Expand Up @@ -124,4 +150,4 @@
append: yes
when: CONTAINER_RUNTIME == "docker"
become: yes
become: yes
become: yes

0 comments on commit 758476e

Please sign in to comment.