# selinux: state=disabled

**URL:** <https://forum.ansible.com/t/selinux-state-disabled/16271>\
**Category:** Ansible Developer\
**Created:** [September 18, 2014, 12:57pm UTC](https://forum.ansible.com/t/selinux-state-disabled/16271 "2014-09-18T12:57:00Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Strahinja\_Kustudic2](https://avatars.discourse-cdn.com/v4/letter/s/b4bc9f/32.png) [@Strahinja\_Kustudic2](https://forum.ansible.com/u/Strahinja_Kustudic2)\
**Post date:** [September 18, 2014, 12:57pm UTC](https://forum.ansible.com/t/selinux-state-disabled/16271/1 "2014-09-18T12:57:00Z")

</div>

Currently if SELinux is enabled on the system and if you run a task:

`

- selinux: state=disabled  
`

it will set SELinux as disabled in the conf file, but SELinux itself will still be enabled (in enforcing by default) until the system is rebooted, which basically means SELinux is not disabled after this task runs. Also re-running this task again before the server is rebooted, it will report as changed, even though we set SELinux as disabled before.

I can understand the changed problem before rebooting, but I can’t understand leaving enforcing after this. I think it would be better to change the module to set the config to disabled and run setenforce 0 to set the permissive mode as well. Currently state=disabled is useless without a restart.

I wanted to ask here what do you think before making an issue on GitHub.

---

<div class="post-metadata">

**Author:** ![James\_Cammarata](https://avatars.discourse-cdn.com/v4/letter/j/7c8e57/32.png) [@James\_Cammarata](https://forum.ansible.com/u/James_Cammarata)\
**Post date:** [September 18, 2014, 1:06pm UTC](https://forum.ansible.com/t/selinux-state-disabled/16271/2 "2014-09-18T13:06:36Z")

</div>

Hi Strahinja,

I think that makes sense, so feel free to open that issue.

Thanks!

---

<div class="post-metadata">

**Author:** ![Strahinja\_Kustudic2](https://avatars.discourse-cdn.com/v4/letter/s/b4bc9f/32.png) [@Strahinja\_Kustudic2](https://forum.ansible.com/u/Strahinja_Kustudic2)\
**Post date:** [September 19, 2014, 11:55am UTC](https://forum.ansible.com/t/selinux-state-disabled/16271/3 "2014-09-19T11:55:08Z")

</div>

I made a pull request [https://github.com/ansible/ansible/pull/9072](https://github.com/ansible/ansible/pull/9072)
