Debian12 runs ntpsec by default, Role does not work as expected
HaZet1968 opened this issue · 2 comments
Hi,
Debian 12 runs now ntpsec instead of ntp. The Configuration is more or less identical as with ntp, but some pathes are different.
For making it work I added a bit to the main.yml:
main.yml:
`
- name: Include OS-specific variables.
include_vars: "{{ ansible_os_family }}.yml"
- name: Overwrite OS-specific varaiables when Debian>=12
include_vars: "Debian12.yml"
when:
- ansible_os_family == "Debian"
- ansible_distribution == "Debian"
- ansible_distribution_major_version >= "12"
- name: Set the ntp_driftfile variable.
set_fact:
ntp_driftfile: "{{ __ntp_driftfile }}"
when: ntp_driftfile is not defined
...
`
and added Debian12.yml in the vars folder:
Debian12.yml:
`
__ntp_daemon: ntpsec
ntp_tzdata_package: tzdata
__ntp_package: ntpsec
__ntp_config_file: /etc/ntpsec/ntp.conf
__ntp_driftfile: /var/lib/ntpsec/ntp.drift
ntp_cron_daemon: cron
`
Unfortunatly I am not so closed to git to make a Pull request, and it's not really pretty. But it works. Maybe someone else who is more familiar with ansible and git can make it better.
Maybe someone else is interested in it