- collectors
- include: selinux.yml
- when: not containerized_deployment
+ when:
+ - not containerized_deployment
+ - ansible_selinux.status is defined
+ - ansible_selinux.status == 'enabled'
tags:
- selinux
--- /dev/null
+---
+- name: Remove SELinux policy package
+ command: semodule -r cephmetrics
+ failed_when: false
+
+- name: Remove any SELinux-related files
+ file:
+ path: "{{ item }}"
+ state: absent
+ with_items:
+ - /tmp/cephmetrics.fc
+ - /tmp/cephmetrics.if
+ - /tmp/cephmetrics.pp
+ - /tmp/cephmetrics.te
+
+- name: Copy SELinux type enforcement file
+ copy:
+ src: cephmetrics.te
+ dest: /tmp/cephmetrics.te
+
+- name: Build SELinux policy package
+ command: make -f /usr/share/selinux/devel/Makefile cephmetrics.pp
+ args:
+ chdir: /tmp
+
+- name: Load SELinux policy package
+ command: semodule -i /tmp/cephmetrics.pp
+ notify: Restart collectd