From: Matt Birkholz Date: Mon, 22 Dec 2025 15:50:32 +0000 (-0700) Subject: Install, start and enable timesyncd on campus hosts. X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=bf50d3a7231eb3d615d6c20cdfd3f69b7058c5dc;p=Institute Install, start and enable timesyncd on campus hosts. The package is not installed with Debian 13. --- diff --git a/README.org b/README.org index c678c5a..1cbd6ff 100644 --- a/README.org +++ b/README.org @@ -5380,12 +5380,29 @@ and file timestamps. #+CAPTION: [[file:roles_t/campus/tasks/main.yml][=roles_t/campus/tasks/main.yml=]] #+BEGIN_SRC conf :tangle roles_t/campus/tasks/main.yml +- name: Install timesyncd. + become: yes + apt: pkg=systemd-timesyncd + - name: Configure timesyncd. become: yes lineinfile: path: /etc/systemd/timesyncd.conf line: NTP=ntp.{{ domain_priv }} notify: Restart systemd-timesyncd. + +- name: Start timesyncd. + become: yes + systemd: + service: systemd-timesyncd + state: started + tags: actualizer + +- name: Enable timesyncd. + become: yes + systemd: + service: systemd-timesyncd + enabled: yes #+END_SRC #+CAPTION: [[file:roles_t/campus/handlers/main.yml][=roles_t/campus/handlers/main.yml=]] diff --git a/roles_t/campus/tasks/main.yml b/roles_t/campus/tasks/main.yml index 88b2755..bc991b1 100644 --- a/roles_t/campus/tasks/main.yml +++ b/roles_t/campus/tasks/main.yml @@ -22,6 +22,10 @@ when: inventory_hostname != ansible_hostname tags: actualizer +- name: Install timesyncd. + become: yes + apt: pkg=systemd-timesyncd + - name: Configure timesyncd. become: yes lineinfile: @@ -29,6 +33,19 @@ line: NTP=ntp.{{ domain_priv }} notify: Restart systemd-timesyncd. +- name: Start timesyncd. + become: yes + systemd: + service: systemd-timesyncd + state: started + tags: actualizer + +- name: Enable timesyncd. + become: yes + systemd: + service: systemd-timesyncd + enabled: yes + - name: Add {{ ansible_user }} to system groups. become: yes user: