mirror of
https://git.lapiole.org/dani/ansible-roles.git
synced 2025-04-19 11:43:16 +02:00
38 lines
912 B
YAML
38 lines
912 B
YAML
![]() |
---
|
||
|
|
||
|
- name: Set correct SELinux labels
|
||
|
sefcontext:
|
||
|
target: "{{ pki_root_dir }}/{{ item.path }}(/.*)?"
|
||
|
setype: "{{ item.type }}"
|
||
|
state: present
|
||
|
loop:
|
||
|
- path: run
|
||
|
type: httpd_var_run_t
|
||
|
- path: web/cgi-bin
|
||
|
type: httpd_sys_script_exec_t
|
||
|
- path: web/htdocs
|
||
|
type: httpd_sys_content_t
|
||
|
- path: data
|
||
|
type: httpd_sys_content_t
|
||
|
tags: pki
|
||
|
|
||
|
- name: Restore SElinux contexts
|
||
|
command: restorecon -R {{ pki_root_dir }}
|
||
|
changed_when: False
|
||
|
tags: pki
|
||
|
|
||
|
- name: Copy SElinux policy file
|
||
|
copy: src=openxpki.te dest=/etc/selinux/targeted/local/
|
||
|
register: pki_selinux_policy
|
||
|
tags: pki
|
||
|
|
||
|
- name: Add local policy
|
||
|
shell: |
|
||
|
cd /etc/selinux/targeted/local/
|
||
|
checkmodule -M -m -o openxpki.mod openxpki.te
|
||
|
semodule_package -o openxpki.pp -m openxpki.mod
|
||
|
semodule -i /etc/selinux/targeted/local/openxpki.pp
|
||
|
when: pki_selinux_policy.changed
|
||
|
tags: pki
|
||
|
|