aboutsummaryrefslogtreecommitdiffstats
path: root/roles
diff options
context:
space:
mode:
Diffstat (limited to 'roles')
-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