# missing state(absent) in service module

**URL:** <https://forum.ansible.com/t/missing-state-absent-in-service-module/19054>\
**Category:** Ansible Developer\
**Created:** [August 19, 2015, 2:17pm UTC](https://forum.ansible.com/t/missing-state-absent-in-service-module/19054 "2015-08-19T14:17:09Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![alxgu1](https://avatars.discourse-cdn.com/v4/letter/a/22d042/32.png) [@alxgu1](https://forum.ansible.com/u/alxgu1)\
**Post date:** [August 19, 2015, 2:17pm UTC](https://forum.ansible.com/t/missing-state-absent-in-service-module/19054/1 "2015-08-19T14:17:09Z")

</div>

Hi,

any reason why the service module doesn’t have the state=absent?

Some packages setup their service into runlevel 3 during the installation.

Would a PullRequest be accepted, which add this functionality?

- state  
`started'/`stopped’ are idempotent actions that will not run  
commands unless necessary. `restarted' will always bounce the service. `reloaded’ will always reload. _At least one of  
state and enabled are required._ (Choices: started, stopped,  
restarted, reloaded)

Regards,  
Alex

---

<div class="post-metadata">

**Author:** ![Jonathan\_Mainguy](https://avatars.discourse-cdn.com/v4/letter/j/e274bd/32.png) [@Jonathan\_Mainguy](https://forum.ansible.com/u/Jonathan_Mainguy)\
**Post date:** [August 19, 2015, 2:25pm UTC](https://forum.ansible.com/t/missing-state-absent-in-service-module/19054/2 "2015-08-19T14:25:05Z")

</div>

enabled=no would have the same effect as your absent idea I believe. Keeps it from being started by default.

[https://docs.ansible.com/ansible/service\_module.html](https://docs.ansible.com/ansible/service_module.html)

---

<div class="post-metadata">

**Author:** ![Brian\_Coca](https://avatars.discourse-cdn.com/v4/letter/b/6de8d8/32.png) [@Brian\_Coca](https://forum.ansible.com/u/Brian_Coca)\
**Post date:** [August 19, 2015, 3:02pm UTC](https://forum.ansible.com/t/missing-state-absent-in-service-module/19054/3 "2015-08-19T15:02:46Z")

</div>

service module does not deal with installation so present/absent make  
little sense here. enabled=yes/no already does what you suggest.

---

<div class="post-metadata">

**Author:** ![alxgu1](https://avatars.discourse-cdn.com/v4/letter/a/22d042/32.png) [@alxgu1](https://forum.ansible.com/u/alxgu1)\
**Post date:** [August 20, 2015, 5:55am UTC](https://forum.ansible.com/t/missing-state-absent-in-service-module/19054/4 "2015-08-20T05:55:39Z")

</div>

Thank you guys for the advice =)
