roles/common: explicitly install systemd-timesyncd
It is a standalone package on (at least) Ubuntu 20.04 and Debian 11 and some cloud images do not have it installed by default (for exa- mple Scaleway).
This commit is contained in:
parent
d08f10f9c8
commit
c03e75d736
@ -8,6 +8,14 @@
|
|||||||
command: /usr/bin/timedatectl set-timezone {{ timezone }}
|
command: /usr/bin/timedatectl set-timezone {{ timezone }}
|
||||||
tags: timezone
|
tags: timezone
|
||||||
|
|
||||||
|
# Apparently some cloud images don't have this installed by default. From what
|
||||||
|
# I can see on existing servers, systemd-timesyncd is a standalone package on
|
||||||
|
# Ubuntu 20.04 and Debian 11.
|
||||||
|
- name: Install systemd-timesyncd
|
||||||
|
when: (ansible_distribution == 'Ubuntu' and ansible_distribution_version is version('20.04', '==')) or
|
||||||
|
(ansible_distribution == 'Debian' and ansible_distribution_version is version('11', '=='))
|
||||||
|
apt: name=systemd-timesyncd state=present cache_valid_time=3600
|
||||||
|
|
||||||
- name: Start and enable systemd's NTP client
|
- name: Start and enable systemd's NTP client
|
||||||
when: ansible_service_mgr == 'systemd'
|
when: ansible_service_mgr == 'systemd'
|
||||||
systemd: name=systemd-timesyncd state=started enabled=yes
|
systemd: name=systemd-timesyncd state=started enabled=yes
|
||||||
|
Loading…
Reference in New Issue
Block a user