very simple ad-hoc command returning an error

Hello,

I’m trying to run this ad-hoc command to install ntp package in a specific server:

ansible db -b -m yum -a “name=ntp state=present”

But I’m getting this error:

FAILED! => {
“ansible_facts”: {
“discovered_interpreter_python”: “/usr/bin/python”
},
“changed”: false,
“failures”: [
“ntp No match for argument: ntp”
],
“msg”: “Failed to install some of the specified packages”,
“rc”: 1,
“results”:
}

I have checked the sintax at ansible docs and it seems to be ok.

Some idea?

Thanks!

The ansible part is ok, but your target host does not know about an ‘ntp’ package.
IIRC centos/rhel now use ‘chrony’ for time keeping.

Thank you very much! I did not know about that package.