Skip to content

Commit d086be0

Browse files
committed
feat: add Ubuntu 24.04 support
1 parent be49000 commit d086be0

File tree

3 files changed

+20
-6
lines changed

3 files changed

+20
-6
lines changed

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,8 @@ Once you get the account, follow the *Before you begin* and *1. Prepare* step in
6262

6363
This module was tested with:
6464

65-
* Ubuntu 20.04, 22.04 (ubuntu remote user)
66-
* Ubuntu 20.04, 22.04 Minimal (ubuntu remote user)
65+
* Ubuntu 20.04, 22.04, 24.04 (ubuntu remote user)
66+
* Ubuntu 20.04, 22.04, 24.04 Minimal (ubuntu remote user)
6767
* Oracle Linux 8, 9 (opc remote user)
6868

6969
### Terraform OCI user creation (Optional)

files/k3s-install-agent.sh

+9-2
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,15 @@ check_os() {
2525

2626
install_oci_cli_ubuntu(){
2727
DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends -y python3 python3-pip nginx
28-
systemctl enable nginx
29-
pip install oci-cli
28+
if [[ "$major" -ge 24 ]]; then
29+
# Ubuntu 24.04 and newer - use venv
30+
DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends -y python3-venv
31+
python3 -m venv ~/oci-cli-venv && source ~/oci-cli-venv/bin/activate && pip install oci-cli
32+
else
33+
# Previous Ubuntu versions - use pip
34+
pip install oci-cli
35+
fi
36+
systemctl enable nginx
3037
}
3138

3239
install_oci_cli_oracle(){

files/k3s-install-server.sh

+9-2
Original file line numberDiff line numberDiff line change
@@ -579,8 +579,15 @@ if [[ "$operating_system" == "ubuntu" ]]; then
579579
apt-get update
580580
apt-get install -y software-properties-common jq
581581
DEBIAN_FRONTEND=noninteractive apt-get upgrade -y
582-
DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends -y python3 python3-pip
583-
pip install oci-cli
582+
DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends -y python3 python3-pip
583+
if [[ "$major" -ge 24 ]]; then
584+
# Ubuntu 24.04 and newer - use venv
585+
DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends -y python3-venv
586+
python3 -m venv ~/oci-cli-venv && source ~/oci-cli-venv/bin/activate && pip install oci-cli
587+
else
588+
# Previous Ubuntu versions - use pip
589+
pip install oci-cli
590+
fi
584591

585592
# Fix /var/log/journal dir size
586593
echo "SystemMaxUse=100M" >> /etc/systemd/journald.conf

0 commit comments

Comments
 (0)