From 88d1e79ea495e06ecb01ec6cd6905b1f59b07e08 Mon Sep 17 00:00:00 2001 From: Adam Saleh Date: Tue, 16 Mar 2021 16:09:44 +0100 Subject: [PATCH] Making the config-file path configurable. --- roles/zabbix/zabbix-agent/tasks/main.yml | 4 ++-- roles/zabbix/zabbix-agent/vars/CentOS-8.yml | 4 ++++ roles/zabbix/zabbix-agent/vars/Fedora.yml | 4 ++++ 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/roles/zabbix/zabbix-agent/tasks/main.yml b/roles/zabbix/zabbix-agent/tasks/main.yml index 270a716a0c..2e4f28322b 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 045ea43ebd..c210bdb0db 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 3d8756ba87..41f8153b4d 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