diff options
author | Lars Wirzenius <liw@liw.fi> | 2023-04-30 16:23:51 +0300 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2023-04-30 16:23:51 +0300 |
commit | 9a9d97f70f97dc0dcd7a2c9c34cc652bad0e961c (patch) | |
tree | f221256ec3895cf3d63ddb684a7811389ada63c8 | |
parent | 82ed1c2a4e3423feb58927eb6d5c9915feb81817 (diff) | |
download | debian-ansible-9a9d97f70f97dc0dcd7a2c9c34cc652bad0e961c.tar.gz |
sane-debian-system: install ntp if systemd-timesyncd isn't available
Sponsored-by: author
-rw-r--r-- | roles/sane_debian_system/tasks/env.yml | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/roles/sane_debian_system/tasks/env.yml b/roles/sane_debian_system/tasks/env.yml index e44aa41..eedd864 100644 --- a/roles/sane_debian_system/tasks/env.yml +++ b/roles/sane_debian_system/tasks/env.yml @@ -23,7 +23,14 @@ state: present name: - locales - - systemd-timesyncd + +- name: install systemd-timesyncd or ntp + shell: | + if apt-cache show systemd-timesyncd > /dev/null; then + DEBIAN_FRONTEND=noninteractife apt-get install -y systemd-timesyncd + else + DEBIAN_FRONTEND=noninteractife apt-get install -y ntp + fi - name: generate locales locale_gen: |