From 6a5383757955c17ac47259a3da2f24057a81c10e Mon Sep 17 00:00:00 2001 From: "Troy W." Date: Wed, 5 Jun 2024 21:34:05 -0400 Subject: [PATCH] Fixed Selinux Var --- docs/ZABBIX_AGENT_ROLE.md | 2 +- roles/zabbix_agent/defaults/main.yml | 2 +- roles/zabbix_agent/tasks/Linux.yml | 2 +- roles/zabbix_agent/tasks/selinux.yml | 2 +- roles/zabbix_proxy/tasks/main.yml | 2 +- roles/zabbix_server/tasks/main.yml | 2 +- roles/zabbix_web/tasks/RedHat.yml | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/docs/ZABBIX_AGENT_ROLE.md b/docs/ZABBIX_AGENT_ROLE.md index 76a1c3239..19c202e84 100644 --- a/docs/ZABBIX_AGENT_ROLE.md +++ b/docs/ZABBIX_AGENT_ROLE.md @@ -123,7 +123,7 @@ The following is an overview of all available configuration default for this rol ### SElinux -* `zabbix_selinux`: Default: `False`. Enables an SELinux policy so that the server will run. +* `zabbix_agent_selinux`: Default: `False`. Enables an SELinux policy so that the server will run. * `selinux_allow_zabbix_run_sudo`: Default: `False`. Enable Zabbix root access on system. ### Zabbix Agent diff --git a/roles/zabbix_agent/defaults/main.yml b/roles/zabbix_agent/defaults/main.yml index 15059ed33..8831cc759 100644 --- a/roles/zabbix_agent/defaults/main.yml +++ b/roles/zabbix_agent/defaults/main.yml @@ -10,7 +10,7 @@ zabbix_agent_sender_package: "{{ zabbix_sender_package }}" zabbix_get_package: zabbix-get # Depricate in 3.0 zabbox_agent_get_package: "{{ zabbix_get_package }}" zabbix_agent_package_state: present -zabbix_selinux: false +zabbix_agent_selinux: false zabbix_agent_conf_mode: "0644" zabbix_agent_dont_detect_ip: false diff --git a/roles/zabbix_agent/tasks/Linux.yml b/roles/zabbix_agent/tasks/Linux.yml index aa8bca132..75e599747 100644 --- a/roles/zabbix_agent/tasks/Linux.yml +++ b/roles/zabbix_agent/tasks/Linux.yml @@ -86,7 +86,7 @@ - name: "Configure SELinux when enabled" ansible.builtin.include_tasks: selinux.yml when: - - zabbix_selinux | bool + - zabbix_agent_selinux | bool | default (false) - name: "Adding zabbix group" ansible.builtin.group: diff --git a/roles/zabbix_agent/tasks/selinux.yml b/roles/zabbix_agent/tasks/selinux.yml index f82072d68..80a718119 100644 --- a/roles/zabbix_agent/tasks/selinux.yml +++ b/roles/zabbix_agent/tasks/selinux.yml @@ -67,7 +67,7 @@ - name: "SELinux | Set zabbix_selinux to true if getenforce returns Enforcing or Permissive" ansible.builtin.set_fact: - zabbix_selinux: "{{ true }}" + zabbix_agent_selinux: "{{ true }}" when: - 'getenforce_bin.stat.exists and ("Enforcing" in sestatus.stdout or "Permissive" in sestatus.stdout)' tags: diff --git a/roles/zabbix_proxy/tasks/main.yml b/roles/zabbix_proxy/tasks/main.yml index 5b565aa55..31cd13d34 100644 --- a/roles/zabbix_proxy/tasks/main.yml +++ b/roles/zabbix_proxy/tasks/main.yml @@ -57,7 +57,7 @@ - name: "Configure SELinux when enabled" ansible.builtin.include_tasks: selinux.yml when: - - zabbix_proxy_selinux | bool + - zabbix_proxy_selinux | bool | default (false) - ansiblle_os_family == "RedHat" - name: "Install zabbix-proxy packages" diff --git a/roles/zabbix_server/tasks/main.yml b/roles/zabbix_server/tasks/main.yml index f0c8cc242..35e66f310 100644 --- a/roles/zabbix_server/tasks/main.yml +++ b/roles/zabbix_server/tasks/main.yml @@ -39,7 +39,7 @@ - name: "Configure SELinux when enabled" ansible.builtin.include_tasks: selinux.yml when: - - zabbix_proxy_selinux | bool + - zabbix_server_selinux | bool | default (false) - ansiblle_os_family == "RedHat" - name: Install zabbix-server packages diff --git a/roles/zabbix_web/tasks/RedHat.yml b/roles/zabbix_web/tasks/RedHat.yml index ab14d640d..3917efaad 100644 --- a/roles/zabbix_web/tasks/RedHat.yml +++ b/roles/zabbix_web/tasks/RedHat.yml @@ -42,4 +42,4 @@ - name: "Configure SELinux when enabled" ansible.builtin.include_tasks: selinux.yml when: - - zabbix_web_selinux | bool + - zabbix_web_selinux | bool | default (false)