aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEmil Renner Berthing <esmil@labitat.dk>2019-07-06 16:53:05 +0200
committerEmil Renner Berthing <esmil@labitat.dk>2019-07-06 16:53:05 +0200
commit9eeca839d5d355553796602a425f042ad62ade20 (patch)
tree0074035f8993b592ca3b40fd6a3c684c515e4d83
parentab414b16b09e4a707b8cd2cff6eaa7819dd287d1 (diff)
downloadlabitat-ansible-9eeca839d5d355553796602a425f042ad62ade20.tar.gz
labitat-ansible-9eeca839d5d355553796602a425f042ad62ade20.tar.xz
labitat-ansible-9eeca839d5d355553796602a425f042ad62ade20.zip
debian: networkd: configure networkd.conf
-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