---
- name: Set up NTP on all servers
hosts: all
become: true
tasks:
- name: Ensure NTP is installed
yum:
name: ntp
state: present
- name: Ensure NTP is running
service:
name: ntpd
state: started
enabled: yes
When I am running the ansible-playbook playbook.yaml command, I am getting this error:
TASK [Ensure NTP is installed] ****************************************************************************************************************
fatal: [3.226.126.95]: FAILED! => {"changed": false, "failures": ["No package ntp available."], "msg": "Failed to install some of the specified packages", "rc": 1, "results": []}
PLAY RECAP ************************************************************************************************************************************
3.226.126.95 : ok=1 changed=0 unreachable=0 failed=1 skipped=0 rescued=0 ignored=0
Please help me.