# Ask for service module state option reload-or-restart

**URL:** <https://forum.ansible.com/t/ask-for-service-module-state-option-reload-or-restart/25701>\
**Category:** Ansible Project\
**Created:** [October 9, 2017, 9:14am UTC](https://forum.ansible.com/t/ask-for-service-module-state-option-reload-or-restart/25701 "2017-10-09T09:14:51Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![cesarjorgemartinez](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/cesarjorgemartinez/32/163_2.png) [@cesarjorgemartinez](https://forum.ansible.com/u/cesarjorgemartinez)\
**Post date:** [October 9, 2017, 9:14am UTC](https://forum.ansible.com/t/ask-for-service-module-state-option-reload-or-restart/25701/1 "2017-10-09T09:14:51Z")

</div>

Hi,

Reading [http://docs.ansible.com/ansible/latest/service\_module.html](http://docs.ansible.com/ansible/latest/service_module.html), in the options table:

> state |   
> |   
> |   
> - started  
> - stopped  
> - restarted  
> - reloaded  
> |
> 
> - | - | - | - |

Not found the systemd option reload-or-restart  
I can use this reload-or-restart here?

Regards

---

<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:** [October 9, 2017, 1:15pm UTC](https://forum.ansible.com/t/ask-for-service-module-state-option-reload-or-restart/25701/2 "2017-10-09T13:15:07Z")

</div>

That does not make sense in the service action, as it is systemd specific, but we can look into it for the systemd one.

---

<div class="post-metadata">

**Author:** ![cesarjorgemartinez](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/cesarjorgemartinez/32/163_2.png) [@cesarjorgemartinez](https://forum.ansible.com/u/cesarjorgemartinez)\
**Post date:** [October 9, 2017, 1:54pm UTC](https://forum.ansible.com/t/ask-for-service-module-state-option-reload-or-restart/25701/3 "2017-10-09T13:54:57Z")

</div>

Hi,

The systemd module neither has reload-or-restart option.

In the service action we should use it too the reload-or-restart option, because in Unix, the systemd automatic detects if we have a systemd unit or not, and redirect to systemctl appropiately.

Regards

---

<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:** [October 9, 2017, 1:57pm UTC](https://forum.ansible.com/t/ask-for-service-module-state-option-reload-or-restart/25701/4 "2017-10-09T13:57:24Z")

</div>

No, the service action is the 'lowest common denominator' for  
services, it should not have something specific to systemd as it will  
break with other service plugins (sysvinit, upstart, rc.d, etc).

The systemd module does not currently support it, but it does make  
sense to add it there.

---

<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:** [October 9, 2017, 1:57pm UTC](https://forum.ansible.com/t/ask-for-service-module-state-option-reload-or-restart/25701/5 "2017-10-09T13:57:25Z")

</div>

No, the service action is the 'lowest common denominator' for  
services, it should not have something specific to systemd as it will  
break with other service plugins (sysvinit, upstart, rc.d, etc).

The systemd module does not currently support it, but it does make  
sense to add it there.

---

<div class="post-metadata">

**Author:** ![cesarjorgemartinez](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/cesarjorgemartinez/32/163_2.png) [@cesarjorgemartinez](https://forum.ansible.com/u/cesarjorgemartinez)\
**Post date:** [October 9, 2017, 2:01pm UTC](https://forum.ansible.com/t/ask-for-service-module-state-option-reload-or-restart/25701/6 "2017-10-09T14:01:03Z")

</div>

Not for the normal service operations?  
Ex:  
service slapd start  
Redirecting to /bin/systemctl start slapd.service

---

<div class="post-metadata">

**Author:** ![cesarjorgemartinez](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/cesarjorgemartinez/32/163_2.png) [@cesarjorgemartinez](https://forum.ansible.com/u/cesarjorgemartinez)\
**Post date:** [October 9, 2017, 2:03pm UTC](https://forum.ansible.com/t/ask-for-service-module-state-option-reload-or-restart/25701/7 "2017-10-09T14:03:01Z")

</div>

And for the reload:  
service slapd reload-or-restart  
Redirecting to /bin/systemctl reload-or-restart slapd.service

---

<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:** [October 9, 2017, 2:46pm UTC](https://forum.ansible.com/t/ask-for-service-module-state-option-reload-or-restart/25701/8 "2017-10-09T14:46:44Z")

</div>

the 'service' module is not he same as the 'service' command, the  
'service' command is not the same across distributions, it is not even  
guaranteed to be present. Those that do have a 'service' command that  
are not controlled by systemd do not have the same behaviour as you  
show above.
