Could not find the requested service ntpd: host

573 views
Skip to first unread message

arjungoel 1995

unread,
Feb 4, 2022, 6:29:16 AM2/4/22
to Ansible Project
I am getting the above error while running this ansible playbook:

`
---
- hosts: all
  become: yes
  tasks:
    - name: Ensure NTP is installed.
      yum: name=ntp state=present
    - name: Ensure NTP is running.
      service:
        name: ntpd
        state: started
        enabled: yes

`

Can someone please rectify the issue which is causing this error?

Thanks

Parth Patel

unread,
Feb 4, 2022, 6:55:00 AM2/4/22
to ansible...@googlegroups.com
Make sure to provide output not just error.

Give a try changing name: ntp under service module.



--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/9df24adc-c6ac-484b-9060-4d5b9327871an%40googlegroups.com.

arjungoel 1995

unread,
Feb 4, 2022, 10:11:22 AM2/4/22
to ansible...@googlegroups.com, parthpat...@gmail.com
Hi, I tried with the ntp under service module a couple of hours ago but that didn't work. But now I tried to run the same code and it worked for me. Similarly I ran a sample ansible playbook for Apache Service and first it gave me that error and then it ran successfully. Was it a temporary issue?

Thanks
Arjun Goel

Rilindo Foster

unread,
Feb 4, 2022, 11:10:17 AM2/4/22
to ansible...@googlegroups.com, parthpat...@gmail.com
Arjun,

We don’t know without the error. Please paste in the error that you saw earlier.

- Rilindo

Reply all
Reply to author
Forward
0 new messages