Skip to content
This repository has been archived by the owner on Jul 22, 2024. It is now read-only.

Add support for Debian Bookworm #9

Merged
merged 2 commits into from
Jun 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ jobs:
matrix:
scenario:
- debian-11
- debian-12
- ubuntu-2204

steps:
Expand Down
2 changes: 2 additions & 0 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ Supported Platforms
-------------------

- [Debian - 11 (Bullseye)](https://wiki.debian.org/DebianBullseye)
- [Debian - 12 (Bookworm)](https://wiki.debian.org/DebianBookworm)
- [Ubuntu - 22.04 (Jammy Jellyfish)](http://releases.ubuntu.com/22.04/)

Role Variables
Expand Down Expand Up @@ -52,6 +53,7 @@ Testing
## Debian

molecule --base-config molecule/shared/base.yml test --scenario-name debian-11
molecule --base-config molecule/shared/base.yml test --scenario-name debian-12

## Ubuntu

Expand Down
1 change: 1 addition & 0 deletions meta/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ galaxy_info:
- jammy
- name: Debian
versions:
- bookworm
- bullseye
galaxy_tags:
- agent
Expand Down
19 changes: 19 additions & 0 deletions molecule/debian-12/Dockerfile.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Molecule managed

{% if item.registry is defined %}
FROM {{ item.registry.url }}/{{ item.image }}
{% else %}
FROM {{ item.image }}
{% endif %}

{% if item.env is defined %}
{% for var, value in item.env.items() %}
{% if value %}
ENV {{ var }} {{ value }}
{% endif %}
{% endfor %}
{% endif %}

ENV DEBIAN_FRONTEND=noninteractive

RUN apt-get update && apt-get install -y python3 sudo bash ca-certificates iproute2 python3-apt aptitude systemd && apt-get clean && rm -rf /var/lib/apt/lists/*
13 changes: 13 additions & 0 deletions molecule/debian-12/molecule.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
platforms:
- name: ansible-role-sensu_go_agent-debian-12
image: debian:12
command: /lib/systemd/systemd
tmpfs:
- /run
- /run/lock
volumes:
- /sys/fs/cgroup:/sys/fs/cgroup:rw
- /var/run/docker.sock:/var/run/docker.sock
cgroupns_mode: host
network_mode: host
11 changes: 10 additions & 1 deletion molecule/shared/prepare.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
{{ ansible_distribution_release }} {{ docker__channel | join (' ') }}
docker__channel: ["stable"]
docker__pip_dependencies:
- "python{{ '3' if ansible_python.version.major == 3 else '' }}-pip"
- "python3-pip"
docker__pip_packages:
- docker

Expand Down Expand Up @@ -43,6 +43,15 @@
name: "{{ item }}"
state: present
loop: "{{ docker__pip_packages }}"
when: ansible_distribution_release != 'bookworm'

- name: Install Python packages
ansible.builtin.pip:
name: "{{ item }}"
state: present
extra_args: --break-system-packages
loop: "{{ docker__pip_packages }}"
when: ansible_distribution_release == 'bookworm'

- name: Setup Sensu-go backend
ansible.builtin.include_role:
Expand Down
Loading