feat(fwknopd): add Ansible role for fwknopd management with necessary tasks and configurations

This commit is contained in:
2025-05-18 15:50:18 +02:00
parent 4e07e062ce
commit fef5c73726
13 changed files with 270 additions and 101 deletions
@@ -0,0 +1,8 @@
---
- name: Converge
hosts: all
gather_facts: false
tasks:
- name: Include role fwknopd
ansible.builtin.include_role:
name: fwknopd
@@ -0,0 +1,23 @@
---
dependency:
name: galaxy
driver:
name: podman
platforms:
- name: instance
image: nmusatti/ubuntu2204-pys-systemd:latest
pre_build_image: true
privileged: true
tmpfs:
- /run
- /tmp
volumes:
- /sys/fs/cgroup:/sys/fs/cgroup:rw
provisioner:
name: ansible
options:
vvv: true
env:
ANSIBLE_ROLES_PATH: ../../../
verifier:
name: ansible
@@ -0,0 +1,30 @@
---
- name: Prepare
hosts: all
gather_facts: false
tasks:
- name: Update cache # noqa no-changed-when
ansible.builtin.raw: apt update
- name: Install required packages # noqa no-changed-when
ansible.builtin.raw: apt install -y python3 sudo
- name: Install required packages # noqa no-changed-when
ansible.builtin.shell: |
set -o pipefail
apt install -y systemd
find /etc/systemd/system/*.wants /lib/systemd/system/multi-user.target.wants /lib/systemd/system/local-fs.target.wants /lib/systemd/system/sockets.target.wants -type f -name '*initctl*' -delete
find /lib/systemd/system/sysinit.target.wants -type f ! -name '*systemd-tmpfiles-setup*' -delete
find /lib/systemd -type f -name systemd-update-utmp-runlevel.service -delete
rm -vf /usr/share/systemd/tmp.mount
sed -ri '/^IPAddressDeny/d' /lib/systemd/system/systemd-journald.service
for MATCH in plymouth-start.service plymouth-quit-wait.service syslog.socket syslog.service display-manager.service systemd-sysusers.service tmp.mount systemd-udevd.service; do \
grep -rn --binary-files=without-match ${MATCH} /lib/systemd/ | cut -d: -f1 | xargs -r sed -ri 's/(.*=.*)'${MATCH}'(.*)/\1\2/'; \
done
systemctl disable ondemand.service
systemctl set-default multi-user.target
become: true
args:
executable: /bin/bash
environment:
DEBIAN_FRONTEND: noninteractive