Hello ALl,

I'm working on a task for SELinux for RHEL 6/7/8, SLES 11/12/15, and Debian 
7/8/10. For RHEL in /etc/selinux/, the policy file is named targeted. For 
Debian in /etc/selinux/, the policy file is named default. I currently 
don't know what it's named for SLES! I need to set SELinux to Permissive 
mode for all! ANy help will br greatly appreciated.


What I have:

selinux.yaml

---
- name: install selinux dependencies when selinux is installed on Debian
  apt:
    name: ['policycoreutils', 'checkpolicy', 'selinux-basics' ]
    state: present
  when: ansible_distribution|lower == 'debian'
- name: Set SELinux to permissive mode.
  selinux:
    policy: targeted
    state: permissive
  selinux:
    policy: default
    state: permissive
  register: set_selinux
  when: ansible_selinux_python_present|bool
- name: Reboot
  selinux:
    state: enforcing
  when: reboot_required|default(false)|bool
...

When this is run on Debian 7 the output is:

TASK [buildservers : install selinux dependencies when selinux is installed 
on Debian] 
**************************************************************************************
changed: [abldeb7]


TASK [buildservers : Set SELinux to permissive mode.] 
***********************************************************************************************************************
 [WARNING]: Reboot is required to set SELinux state to 'permissive'


ok: [abldeb7]


TASK [buildservers : Reboot] 
************************************************************************************************************************************************
skipping: [abldeb7]


When this is run on Debian 8 the output is:

TASK [buildservers : install selinux dependencies when selinux is installed 
on Debian] 
**************************************************************************************
ok: [abldeb8]


TASK [buildservers : Set SELinux to permissive mode.] 
***********************************************************************************************************************
 [WARNING]: Reboot is required to set SELinux state to 'permissive'


ok: [abldeb8]


TASK [buildservers : Reboot] 
************************************************************************************************************************************************
skipping: [abldeb8]

When this is run on Debian 10 the output is:

TASK [buildservers : install selinux dependencies when selinux is installed 
on Debian] 
**************************************************************************************
ok: [abldeb10]


TASK [buildservers : Set SELinux to permissive mode.] 
***********************************************************************************************************************
 [WARNING]: Reboot is required to set SELinux state to 'permissive'


ok: [abldeb10]


TASK [buildservers : Reboot] 
************************************************************************************************************************************************
skipping: [abldeb10]

Can someone please help with this!

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/49a2597b-0d92-4c52-b3aa-4794e66c8f75%40googlegroups.com.

Reply via email to