From 4f73bd7520deed736e44daa950553c478612ecfe Mon Sep 17 00:00:00 2001 From: Jimmy Chevanne Date: Thu, 11 Jan 2024 11:51:32 +0100 Subject: [PATCH] =?UTF-8?q?mise=20=C3=A0=20jour=202eme=20du=20nom=20zabbix?= =?UTF-8?q?=20cli?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- roles/zabbix-cli/defaults/main.yml | 4 +++- roles/zabbix-cli/handlers/main.yml | 17 +++++------------ roles/zabbix-cli/tasks/main.yml | 20 ++++++++++++++++---- 3 files changed, 24 insertions(+), 17 deletions(-) diff --git a/roles/zabbix-cli/defaults/main.yml b/roles/zabbix-cli/defaults/main.yml index 9772181..2d4c3ce 100644 --- a/roles/zabbix-cli/defaults/main.yml +++ b/roles/zabbix-cli/defaults/main.yml @@ -2,5 +2,7 @@ PidFile: "/run/zabbix/zabbix_agentd.pid" LogFile: "/var/log/zabbix/zabbix_agentd.log" LogFileSize: "0" Server: "127.0.0.1" -ServerActive: "192.168.99.106" +ServerActive: "s-mon.gsb.adm" Include: "/etc/zabbix/zabbix_agentd.d/*.conf" +UrlAgent: "https://repo.zabbix.com/zabbix/6.4/debian/pool/main/z/zabbix-release/zabbix-release_6.4-1+debian12_all.deb" +PathAgent: "/tmp/zabbix-release_6.4-1+debian12_all.deb" diff --git a/roles/zabbix-cli/handlers/main.yml b/roles/zabbix-cli/handlers/main.yml index 2a02673..42f64a5 100644 --- a/roles/zabbix-cli/handlers/main.yml +++ b/roles/zabbix-cli/handlers/main.yml @@ -1,12 +1,5 @@ - - name: config - template: - src: zabbix_agentd.conf.temp - dest: /etc/zabbix/zabbix_agentd.conf - vars: - PidFile: "{{ PidFile }}" - LogFile: "{{ LogFile }}" - LogFileSize: "{{ LogFileSize }}" - Server: "{{ Server }}" - ServerActive: "{{ ServerActive }}" - Hostname: "{{ ansible_hostname }}" - Include: "{{ Include }}" + - name: restart zabbix agent + service: + name: zabbix-agent + state: restarted + enabled: yes diff --git a/roles/zabbix-cli/tasks/main.yml b/roles/zabbix-cli/tasks/main.yml index 016073a..9ae40e4 100644 --- a/roles/zabbix-cli/tasks/main.yml +++ b/roles/zabbix-cli/tasks/main.yml @@ -1,11 +1,11 @@ - name: Intallation paquet zabbix agent get_url: - url: "https://repo.zabbix.com/zabbix/6.4/debian/pool/main/z/zabbix-release/zabbix-release_6.4-1+debian12_all.deb" - dest: "/tmp/zabbix-release_6.4-1+debian12_all.deb" + url: "{{ UrlAgent }}" + dest: "/tmp" - name: Intallation paquet zabbix agent suite apt: - deb: "/tmp/zabbix-release_6.4-1+debian12_all.deb" + deb: "{{ PathAgent }}" state: present - name: Update apt @@ -25,6 +25,18 @@ - name: Rm package file: - path: "/tmp/zabbix-release_6.4-1+debian12_all.deb" + path: "{{ PathAgent }}" state: absent + - name: config + template: + src: zabbix_agentd.conf.temp + dest: /etc/zabbix/zabbix_agentd.conf + vars: + PidFile: "{{ PidFile }}" + LogFile: "{{ LogFile }}" + LogFileSize: "{{ LogFileSize }}" + Server: "{{ Server }}" + ServerActive: "{{ ServerActive }}" + Hostname: "{{ ansible_hostname }}" + Include: "{{ Include }}"