aboutsummaryrefslogblamecommitdiffstats
path: root/roles/fedora/tasks/homed.yml
blob: 1cacce77fb660f9e7bf6496396d8f66185a45c04 (plain) (tree)


























                                                                                        
---
- 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: