-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path7.agente_zabbix.yml
41 lines (40 loc) · 1.22 KB
/
7.agente_zabbix.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
---
- hosts: servidores_python
become: yes
tasks:
- name: Install epel-repo
yum:
name: https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm
state: present
disable_gpg_check: yes
- name: Install zabbix-repo
yum:
name: https://repo.zabbix.com/zabbix/5.0/rhel/8/x86_64/zabbix-release-5.0-1.el8.noarch.rpm
state: present
disable_gpg_check: yes
- name: Install zabbix-agent
yum:
name: zabbix-agent
state: present
- name: change zabbix_agentd.conf Server
lineinfile:
path: /etc/zabbix/zabbix_agentd.conf
state: present
regexp: 'Server=127.0.0.1'
line: "Server={{ zabbix_server }}"
- name: change zabbix_agentd.conf ServerActive
lineinfile:
path: /etc/zabbix/zabbix_agentd.conf
state: present
regexp: 'ServerActive=127.0.0.1'
line: "ServerActive={{ zabbix_serveractive }}"
- name: Abrir puerto Agente
firewalld:
port: "{{ zabbix_port }}"
permanent: yes
state: enabled
- name: Start zabbix-agent
service:
name: zabbix-agent
state: started
enabled: yes