mise à jour role zabbix-cli

This commit is contained in:
root
2024-01-18 18:59:18 +01:00
parent 1eae98a064
commit 38582b8f8d
4 changed files with 561 additions and 18 deletions

View File

@@ -17,23 +17,10 @@
name: zabbix-agent
state: present
- name: Enable Zabbix agent service
service:
name: zabbix-agent
state: restarted
enabled: yes
- 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' }
- name: Mise en place du fichier conf zabbix agent (active)
template:
src: zabbix_agentd.conf.j2
dest: /etc/zabbix/zabbix_agentd.conf
- name: Enable Zabbix agent service
service: