systemctl

Hi,

I created playbook for “sudo systemctl start qdrouterd.service” but its not working in Ansible tower and throwing error “ERROR! ‘service’ is not a valid attribute for a Play”. I mentioned below play for systemctl. I also declared state=restarted. Please assist me.

  • name: Start service qdrouterd.service
    service:
    name: qdrouterd.service
    state: started
    use: service
    tags:
    start

Regards,
Pradeep

Maybe use the systemd instead?

  • name: Start service qdrouterd.service
    systemd:
    state: started
    name: qdrouterd.service
    tags:
    start

that is a task, it cannot run on it’s own, it must be inside a play.

thanks for your reply.

Sorry its not working and throwing same error.

I checked with service and systemd but its working.

Regards,
Pradeep

Hi Pradeep,