diff options
author | Emil Renner Berthing <esmil@labitat.dk> | 2019-07-06 16:53:05 +0200 |
---|---|---|
committer | Emil Renner Berthing <esmil@labitat.dk> | 2019-07-06 16:53:05 +0200 |
commit | 9eeca839d5d355553796602a425f042ad62ade20 (patch) | |
tree | 0074035f8993b592ca3b40fd6a3c684c515e4d83 /roles/debian | |
parent | ab414b16b09e4a707b8cd2cff6eaa7819dd287d1 (diff) | |
download | labitat-ansible-9eeca839d5d355553796602a425f042ad62ade20.tar.gz labitat-ansible-9eeca839d5d355553796602a425f042ad62ade20.tar.xz labitat-ansible-9eeca839d5d355553796602a425f042ad62ade20.zip |
debian: networkd: configure networkd.conf
Diffstat (limited to 'roles/debian')
-rw-r--r-- | roles/debian/defaults/main.yml | 1 | ||||
-rw-r--r-- | roles/debian/tasks/networkd.yml | 11 |
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 |