Skip to content

Commit

Permalink
Add Ubuntu 24.04 support
Browse files Browse the repository at this point in the history
receptor_install_method=package will install receptor and
python3-receptorctl via apt.

molecule-ubuntu using Containerfile_ubuntu.j2.
  • Loading branch information
rexberg committed Nov 24, 2024
1 parent d634bc2 commit 8ab86cb
Show file tree
Hide file tree
Showing 5 changed files with 64 additions and 0 deletions.
6 changes: 6 additions & 0 deletions molecule/default/Containerfile_ubuntu.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
FROM ubuntu:24.04

RUN apt-get update && apt-get install -y \
init \
python3 \
&& apt-get clean all
17 changes: 17 additions & 0 deletions molecule/default/molecule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,19 @@ platforms:
volumes:
- /sys/fs/cgroup:/sys/fs/cgroup:ro

- name: molecule-ubuntu
image: ubuntu:24.04
dockerfile: Containerfile_ubuntu.j2
pre_build_image: false
systemd: true
privileged: true
command: "/usr/lib/systemd/systemd"
tmpfs:
"/run": "rw,mode=1777"
"/tmp": "rw,mode=1777"
volumes:
- /sys/fs/cgroup:/sys/fs/cgroup:ro

provisioner:
name: ansible
inventory:
Expand All @@ -42,3 +55,7 @@ provisioner:
ansible_connection: containers.podman.podman
podman_user: receptor
podman_group: receptor
molecule-ubuntu:
ansible_connection: containers.podman.podman
podman_user: receptor
podman_group: receptor
35 changes: 35 additions & 0 deletions roles/setup/tasks/setup-Debian.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,39 @@
---
- name: Install receptor packages
ansible.builtin.package:
name: "{{ receptor_packages }}"
state: present
when:
- receptor_install_method == 'package'
- receptor_packages
notify:
- Restart Receptor

# Installing receptor via a package manager already lays down
# a systemd service file. Instead of replacing it with a new
# systemd_receptor.service file, we can just use an overrides
# file to tweak it.
- name: Setup systemd overrides
when: receptor_install_method == 'package'
block:
- name: Ensure systemd override directory exists
ansible.builtin.file:
dest: "{{ systemd_folder }}/receptor.service.d"
state: directory
owner: root
group: root
mode: '0755'

- name: Override receptor's systemd service runuser
ansible.builtin.template:
src: templates/systemd_receptor_override.conf.j2
dest: "{{ systemd_folder }}/receptor.service.d/override.conf"
mode: '0644'
owner: root
group: root
notify:
- Restart Receptor

- name: Install dependencies specific to the node type
ansible.builtin.apt:
name: "{{ additional_system_packages | default([]) }}"
Expand Down
1 change: 1 addition & 0 deletions roles/setup/tasks/variables.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
file: "{{ item }}"
with_first_found:
- files:
- '{{ ansible_distribution }}-{{ ansible_distribution_version }}.yml'
- '{{ ansible_os_family }}-{{ ansible_distribution_major_version }}.yml'
- '{{ ansible_os_family }}.yml'
paths:
Expand Down
5 changes: 5 additions & 0 deletions roles/setup/vars/Ubuntu-24.04.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
receptor_packages:
- receptor
- python3-receptorctl
systemd_folder: "/usr/lib/systemd/system"

0 comments on commit 8ab86cb

Please sign in to comment.