hafu.systemd_timesyncd

systemd-timesyncd

Konfiguruje demon systemd-timesyncd. Opcjonalnie usuwa inne demony NTP, takie jak chrony, ntp lub openntpd i/lub ustawia strefę czasową.

Wymagania

Systemd z timesyncd.

Zmienne roli

Domyślne zmienne są wymienione w defaults/main.yml, zmienne zależne od systemu operacyjnego są wymienione w vars/.

systemd_timesycd_remove_other_daemons: false
systemd_timesycd_other_daemons: []

Domyślnie żadne inne demony NTP nie będą usuwane. Aby usunąć potencjalnie kolidujące demonie, ustaw systemd_timesycd_remove_other_daemons na true. Lista pakietów do usunięcia jest ustawiana w playbooku poprzez dostarczony plik YAML w katalogu vars.

systemd_timesycd_set_timezone: false
systemd_timesycd_timezone: Etc/UTC

Ustawienie strefy czasowej również domyślnie jest dezaktywowane. Aby ustawić strefę czasową, ustaw systemd_timesycd_set_timezone na true i podaj strefę czasową w systemd_timesycd_timezone.

systemd_timesycd_conf_ntp_servers: []
systemd_timesycd_conf_fallback_ntp:
  - 0.pool.ntp.org
  - 1.pool.ntp.org
  - 2.pool.ntp.org
  - 3.pool.ntp.org

Zmienna systemd_timesycd_conf_ntp_servers powinna zawierać listę serwerów NTP. Ustawia to opcję NTP= w timesyncd.conf. Usługa systemd-networkd może połączyć tę listę z serwerami uzyskanymi przez systemd-networkd.

Serwery w systemd_timesycd_conf_fallback_ntp będą używane, gdy nie podano żadnych serwerów w systemd_timesycd_conf_ntp_servers, a systemd-networkd również nie może otrzymać żadnego serwera NTP. Jest to równoważne z FallbackNTP= w timesyncd.conf.

systemd_timesycd_conf_root_distance_max_sec: 5
systemd_timesycd_conf_poll_interval_min_sec: 32
systemd_timesycd_conf_poll_interval_max_sec: 2048

Te zmienne są opcjonalne i można je ustawić, jeśli jest to pożądane:

  • systemd_timesycd_conf_root_distance_max_sec -> RootDistanceMaxSec
  • systemd_timesycd_conf_poll_interval_min_sec -> PollIntervalMinSec
  • systemd_timesycd_conf_poll_interval_max_sec -> PollIntervalMaxSec

Zobacz timesyncd.conf.

Zależności

Brak

Przykładowy Playbook

Ten przykład usuwa inne zainstalowane demony NTP, ustawia strefę czasową na Europe/Berlin i korzysta z niemieckich serwerów NTP.

- hosts: servers
  roles:
     - role: hafu.systemd-timesyncd
       systemd_timesycd_remove_other_daemons: true
       systemd_timesycd_set_timezone: true
       systemd_timesycd_timezone: Europe/Berlin
       systemd_timesycd_conf_fallback_ntp:
         - 0.de.pool.ntp.org
         - 1.de.pool.ntp.org
         - 2.de.pool.ntp.org
         - 3.de.pool.ntp.org

Licencja

MIT

Informacje o autorze

https://github.com/hafu

O projekcie

Setup systemd-timesyncd. Optionally sets timezone and removes other NTP daemons.

Zainstaluj
ansible-galaxy install hafu.systemd_timesyncd
Licencja
Unknown
Pobrania
83
Właściciel