Closed MrOffline77 closed 4 months ago
The directory should be set in a file in vars/
- we have a Debian file - https://github.com/linux-system-roles/timesync/blob/master/vars/Debian.yml - is it different than Ubuntu?
Ubuntu expects the chrony.conf as describe above in a different directory. The Path is hardcoded in the main.yml see template copy process I quoted above. Would be great if we could introduce an option to change the target path for the template within the debian vars file as you mentioned.
Rather than add a "one-off" setting specifically for Ubuntu to tasks/main.yml, I would like to refactor the code to handle this case better:
vars/Platform_Ver.yml
into vars/Platform.yml
timesync_chrony_config_path
- in vars/RedHat.yml this will be /etc/chrony.conf
- vars/Debian.yml will use /etc/chrony/chrony.conf
(I believe os_family Debian includes Ubuntu - if not, then add a vars/Ubuntu.yml)timesync_chrony_config_path
for https://github.com/redhat-cop/automation-good-practices/tree/main/roles#platform-specific-variablesWe can then use this same approach for /etc/ntp.conf, /etc/ptp4l.conf, /etc/sysconfig/phc2sys, /etc/sysconfig/network, and any other platform differences.
One problem is that even though the code "supports" Debian, Ubuntu, etc., we have no CI testing on anything except RedHat os_family platforms, so we would have no way of knowing if the refactoring introduced any regressions.
I have made a PR addressing the location #187 as the role didn't crash on Debian, but the configuration wasn't effectuated after running the role :sweat_smile:
That should fix this issue as well, as Ubuntu should match with os_family
.
The timesync role places the chrony.conf into /etc for each OS. Ubuntu (DEBIAN) expects the config in the /etc/chrony/ directory. Should be handled inside /tasks/main.yml as os specific variable.