A custom selinux module for our haproxy setup.
This commit is contained in:
parent
29a347fbb4
commit
0a457060a9
4 changed files with 41 additions and 0 deletions
BIN
roles/haproxy/files/selinux/fi-haproxy.mod
Normal file
BIN
roles/haproxy/files/selinux/fi-haproxy.mod
Normal file
Binary file not shown.
BIN
roles/haproxy/files/selinux/fi-haproxy.pp
Normal file
BIN
roles/haproxy/files/selinux/fi-haproxy.pp
Normal file
Binary file not shown.
10
roles/haproxy/files/selinux/fi-haproxy.te
Normal file
10
roles/haproxy/files/selinux/fi-haproxy.te
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
module fi-haproxy 1.0;
|
||||||
|
|
||||||
|
require {
|
||||||
|
type haproxy_t;
|
||||||
|
class capability fowner;
|
||||||
|
}
|
||||||
|
|
||||||
|
#============= haproxy_t ==============
|
||||||
|
allow haproxy_t self:capability fowner;
|
||||||
|
|
|
@ -61,3 +61,34 @@
|
||||||
tags:
|
tags:
|
||||||
- haproxy
|
- haproxy
|
||||||
- selinux
|
- selinux
|
||||||
|
|
||||||
|
# These following four tasks are used for copying over our custom selinux
|
||||||
|
# module.
|
||||||
|
- name: ensure a directory exists for our custom selinux module
|
||||||
|
file: dest=/usr/share/haproxy state=directory
|
||||||
|
tags:
|
||||||
|
- haproxy
|
||||||
|
- selinux
|
||||||
|
|
||||||
|
- name: copy over our general haproxy selinux module
|
||||||
|
copy: src=selinux/fi-haproxy.pp dest=/usr/share/haproxy/fi-haproxy.pp
|
||||||
|
register: fi_haproxy_module
|
||||||
|
tags:
|
||||||
|
- haproxy
|
||||||
|
- selinux
|
||||||
|
|
||||||
|
- name: check to see if its even installed yet
|
||||||
|
shell: semodule -l | grep fi-haproxy | wc -l
|
||||||
|
register: fi_haproxy_grep
|
||||||
|
always_run: true
|
||||||
|
changed_when: "'0' in fi_haproxy_grep.stdout"
|
||||||
|
tags:
|
||||||
|
- haproxy
|
||||||
|
- selinux
|
||||||
|
|
||||||
|
- name: install our general haproxy selinux module
|
||||||
|
command: semodule -i /usr/share/haproxy/fi-haproxy.pp
|
||||||
|
when: fi_haproxy_module|changed or fi_haproxy_grep|changed
|
||||||
|
tags:
|
||||||
|
- haproxy
|
||||||
|
- selinux
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue