SLES 15 SP1 SAet to Permissive Mode

25 views
Skip to first unread message

Keith Mills

unread,
Sep 23, 2019, 10:19:58 AM9/23/19
to Ansible Project
Happy Monday All,

I'm working on a task to set SELinux to permissive mode for RHEL/Debian and to set Apparmor to permissive mode for SLES15/12/11. I have my code in place for SELinux but I don't know what to do for SLES! This is what I have:

---
- name: install selinux dependencies when selinux is installed on Debian
  apt
:
    name
: ['policycoreutils', 'checkpolicy', 'selinux-basics', 'python-selinux' ]
    state
: present
 
when: ansible_distribution|lower == 'debian'
- name: Set SELinux to permissive mode | RHEL
  selinux
:
    policy
: targeted
    state
: permissive
 
register: task_result
 
when: ansible_distribution|lower == 'redhat'
- name: Set SELinux to permissive mode | Debian
  selinux
:
    policy
: default
    state
: permissive
 
register: task_result
 
when:
   
- ansible_selinux_python_present|bool
   
- ansible_distribution|lower == 'debian'
- name: Reboot the server and wait for it to come back up.
  reboot
:
 
when: task_result is changed
...

Ansible Version:

ansible 2.8.4
  config file
= /etc/ansible/ansible.cfg
  configured
module search path = [u'/home/jamekeit/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
  ansible python
module location = /usr/lib/python2.7/site-packages/ansible
  executable location
= /usr/bin/ansible
  python version
= 2.7.5 (default, May 31 2018, 09:41:32) [GCC 4.8.5 20150623 (Red Hat 4.8.5-28)]


Controller Machine OS:

NAME="Red Hat Enterprise Linux Server"
VERSION
="7.5 (Maipo)"
ID
="rhel"

Pointers will be greatly appreciated!

Can anyone help me out with setting apparmor to permissive for SLES?

I'm totally stuck!

Kai Stian Olstad

unread,
Sep 23, 2019, 12:24:58 PM9/23/19
to ansible...@googlegroups.com
On 23.09.2019 16:19, Keith Mills wrote:
> Pointers will be greatly appreciated!
>
> Can anyone help me out with setting apparmor to permissive for SLES?

Since this has absolutely nothing to do with Ansible I suggest SLES community, Apparmor community or some generic Linux community.


--
Kai Stian Olstad

Keith Mills

unread,
Sep 26, 2019, 8:28:52 AM9/26/19
to Ansible Project
Why doesn't this have anything to do with Ansible? I'm trying to do this with Ansible! I'm asking if there's a way to do it within Ansible! How would I set up the Ansible task?

Stefan Hornburg (Racke)

unread,
Sep 26, 2019, 8:35:48 AM9/26/19
to ansible...@googlegroups.com
On 9/26/19 2:28 PM, Keith Mills wrote:
> Why doesn't this have anything to do with Ansible? I'm trying to do this with Ansible! I'm asking if there's a way to do
> it within Ansible! How would I set up the Ansible task?

Well if you can come up with a shell command that does what you want, we can certainly translate it in an Ansible task.
I'm not familiar with Apparmor, so I can't relieve you from that research :-). More questions can be answered if the
posters do their homework ...

Regards
Racke


>
> On Monday, September 23, 2019 at 11:24:58 AM UTC-5, Kai Stian Olstad wrote:
>
> On 23.09.2019 16:19, Keith Mills wrote:
> > Pointers will be greatly appreciated!
> >
> > Can anyone help me out with setting apparmor to permissive for SLES?
>
> Since this has absolutely nothing to do with Ansible I suggest SLES community, Apparmor community or some generic
> Linux community.
>
>
> --
> Kai Stian Olstad
>
> --
> 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
> ansible-proje...@googlegroups.com <mailto:ansible-proje...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/1a891800-5637-4c9c-b0b5-6b60134a1d48%40googlegroups.com
> <https://groups.google.com/d/msgid/ansible-project/1a891800-5637-4c9c-b0b5-6b60134a1d48%40googlegroups.com?utm_medium=email&utm_source=footer>.


--
Ecommerce and Linux consulting + Perl and web application programming.
Debian and Sympa administration. Provisioning with Ansible.

signature.asc
Reply all
Reply to author
Forward
0 new messages