Skip to content

Commit d715a56

Browse files
Support Ubuntu 24
1 parent 08142af commit d715a56

File tree

12 files changed

+52
-44
lines changed

12 files changed

+52
-44
lines changed

.github/workflows/ansible-integration.yaml

+3-3
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ jobs:
77
- uses: actions/checkout@v2
88
- name: Start docker-compose
99
run: |
10-
docker-compose up -d
10+
docker compose up -d
1111
sleep 720
12-
docker-compose logs
12+
docker compose logs
1313
docker ps -a
14-
docker exec zdm-proxy-automation_client_1 cqlsh zdm-proxy-automation_proxy_1 -e 'select * from system.local;'
14+
docker exec zdm-proxy-automation-client-1 cqlsh zdm-proxy-automation-proxy-1 -e 'select * from system.local;'

ansible-control-host-docker/Dockerfile

+6-10
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# syntax=docker/dockerfile:1
2-
FROM ubuntu:22.04
2+
FROM ubuntu:24.04
33
ENV DEBIAN_FRONTEND noninteractive
44

55
# install all necessary software packages and dependencies
@@ -13,18 +13,15 @@ RUN apt-get update && apt-get install -y software-properties-common \
1313
gnupg
1414

1515
RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 93C4A3FD7BB9C367 && \
16-
apt-add-repository "deb http://ppa.launchpad.net/ansible/ansible/ubuntu jammy main" && \
16+
apt-add-repository "deb http://ppa.launchpad.net/ansible/ansible/ubuntu noble main" && \
1717
apt-get update && apt-get upgrade --yes && \
1818
apt-get install --yes python3-pip && \
19-
apt-get install python3-jmespath && \
19+
apt-get install --yes python3-jmespath && \
20+
apt-get install --yes ansible && \
21+
apt-get install --yes python3-cryptography && \
2022
apt-get autoremove && apt-get autoclean
2123

22-
RUN sudo python3 -m pip install ansible
23-
RUN sudo python3 -m pip install cryptography
24-
25-
# create ubuntu user
26-
RUN useradd -ms /bin/bash ubuntu
27-
RUN usermod -aG sudo ubuntu
24+
# switch to ubuntu user
2825
USER ubuntu
2926
WORKDIR /home/ubuntu/
3027

@@ -52,4 +49,3 @@ RUN mkdir target_tls_files
5249
RUN mkdir zdm_proxy_tls_files
5350

5451
ENTRYPOINT ["/bin/bash"]
55-

ansible/tasks/install_docker_ansible_module.yml

+12-1
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,28 @@
44
- package_list: [ 'curl', 'software-properties-common', 'python3-pip', 'virtualenv', 'python3-setuptools' ]
55
when: install_packages | bool
66

7+
# On Ubuntu 22 and below, install docker-py package using pip.
8+
# On Ubuntu 24 and above, use apt-get.
9+
710
- name: Uninstall incompatible Docker-py Module
811
become: no
912
pip:
1013
name: docker-py
1114
state: absent
1215
vars:
1316
ansible_python_interpreter: python3
17+
when: ansible_distribution_major_version | int < 24
1418

15-
- name: Install Docker Module for Python
19+
- name: Install Docker Module for Python Pip
1620
pip:
1721
name: docker
1822
version: 2.7.0
1923
vars:
2024
ansible_python_interpreter: python3
25+
when: ansible_distribution_major_version | int < 24
26+
27+
- name: Install Docker Module for Python Apt
28+
apt:
29+
name: python3-docker
30+
state: present
31+
when: ansible_distribution_major_version | int >= 24

compose/client-entrypoint.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@ echo "Installing cqlsh"
2626
pip install -U cqlsh
2727

2828
echo "Testing cqlsh"
29-
test_conn zdm-proxy-automation_proxy_1
29+
test_conn zdm-proxy-automation-proxy-1
3030

3131
echo "Running SELECT statement"
32-
select_all zdm-proxy-automation_proxy_1
32+
select_all zdm-proxy-automation-proxy-1
3333

3434
echo "Ready"
3535
tail -F /dev/null # keeps container running

compose/jumphost-entrypoint.sh

+16-16
Original file line numberDiff line numberDiff line change
@@ -54,14 +54,14 @@ if ! id "ubuntu" &>/dev/null; then
5454
echo "Adding proxy servers to SSH known_hosts"
5555
gosu ubuntu touch /home/ubuntu/.ssh/known_hosts
5656

57-
scan_key zdm-proxy-automation_jumphost_1
58-
scan_key zdm-proxy-automation_proxy_1
59-
scan_key zdm-proxy-automation_proxy_2
60-
scan_key zdm-proxy-automation_proxy_3
57+
scan_key zdm-proxy-automation-jumphost-1
58+
scan_key zdm-proxy-automation-proxy-1
59+
scan_key zdm-proxy-automation-proxy-2
60+
scan_key zdm-proxy-automation-proxy-3
6161

62-
test_conn zdm-proxy-automation_proxy_1
63-
test_conn zdm-proxy-automation_proxy_2
64-
test_conn zdm-proxy-automation_proxy_3
62+
test_conn zdm-proxy-automation-proxy-1
63+
test_conn zdm-proxy-automation-proxy-2
64+
test_conn zdm-proxy-automation-proxy-3
6565

6666
# remove shared keys once applied to remote servers
6767
rm /run/keys/*.pub
@@ -76,14 +76,14 @@ fi
7676
echo "Starting SSH server"
7777
/etc/init.d/ssh start
7878

79-
test_conn zdm-proxy-automation_proxy_1
80-
test_conn zdm-proxy-automation_proxy_2
81-
test_conn zdm-proxy-automation_proxy_3
79+
test_conn zdm-proxy-automation-proxy-1
80+
test_conn zdm-proxy-automation-proxy-2
81+
test_conn zdm-proxy-automation-proxy-3
8282

83-
export PROXY_IP_1=$(get_ip zdm-proxy-automation_proxy_1)
84-
export PROXY_IP_2=$(get_ip zdm-proxy-automation_proxy_2)
85-
export PROXY_IP_3=$(get_ip zdm-proxy-automation_proxy_3)
86-
export JUMPHOST_IP=$(get_ip zdm-proxy-automation_jumphost_1)
83+
export PROXY_IP_1=$(get_ip zdm-proxy-automation-proxy-1)
84+
export PROXY_IP_2=$(get_ip zdm-proxy-automation-proxy-2)
85+
export PROXY_IP_3=$(get_ip zdm-proxy-automation-proxy-3)
86+
export JUMPHOST_IP=$(get_ip zdm-proxy-automation-jumphost-1)
8787

8888
cd /opt/zdm-proxy-automation || return
8989

@@ -100,9 +100,9 @@ gosu ubuntu ansible-playbook deploy_zdm_proxy.yml -i zdm_ansible_inventory \
100100
-e "origin_password=foo" \
101101
-e "target_username=foo" \
102102
-e "target_password=foo" \
103-
-e "origin_contact_points=zdm-proxy-automation_origin_1" \
103+
-e "origin_contact_points=zdm-proxy-automation-origin-1" \
104104
-e "origin_port=9042" \
105-
-e "target_contact_points=zdm-proxy-automation_target_1" \
105+
-e "target_contact_points=zdm-proxy-automation-target-1" \
106106
-e "target_port=9042"
107107

108108
echo "Ready"

orchestration-scripts/run_terraform_zdm.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ zdm_vpc_cidr_prefix="172.18"
5454
#custom_name_suffix=
5555

5656
# OPTIONAL: zdm_linux_distro to be used for both proxy and monitoring instances.
57-
# Defaults to jammy (Ubuntu 22.04), valid options are focal, jammy, centos7, centos8, centos9, rocky8, rocky9, rhel7, rhel8.
57+
# Defaults to noble (Ubuntu 24.04), valid options are focal, jammy, noble, centos7, centos8, centos9, rocky8, rocky9, rhel7, rhel8.
5858
#zdm_linux_distro=
5959

6060
# OPTIONAL: AWS instance type to be used for each ZDM proxy. Defaults to c5.xlarge, almost always fine.

orchestration-scripts/run_terraform_zdm_no_peering.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ zdm_vpc_cidr_prefix="172.18"
4242
#custom_name_suffix=
4343

4444
# OPTIONAL: zdm_linux_distro to be used for both proxy and monitoring instances.
45-
# Defaults to jammy (Ubuntu 22.04), valid options are focal, jammy, centos7, centos8, centos9, rocky8, rocky9, rhel7, rhel8.
45+
# Defaults to noble (Ubuntu 24.04), valid options are focal, jammy, noble, centos7, centos8, centos9, rocky8, rocky9, rhel7, rhel8.
4646
#zdm_linux_distro=
4747

4848
# OPTIONAL: AWS instance type to be used for each ZDM proxy. Defaults to c5.xlarge, almost always fine.

orchestration-scripts/setup_ansible_control_host.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ printf "# proxy instances \nHost %s.*\n IdentityFile %s/%s\n" "${zdm_proxy_priv
5050
if ! command -v ansible &> /dev/null; then
5151
echo "Installing Ansible"
5252
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 93C4A3FD7BB9C367
53-
sudo apt-add-repository "deb http://ppa.launchpad.net/ansible/ansible/ubuntu jammy main"
53+
sudo apt-add-repository "deb http://ppa.launchpad.net/ansible/ansible/ubuntu noble main"
5454
sudo apt update --yes
5555
sudo apt upgrade --yes
5656
sudo apt install --yes software-properties-common

terraform/aws/no-peering-deployment-root-aws/variables.tf

+3-3
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,10 @@ variable "owner" {
4646
}
4747

4848
variable "zdm_linux_distro" {
49-
default = "jammy"
49+
default = "noble"
5050

5151
validation {
52-
condition = can(regex("focal|jammy|centos7|centos8|centos9|rocky8|rocky9|rhel7|rhel8", var.zdm_linux_distro))
53-
error_message = "Invalid Linux distro, allowed_values = [focal jammy centos7 centos8 centos9 rocky8 rocky9 rhel7 rhel8]."
52+
condition = can(regex("focal|jammy|noble|centos7|centos8|centos9|rocky8|rocky9|rhel7|rhel8", var.zdm_linux_distro))
53+
error_message = "Invalid Linux distro, allowed_values = [focal jammy noble centos7 centos8 centos9 rocky8 rocky9 rhel7 rhel8]."
5454
}
5555
}

terraform/aws/self-contained-deployment-root-aws/variables.tf

+3-3
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,10 @@ variable "owner" {
6363
}
6464

6565
variable "zdm_linux_distro" {
66-
default = "jammy"
66+
default = "noble"
6767

6868
validation {
69-
condition = can(regex("focal|jammy|centos7|centos8|centos9|rocky8|rocky9|rhel7|rhel8", var.zdm_linux_distro))
70-
error_message = "Invalid Linux distro, allowed_values = [focal jammy centos7 centos8 centos9 rocky8 rocky9 rhel7 rhel8]."
69+
condition = can(regex("focal|jammy|noble|centos7|centos8|centos9|rocky8|rocky9|rhel7|rhel8", var.zdm_linux_distro))
70+
error_message = "Invalid Linux distro, allowed_values = [focal jammy noble centos7 centos8 centos9 rocky8 rocky9 rhel7 rhel8]."
7171
}
7272
}

terraform/aws/submodules-aws/instances-aws/main.tf

+1
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ locals {
2929
allowed_linux_distros = {
3030
focal = { owner = "amazon", name_pattern = "ubuntu/images/*/ubuntu-*-20.04-*", linux_user = "ubuntu" }
3131
jammy = { owner = "amazon", name_pattern = "ubuntu/images/*/ubuntu-*-22.04-*", linux_user = "ubuntu" }
32+
noble = { owner = "amazon", name_pattern = "ubuntu/images/*/ubuntu-*-24.04-*", linux_user = "ubuntu" }
3233
centos7 = { owner = "125523088429", name_pattern = "CentOS Linux 7*", linux_user = "centos" }
3334
centos8 = { owner = "125523088429", name_pattern = "CentOS Stream 8*", linux_user = "centos" }
3435
centos9 = { owner = "125523088429", name_pattern = "CentOS Stream 9*", linux_user = "ec2-user" }

terraform/aws/submodules-aws/instances-aws/variables.tf

+3-3
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,10 @@ variable "custom_name_suffix" {}
3333
variable "owner" {}
3434

3535
variable "zdm_linux_distro" {
36-
default = "jammy"
36+
default = "noble"
3737

3838
validation {
39-
condition = can(regex("focal|jammy|centos7|centos8|centos9|rocky8|rocky9|rhel7|rhel8", var.zdm_linux_distro))
40-
error_message = "Invalid Linux distro, allowed_values = [focal jammy centos7 centos8 centos9 rocky8 rocky9 rhel7 rhel8]."
39+
condition = can(regex("focal|jammy|noble|centos7|centos8|centos9|rocky8|rocky9|rhel7|rhel8", var.zdm_linux_distro))
40+
error_message = "Invalid Linux distro, allowed_values = [focal jammy noble centos7 centos8 centos9 rocky8 rocky9 rhel7 rhel8]."
4141
}
4242
}

0 commit comments

Comments
 (0)