diff --git a/playbook.yaml b/playbook.yaml index b11fb20..c95886c 100644 --- a/playbook.yaml +++ b/playbook.yaml @@ -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: diff --git a/readme.md b/readme.md index 46e93fe..c0f04c1 100644 --- a/readme.md +++ b/readme.md @@ -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 | diff --git a/tasks/chrony.yaml b/tasks/chrony.yaml new file mode 100644 index 0000000..a3bcb77 --- /dev/null +++ b/tasks/chrony.yaml @@ -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