mirror of
https://git.lapiole.org/dani/ansible-roles.git
synced 2025-07-30 03:05:51 +02:00
Update to 2024-07-22 10:00
This commit is contained in:
28
roles/prosody/tasks/selinux.yml
Normal file
28
roles/prosody/tasks/selinux.yml
Normal file
@@ -0,0 +1,28 @@
|
||||
---
|
||||
|
||||
- name: Set correct SELinux context
|
||||
sefcontext:
|
||||
target: "/opt/prosody(/.*)?"
|
||||
setype: lib_t
|
||||
seuser: system_u
|
||||
state: present
|
||||
tags: prosody
|
||||
|
||||
- name: Restore SELinux context
|
||||
command: restorecon -R /opt/prosody/modules
|
||||
changed_when: false
|
||||
tags: prosody
|
||||
|
||||
- name: Copy SELinux policy
|
||||
copy: src=prosody-ansible.te dest=/etc/selinux/targeted/local/
|
||||
register: prosody_selinux_policy
|
||||
tags: prosody
|
||||
|
||||
- name: Compile and load SELinux policy
|
||||
shell: |
|
||||
cd /etc/selinux/targeted/local/
|
||||
checkmodule -M -m -o prosody-ansible.mod prosody-ansible.te
|
||||
semodule_package -o prosody-ansible.pp -m prosody-ansible.mod
|
||||
semodule -i /etc/selinux/targeted/local/prosody-ansible.pp
|
||||
when: prosody_selinux_policy.changed
|
||||
tags: prosody
|
Reference in New Issue
Block a user