aboutsummaryrefslogblamecommitdiffstats
path: root/roles/fedora/tasks/timesyncd.yml
blob: 180d8c201589ea033d0f5d414915bc36ba4b5385 (plain) (tree)





















                                                             
                   

                        
---
- name: Configure systemd-timesyncd
  ini_file:
    path: '/etc/systemd/timesyncd.conf'
    no_extra_spaces: yes
    section: "{{ item.key.split('.',1)[0] }}"
    option:  "{{ item.key.split('.',1)[1] }}"
    value:   "{{ item.value|ternary(item.value,omit) }}"
    state:   "{{ item.value|ternary('present','absent') }}"
  with_dict: '{{ timesyncd_conf }}'
  when: use_timesyncd
  notify: restart timesyncd

- name: Enable systemd-timesyncd
  systemd:
    name: systemd-timesyncd.service
    enabled: "{{ use_timesyncd|ternary('yes','no') }}"
    masked: no
    state: "{{ use_timesyncd|ternary('started','stopped') }}"
  when: not chroot
- name: '- when in chroot'
  command: systemctl enable systemd-timesyncd.service
  when: chroot|bool

# vim: set ts=2 sw=2 et: