Hi, I was just testing a basic playbook in Ansible. Here is the playbook code:
ntpd?
Mike
Maybe chrony rather than ntp? What OS is your target host running?
Given that the OP is using YUM resource, very likely a RHEL-like distribution, which certainly meant RHEL 8, since the NTP daemon appears to be no longer supported in that version.
In that case (RHEL8), definitely chrony
.
So, concluding, nothing in this thread is ansible related, but OS
specific package convention related instead
I have tried Chrony as well but same issue persists.
Try it locally by command: yum install ntpd or chrony or dnf install chrony ansible just help you to install it remotely. The error come from your local host.
If you need to manage time synchronization on an EL system (RHEL6-RHEL9, CentOS, Fedora) then I strongly encourage you to use the timesync system role https://github.com/linux-system-roles/timesync/, available in the fedora.linux_system_roles collection https://galaxy.ansible.com/fedora/linux_system_roles, and maintained by Miroslav Lichvar, the maintainer of chrony - this will take care of installing the right packages, managing the right services, etc.
If OP is using actual Red Hat, they can directly install it via dnf/yum
[
Red Hat Enterprise Linux (RHEL) System Roles - Red Hat Customer Portal |