aboutsummaryrefslogtreecommitdiffstats
path: root/roles/debian
diff options
context:
space:
mode:
Diffstat (limited to 'roles/debian')
-rw-r--r--roles/debian/defaults/main.yml1
-rw-r--r--roles/debian/tasks/networkd.yml11
2 files changed, 12 insertions, 0 deletions
diff --git a/roles/debian/defaults/main.yml b/roles/debian/defaults/main.yml
index 057f612..5bb1192 100644
--- a/roles/debian/defaults/main.yml
+++ b/roles/debian/defaults/main.yml
@@ -14,6 +14,7 @@ systemd_conf: {}
journald_conf: {}
logind_conf: {}
resolved_conf: {}
+networkd_conf: {}
networkd_ignore: []
timesyncd_conf: {}
diff --git a/roles/debian/tasks/networkd.yml b/roles/debian/tasks/networkd.yml
index 3ad37df..50791b3 100644
--- a/roles/debian/tasks/networkd.yml
+++ b/roles/debian/tasks/networkd.yml
@@ -1,4 +1,15 @@
---
+- name: Configure systemd-networkd
+ ini_file:
+ path: '/etc/systemd/networkd.conf'
+ no_extra_spaces: yes
+ section: "{{ item.key.split('.',1)[0] }}"
+ option: "{{ item.key.split('.',1)[1] }}"
+ value: "{{ item.value|ternary(item.value,omit) }}"
+ state: "{{ item.value|ternary('present','absent') }}"
+ with_dict: '{{ networkd_conf }}'
+ when: use_networkd|bool
+
- name: Enable/disable systemd-networkd
systemd:
name: systemd-networkd.service