aboutsummaryrefslogtreecommitdiffstats
path: root/roles/fedora
diff options
context:
space:
mode:
authorEmil Renner Berthing <esmil@labitat.dk>2020-02-29 20:15:53 +0100
committerEmil Renner Berthing <esmil@labitat.dk>2020-02-29 20:16:10 +0100
commit515a7883f583e4981f74e9bae8bbe1833f931924 (patch)
treeb0619bf8726db80120f0ef5725c2e6bbd7d7396e /roles/fedora
parente2efdd3540a2d67d5ffd90411110902c7f336b1f (diff)
downloadlabitat-ansible-515a7883f583e4981f74e9bae8bbe1833f931924.tar.gz
labitat-ansible-515a7883f583e4981f74e9bae8bbe1833f931924.tar.xz
labitat-ansible-515a7883f583e4981f74e9bae8bbe1833f931924.zip
fedora: networkd: configure networkd.conf
Diffstat (limited to 'roles/fedora')
-rw-r--r--roles/fedora/defaults/main.yml3
-rw-r--r--roles/fedora/tasks/networkd.yml13
2 files changed, 16 insertions, 0 deletions
diff --git a/roles/fedora/defaults/main.yml b/roles/fedora/defaults/main.yml
index 3c25cf9..2575da2 100644
--- a/roles/fedora/defaults/main.yml
+++ b/roles/fedora/defaults/main.yml
@@ -18,6 +18,9 @@ logind_conf_role: {}
resolved_conf_default: {}
resolved_conf_role: {}
+networkd_conf_default: {}
+networkd_conf_role: {}
+
timesyncd_conf_default: {}
timesyncd_conf_role: {}
diff --git a/roles/fedora/tasks/networkd.yml b/roles/fedora/tasks/networkd.yml
index de38fa4..35a45d1 100644
--- a/roles/fedora/tasks/networkd.yml
+++ b/roles/fedora/tasks/networkd.yml
@@ -1,4 +1,17 @@
---
+- name: Configure networkd.conf
+ vars:
+ networkd_conf: '{{ networkd_conf_default|combine(networkd_conf_role) }}'
+ 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 is string)|ternary(item.value,omit) }}"
+ state: "{{ (item.value is string)|ternary('present','absent') }}"
+ with_dict: '{{ networkd_conf }}'
+ when: use_networkd and (ansible_distribution_version == 'rawhide' or ansible_distribution_version|int > 29
+
- name: Enable/disable systemd-networkd
systemd:
name: systemd-networkd.service