systemd_networkd(role): introd. role for deploy. systemd-networkd config

This commit is contained in:
June 2025-09-20 20:05:02 +02:00
commit ed8670f7da
Signed by: june
SSH key fingerprint: SHA256:o9EAq4Y9N9K0pBQeBTqhSDrND5E7oB+60ZNx0U1yPe0
5 changed files with 38 additions and 0 deletions

View file

@ -88,6 +88,8 @@ base_config_hosts:
tickets:
wiki:
zammad:
systemd_networkd_hosts:
hosts:
docker_compose_hosts:
hosts:
ccchoir:

View file

@ -4,6 +4,11 @@
roles:
- base_config
- name: Ensure systemd-networkd config deployment on systemd_networkd_hosts
hosts: systemd_networkd_hosts
roles:
- systemd_networkd
- name: Ensure deployment of infrastructure authorized keys
hosts: infrastructure_authorized_keys_hosts
roles:

View file

@ -0,0 +1,11 @@
# Role `systemd_networkd`
Deploys the given systemd-networkd configuration files.
## Support Distributions
Should work on Debian-based distributions.
## Required Arguments
- `systemd_networkd__config_dir`: Directory with systemd-networkd configs to deploy.

View file

@ -0,0 +1,6 @@
argument_specs:
main:
options:
systemd_networkd__config_dir:
type: path
required: true

View file

@ -0,0 +1,14 @@
- name: ensure rsync is installed
ansible.builtin.apt:
name: rsync
state: present
become: true
- name: synchronize systemd-networkd configs
ansible.posix.synchronize:
src: "{{ systemd_networkd__config_dir }}"
dest: "/etc/systemd/network"
archive: false
recursive: true
delete: true
become: true