#+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=]]
when: inventory_hostname != ansible_hostname
tags: actualizer
+- name: Install timesyncd.
+ become: yes
+ apt: pkg=systemd-timesyncd
+
- name: Configure timesyncd.
become: yes
lineinfile:
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: