# Restart kestrelservice

**URL:** <https://forum.ansible.com/t/restart-kestrelservice/28924>\
**Category:** Ansible Project\
**Created:** [November 2, 2018, 12:20am UTC](https://forum.ansible.com/t/restart-kestrelservice/28924 "2018-11-02T00:20:05Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Narmada\_Karthika](https://avatars.discourse-cdn.com/v4/letter/n/b5e925/32.png) [@Narmada\_Karthika](https://forum.ansible.com/u/Narmada_Karthika)\
**Post date:** [November 2, 2018, 12:20am UTC](https://forum.ansible.com/t/restart-kestrelservice/28924/1 "2018-11-02T00:20:05Z")

</div>

Hello All,

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

---

<div class="post-metadata">

**Author:** ![Narmada\_Karthika](https://avatars.discourse-cdn.com/v4/letter/n/b5e925/32.png) [@Narmada\_Karthika](https://forum.ansible.com/u/Narmada_Karthika)\
**Post date:** [November 2, 2018, 12:21am UTC](https://forum.ansible.com/t/restart-kestrelservice/28924/2 "2018-11-02T00:21:54Z")

</div>

![ansible.PNG](https://us1.discourse-cdn.com/ansible/original/2X/6/64c03b75fffe731ac7fa9c51dcb7878a03a2eaf5.png)

---

<div class="post-metadata">

**Author:** ![Lucas\_Jackson](https://avatars.discourse-cdn.com/v4/letter/l/59ef9b/32.png) [@Lucas\_Jackson](https://forum.ansible.com/u/Lucas_Jackson)\
**Post date:** [November 2, 2018, 12:27am UTC](https://forum.ansible.com/t/restart-kestrelservice/28924/3 "2018-11-02T00:27:34Z")

</div>

Isn’t command spelt wrong?

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/ansible/original/1X/1882d9a01da5d8996a862359b0913cc568a39b84.svg) [@system](https://forum.ansible.com/u/system)\
**Post date:** [November 2, 2018, 4:21pm UTC](https://forum.ansible.com/t/restart-kestrelservice/28924/4 "2018-11-02T16:21:15Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Narmada\_Karthika](https://avatars.discourse-cdn.com/v4/letter/n/b5e925/32.png) [@Narmada\_Karthika](https://forum.ansible.com/u/Narmada_Karthika)\
**Post date:** [November 2, 2018, 5:07pm UTC](https://forum.ansible.com/t/restart-kestrelservice/28924/5 "2018-11-02T17:07:31Z")

</div>

So what should I use ??

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/ansible/original/1X/1882d9a01da5d8996a862359b0913cc568a39b84.svg) [@system](https://forum.ansible.com/u/system)\
**Post date:** [November 2, 2018, 6:33pm UTC](https://forum.ansible.com/t/restart-kestrelservice/28924/6 "2018-11-02T18:33:39Z")

</div>

See docs for correct syntax  
[https://docs.ansible.com/ansible/latest/modules/systemd\_module.html](https://docs.ansible.com/ansible/latest/modules/systemd_module.html)

---

<div class="post-metadata">

**Author:** ![Narmada\_Karthika](https://avatars.discourse-cdn.com/v4/letter/n/b5e925/32.png) [@Narmada\_Karthika](https://forum.ansible.com/u/Narmada_Karthika)\
**Post date:** [November 2, 2018, 6:33pm UTC](https://forum.ansible.com/t/restart-kestrelservice/28924/7 "2018-11-02T18:33:56Z")

</div>

can i change it to service

---

<div class="post-metadata">

**Author:** ![Narmada\_Karthika](https://avatars.discourse-cdn.com/v4/letter/n/b5e925/32.png) [@Narmada\_Karthika](https://forum.ansible.com/u/Narmada_Karthika)\
**Post date:** [November 2, 2018, 6:39pm UTC](https://forum.ansible.com/t/restart-kestrelservice/28924/8 "2018-11-02T18:39:21Z")

</div>

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

```auto
- 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

```

---

<div class="post-metadata">

**Author:** ![Dick\_Visser](https://avatars.discourse-cdn.com/v4/letter/d/d9b06d/32.png) [@Dick\_Visser](https://forum.ansible.com/u/Dick_Visser)\
**Post date:** [November 3, 2018, 10:32am UTC](https://forum.ansible.com/t/restart-kestrelservice/28924/9 "2018-11-03T10:32:12Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Narmada\_Karthika](https://avatars.discourse-cdn.com/v4/letter/n/b5e925/32.png) [@Narmada\_Karthika](https://forum.ansible.com/u/Narmada_Karthika)\
**Post date:** [November 5, 2018, 10:35pm UTC](https://forum.ansible.com/t/restart-kestrelservice/28924/10 "2018-11-05T22:35:41Z")

</div>

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

Thanks,  
Narmada
