# SPDX-License-Identifier: MIT
---
- name: Manage SELinux
  when: metrics_manage_selinux | bool
  block:
    - name: Set pcp_bind_all_unreserved_ports
      set_fact:
        __metrics_selinux:
          - [{name: 'pcp_bind_all_unreserved_ports', state: 'on'}]

    - name: Ensure the port status with the selinux role
      include_role:
        name: fedora.linux_system_roles.selinux
      vars:
        selinux_booleans: "{{ __metrics_selinux }}"
