systemd_networkd(role),router(host): support global config to fix forw.
All checks were successful
/ Ansible Lint (push) Successful in 1m58s
All checks were successful
/ Ansible Lint (push) Successful in 1m58s
With the router upgrade to Debian 13 the systemd version got upgraded as well breaking the current configuration for IP forwarding. Add a variable for global systemd-networkd configuration and use that to enable IPv4 and IPv6 forwarding on the router. The systemd_networkd role could be a bit nicer, not deploying/deleting the global configuration, if the variable is empty and reloading/restarting systemd-networkd at appropriate times. But as is works for now.
This commit is contained in:
parent
d7b463ecb9
commit
d514688574
7 changed files with 28 additions and 4 deletions
|
|
@ -9,3 +9,8 @@ Should work on Debian-based distributions.
|
|||
## Required Arguments
|
||||
|
||||
- `systemd_networkd__config_dir`: Directory with systemd-networkd configs to deploy.
|
||||
|
||||
## Optional Arguments
|
||||
|
||||
- `systemd_networkd__global_config`: systemd-networkd global configuration to deploy (see `man 5 networkd.conf`).
|
||||
Defaults to `` (the empty string);
|
||||
|
|
|
|||
1
roles/systemd_networkd/defaults/main.yaml
Normal file
1
roles/systemd_networkd/defaults/main.yaml
Normal file
|
|
@ -0,0 +1 @@
|
|||
systemd_networkd__global_config: ""
|
||||
|
|
@ -12,3 +12,21 @@
|
|||
recursive: true
|
||||
delete: true
|
||||
become: true
|
||||
|
||||
- name: ensure global systemd-networkd config directory exists
|
||||
ansible.builtin.file:
|
||||
path: "/etc/systemd/networkd.conf.d"
|
||||
state: directory
|
||||
owner: root
|
||||
group: root
|
||||
mode: "0755"
|
||||
become: true
|
||||
|
||||
- name: ensure global systemd-networkd config is deployed
|
||||
ansible.builtin.copy:
|
||||
content: "{{ systemd_networkd__global_config }}"
|
||||
dest: "/etc/systemd/networkd.conf.d/20-ansible.conf"
|
||||
mode: "0644"
|
||||
owner: root
|
||||
group: root
|
||||
become: true
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue