maj zabbix cli

This commit is contained in:
root 2024-01-15 17:22:15 +01:00
parent 6b10b981f4
commit 045af9bea2
3 changed files with 12 additions and 20 deletions

View File

@ -23,15 +23,14 @@
state: restarted
enabled: yes
- name: config
template:
src: zabbix_agentd.conf.temp
dest: /etc/zabbix/zabbix_agentd.conf
vars:
PidFile: "/run/zabbix/zabbix_agentd.pid"
LogFile: "/var/log/zabbix/zabbix_agentd.log"
LogFileSize: "0"
Server: "127.0.0.1"
ServerActive: "192.168.99.8"
Hostname: "{{ ansible_hostname }}"
Include: "/etc/zabbix/zabbix_agentd.d/*.conf"
- name: Replace Zabbix agent config
replace:
path: /etc/zabbix/zabbix_agentd.conf
regexp: '{{ item.regexp }}'
replace: '{{ item.replace }}'
backup: true
loop:
- { regexp: '^(Server\s*=\s*).*$', replace: 'Server = 127.0.0.1' }
- { regexp: '^(ServerActive\s*=\s*).*$', replace: 'ServerActive = 192.168.99.8' }
- { regexp: '^(Hostname\s*=\s*).*$', replace: 'Hostname = {{ ansible_hostname }}' }
- { regexp: '^(Include\s*=\s*).*$', replace: 'Include = /etc/zabbix/zabbix_agentd.d/*.conf' }

View File

@ -1,7 +0,0 @@
PidFile={{ PidFile }}
LogFile={{ LogFile }}
LogFileSize={{ LogFileSize }}
Server={{ Server }}
ServerActive={{ ServerActive }}
Hostname={{ Hostname }}
Include={{ Include }}

View File

@ -13,7 +13,7 @@
roles:
- base
- goss
#- zabbix-cli
- zabbix-cli
- glpi
- ssh-cli
# - syslog-cli