Skip to content
5 changes: 5 additions & 0 deletions src/software/embedded/ansible/playbooks/setup_pi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@
ansible.builtin.import_tasks:
file: ../tasks/check_internet.yml

- name: Time sync by enabling ntp
Comment thread
annieisawesome2 marked this conversation as resolved.
Outdated
tags: configure_pi
Comment thread
suchirss marked this conversation as resolved.
Outdated
ansible.builtin.import_tasks:
file: ../tasks/enable_ntp.yml

- name: Enable passwordless sudo for rsync
tags:
- dependencies
Expand Down
12 changes: 12 additions & 0 deletions src/software/embedded/ansible/tasks/enable_ntp.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
- name: Make sure NTP is enabled to sync time for set_up.yml
Comment thread
suchirss marked this conversation as resolved.
Outdated
block:
- name: Enable automatic time synchronization
ansible.builtin.command: sudo timedatectl set-ntp on
changed_when: true
Comment thread
suchirss marked this conversation as resolved.

- name: Ensure the systemd-timesyncd service is running and enabled
Comment thread
suchirss marked this conversation as resolved.
ansible.builtin.systemd_service:
name: systemd-timesyncd
state: started
enabled: true
Loading