diff options
author | Emil Renner Berthing <esmil@labitat.dk> | 2021-01-14 17:15:12 +0100 |
---|---|---|
committer | Emil Renner Berthing <esmil@labitat.dk> | 2021-01-16 23:40:05 +0100 |
commit | e4c66ce7cfd4c430e63d19ded8bbc1a5a5f64963 (patch) | |
tree | 8257d5f76b776e38376023f1e197ffa0d0b0cfdf | |
parent | 0cf24dbc693f186c473827e2c5ebea99fd39a596 (diff) | |
download | labitat-ansible-e4c66ce7cfd4c430e63d19ded8bbc1a5a5f64963.tar.gz labitat-ansible-e4c66ce7cfd4c430e63d19ded8bbc1a5a5f64963.tar.xz labitat-ansible-e4c66ce7cfd4c430e63d19ded8bbc1a5a5f64963.zip |
fedora: homed: configure systemd-homed
-rw-r--r-- | roles/fedora/defaults/main.yml | 4 | ||||
-rw-r--r-- | roles/fedora/handlers/main.yml | 6 | ||||
-rw-r--r-- | roles/fedora/tasks/homed.yml | 27 | ||||
-rw-r--r-- | roles/fedora/tasks/main.yml | 2 |
4 files changed, 39 insertions, 0 deletions
diff --git a/roles/fedora/defaults/main.yml b/roles/fedora/defaults/main.yml index 858ef41..f7b3958 100644 --- a/roles/fedora/defaults/main.yml +++ b/roles/fedora/defaults/main.yml @@ -2,6 +2,7 @@ use_resolved: true use_networkd: true use_timesyncd: true +use_homed: false locale_default: LANG: 'en_US.UTF-8' @@ -30,6 +31,9 @@ networkd_conf_role: {} timesyncd_conf_default: {} timesyncd_conf_role: {} +homed_conf_default: {} +homed_conf_role: {} + dnf_conf_default: {} dnf_conf_role: {} diff --git a/roles/fedora/handlers/main.yml b/roles/fedora/handlers/main.yml index 895bad8..929bf15 100644 --- a/roles/fedora/handlers/main.yml +++ b/roles/fedora/handlers/main.yml @@ -11,4 +11,10 @@ state: restarted when: not chroot +- name: restart homed + systemd: + name: systemd-homed.service + state: restarted + when: not chroot + # vim: set ts=2 sw=2 et: 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 |