aboutsummaryrefslogtreecommitdiffstats
path: root/roles/fedora/tasks
diff options
context:
space:
mode:
authorEmil Renner Berthing <esmil@labitat.dk>2021-01-14 17:15:12 +0100
committerEmil Renner Berthing <esmil@labitat.dk>2021-01-16 23:40:05 +0100
commite4c66ce7cfd4c430e63d19ded8bbc1a5a5f64963 (patch)
tree8257d5f76b776e38376023f1e197ffa0d0b0cfdf /roles/fedora/tasks
parent0cf24dbc693f186c473827e2c5ebea99fd39a596 (diff)
downloadlabitat-ansible-e4c66ce7cfd4c430e63d19ded8bbc1a5a5f64963.tar.gz
labitat-ansible-e4c66ce7cfd4c430e63d19ded8bbc1a5a5f64963.tar.xz
labitat-ansible-e4c66ce7cfd4c430e63d19ded8bbc1a5a5f64963.zip
fedora: homed: configure systemd-homed
Diffstat (limited to 'roles/fedora/tasks')
-rw-r--r--roles/fedora/tasks/homed.yml27
-rw-r--r--roles/fedora/tasks/main.yml2
2 files changed, 29 insertions, 0 deletions
diff --git a/roles/fedora/tasks/homed.yml b/roles/fedora/tasks/homed.yml
new file mode 100644
index 0000000..1cacce7
--- /dev/null
+++ b/roles/fedora/tasks/homed.yml
@@ -0,0 +1,27 @@
+---
+- name: Configure homed.conf
+ vars:
+ homed_conf: '{{ homed_conf_default|combine(homed_conf_role) }}'
+ ini_file:
+ path: '/etc/systemd/homed.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: '{{ homed_conf }}'
+ when: use_homed
+ notify: restart homed
+
+- name: Enable/disable systemd-homed
+ systemd:
+ name: systemd-homed.service
+ enabled: "{{ use_homed|ternary('yes','no') }}"
+ masked: no
+ state: "{{ use_homed|ternary('started','stopped') }}"
+ when: not chroot
+- name: '- when in chroot'
+ command: "systemctl {{ use_homed|ternary('enable','disable') }} systemd-homed.service"
+ when: chroot
+
+# vim: set ts=2 sw=2 et:
diff --git a/roles/fedora/tasks/main.yml b/roles/fedora/tasks/main.yml
index e3f69a3..e9fa40f 100644
--- a/roles/fedora/tasks/main.yml
+++ b/roles/fedora/tasks/main.yml
@@ -20,6 +20,8 @@
tags: networkd
- import_tasks: timesyncd.yml
tags: timesyncd
+- import_tasks: homed.yml
+ tags: homed
- import_tasks: sshd.yml
tags: sshd
- import_tasks: sudo.yml