From 88d1e79ea495e06ecb01ec6cd6905b1f59b07e08 Mon Sep 17 00:00:00 2001 From: Adam Saleh Date: Mar 16 2021 15:09:44 +0000 Subject: Making the config-file path configurable. --- diff --git a/roles/zabbix/zabbix-agent/tasks/main.yml b/roles/zabbix/zabbix-agent/tasks/main.yml index 270a716..2e4f283 100644 --- a/roles/zabbix/zabbix-agent/tasks/main.yml +++ b/roles/zabbix/zabbix-agent/tasks/main.yml @@ -41,7 +41,7 @@ - name: Configuring Zabbix agentd template: src: zabbix_agentd.conf.j2 - dest: /etc/zabbix/zabbix_agentd.conf + dest: "{{ zabbix_agentd }}" notify: restart_zabbix_agent - name: Ensuring we have a directory to put zabbix scripts @@ -55,7 +55,7 @@ - name: Adding some other conf files under zabbix_agentd.d template: src: "{{ item }}.j2" - dest: "/etc/zabbix/zabbix_agentd.d/{{ item }}" + dest: "{{ zabbix_agentd_dir }}/{{ item }}" owner: zabbix mode: 0666 notify: restart_zabbix_agent diff --git a/roles/zabbix/zabbix-agent/vars/CentOS-8.yml b/roles/zabbix/zabbix-agent/vars/CentOS-8.yml index 045ea43..c210bdb 100644 --- a/roles/zabbix/zabbix-agent/vars/CentOS-8.yml +++ b/roles/zabbix/zabbix-agent/vars/CentOS-8.yml @@ -6,3 +6,7 @@ zabbix_pkgs_list: - zabbix-sender - bc - ncurses-compat-libs # Needed for some megacli tools and raid monitoring checks through zabbix_sender + +zabbix_agentd: /etc/zabbix/zabbix_agentd.conf + +zabbix_agentd_dir: /etc/zabbix/zabbix_agentd.d \ No newline at end of file diff --git a/roles/zabbix/zabbix-agent/vars/Fedora.yml b/roles/zabbix/zabbix-agent/vars/Fedora.yml index 3d8756b..41f8153 100644 --- a/roles/zabbix/zabbix-agent/vars/Fedora.yml +++ b/roles/zabbix/zabbix-agent/vars/Fedora.yml @@ -7,3 +7,7 @@ zabbix_pkgs_list: - zabbix-selinux - bc - ncurses-compat-libs # Needed for some megacli tools and raid monitoring checks through zabbix_sender + +zabbix_agentd: /etc/zabbix_agentd.conf + +zabbix_agentd_dir: /etc/zabbix/ \ No newline at end of file