Restart kestrelservice

Hello All,

can we have have a play book to restart kestrel service.

Isn’t command spelt wrong?

You are mixing things in there, systemd module does NOT have ‘command’ or ‘start’ options

So what should I use ??

See docs for correct syntax
https://docs.ansible.com/ansible/latest/modules/systemd_module.html

can i change it to service

Brian, I am very new to anisble but in the link you provided i can see some examples with systemd, it has state mentioned, but how can i use command to restart the service

- name: restart service cron on centos, in all cases, also issue daemon-reload to pick up config changes
  systemd:
    state: restarted
    daemon_reload: yes
    name: crond

The whole point of the systemd module (or any other module, really) is to abstract commands away, so don’t have to use them.

Try out the examples and enjoy!

Dick

Thank you all, I am able to run my first playbook successfully.

Thanks,
Narmada