Files
fedora-infra_ansible/tasks/compile-selinux.yml
Greg Sutcliffe 68f6aa9b95 Base: Make the SElinux module compilation reusable
THis moves the SELinux "handler" in roles/base to a global
task file, which allows it to be reused by other roles.

Eventually this should probably be a native Ansible type,
but this is still an improvment.

Signed-off-by: Greg Sutcliffe <fedora@emeraldreverie.org>
2025-10-31 12:38:36 +00:00

21 lines
678 B
YAML

# In tasks/selinux_module.yml (can be in a common/shared tasks directory)
- name: Compile SELinux module
ansible.builtin.shell: |
cd {{ selinux_module_dir }}
checkmodule -M -m -o {{ selinux_module_name }}.mod {{ selinux_module_name }}.te
semodule_package -o {{ selinux_module_name }}.pp -m {{ selinux_module_name }}.mod
tags:
- selinux
- name: Install SELinux module
ansible.builtin.command: semodule -i {{ selinux_module_dir }}/{{ selinux_module_name }}.pp
tags:
- selinux
- name: Cleanup SELinux module build files
ansible.builtin.file:
path: "{{ selinux_module_dir }}/{{ selinux_module_name }}.mod"
state: absent
tags:
- selinux