---
- name: "SELinux | Install related SELinux packages"
  ansible.builtin.package:
    name:
      - python3-libsemanage
      - python3-policycoreutils
      - zabbix-selinux-policy
  environment:
    http_proxy: "{{ zabbix_http_proxy | default(None) | default(omit) }}"
    https_proxy: "{{ zabbix_https_proxy | default(None) | default(omit) }}"
  register: zabbix_proxy_dependencies_installed
  until: zabbix_proxy_dependencies_installed is succeeded
  become: true
  tags:
    - install

- name: "SELinux | Set booleans"
  ansible.posix.seboolean:
    name: "{{ item.name }}"
    state: "{{ item.state }}"
    persistent: true
  become: true
  tags:
    - config
  loop:
    - name: zabbix_can_network
      state: "{{ selinux_allow_zabbix_can_network }}"
    - name: daemons_enable_cluster_mode
      state: "{{ selinux_allow_daemons_enable_cluster_mode }}"
