From bf50d3a7231eb3d615d6c20cdfd3f69b7058c5dc Mon Sep 17 00:00:00 2001 From: Matt Birkholz Date: Mon, 22 Dec 2025 08:50:32 -0700 Subject: [PATCH] Install, start and enable timesyncd on campus hosts. The package is not installed with Debian 13. --- README.org | 17 +++++++++++++++++ roles_t/campus/tasks/main.yml | 17 +++++++++++++++++ 2 files changed, 34 insertions(+) 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: -- 2.47.3