# Set SELinux to permissive mode and reboot.

**URL:** <https://forum.ansible.com/t/set-selinux-to-permissive-mode-and-reboot/31197>\
**Category:** Ansible Project\
**Tags:** ansible-project\
**Created:** [September 4, 2019, 1:51pm UTC](https://forum.ansible.com/t/set-selinux-to-permissive-mode-and-reboot/31197 "2019-09-04T13:51:16Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![racke](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/racke/32/4767_2.png) [@racke](https://forum.ansible.com/u/racke)\
**Post date:** [September 4, 2019, 1:51pm UTC](https://forum.ansible.com/t/set-selinux-to-permissive-mode-and-reboot/31197/1 "2019-09-04T13:51:16Z")

</div>

> Hello All,
> 
> I need to set SELinux to permissive mode and reboot. When I run my playbook I get an error.
> 
> Playbook:
> 
> \>  
> ---  
> -name:SetSELinuxto permissive mode.  
> selinux:  
> policy:targeted  
> state:permissive  
> when:ansible\_selinux\_python\_present|bool  
> -name:Reboot  
> selinux:  
> when:reboot\_required|bool  
> \>
> 
> Error:
> 
> \>  
> TASK [buildservers  
> :Reboot]\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
> fatal:[abls15ex]:FAILED!=\>{"msg":"The conditional check 'reboot\_required|bool' failed. The error was: error while  
> evaluating conditional (reboot\_required|bool): 'reboot\_required' is undefined\n\nThe error appears to be in  
> '/home/jamekeit/ds9/roles/buildservers/tasks/selinux.yaml': line 7, column 3, but may\nbe elsewhere in the file  
> depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n when:  
> ansible\_selinux\_python\_present|bool\n- name: Reboot\n ^ here\n"}
> 
> \>
> 
> Can anyone help?

Apparently the variable "reboot\_required" is not defined. Either set a default value or try

reboot\_required | default(false) | bool

Regards  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Racke
