feat: add force time update to toolbox

This commit is contained in:
Simon Cornet 2025-11-10 15:16:45 +01:00
commit 8f0ab48d3b
3 changed files with 18 additions and 1 deletions

View file

@ -7,6 +7,13 @@
serial: 1
tasks:
# force update time
- name: "force update time using chrony"
tags:
- "chrony"
- "never"
ansible.builtin.include_tasks: "tasks/chrony.yaml"
# install updates
- name: "install updates"
tags:

View file

@ -6,11 +6,13 @@ This role contains simple ad-hoc tasks. Therefor this role is called a 'tooblox'
| Operating System | Version |
| --- | ----- |
| Alpine | 3.22 |
| Debian | 13 |
## Tags
| Tag | Function |
| --- | -------- |
| `update` | Install updates |
| `chrony` | Force update time |
| `reboot` | Reboots system |
| `update` | Install updates |

8
tasks/chrony.yaml Normal file
View file

@ -0,0 +1,8 @@
---
# force chrony time sync
- name: "chrony - force time sync"
ansible.builtin.shell:
cmd: "command -v chronyc >/dev/null 2>&1 && chronyc makestep"
changed_when: false
failed_when: false