Yo que se ya...
This commit is contained in:
parent
ff4f33744e
commit
5054d44e37
@ -1,27 +1,32 @@
|
|||||||
---
|
---
|
||||||
- name: Instalar y configurar Zabbix Agent2 usando la colección Zabbix for Ansible
|
- name: Instalar y configurar Zabbix Agent2 usando la colección Zabbix for Ansible
|
||||||
hosts: all
|
hosts: all
|
||||||
become: no
|
become: yes
|
||||||
tasks:
|
collections:
|
||||||
- name: Copiar configuración personalizada
|
- community.zabbix
|
||||||
ansible.builtin.copy:
|
|
||||||
src: config/zabbix_agent2.conf # Archivo en tu directorio de Ansible
|
|
||||||
dest: /etc/zabbix/zabbix_agent2.conf
|
|
||||||
owner: root
|
|
||||||
group: root
|
|
||||||
mode: 0644
|
|
||||||
roles:
|
roles:
|
||||||
- role: community.zabbix.zabbix_agent
|
- role: community.zabbix.zabbix_agent
|
||||||
# Versión del agente a instalar
|
|
||||||
zabbix_agent2: true
|
vars:
|
||||||
zabbix_agent_config:
|
# Especificar que se instalará Zabbix Agent2
|
||||||
Server: "192.168.1.10" # Obligatorio: IP/host del servidor Zabbix
|
zabbix_agent_variant: 2
|
||||||
ServerActive: "192.168.1.10" # Obligatorio para checks activos
|
zabbix_agent_config:
|
||||||
Hostname: "{{ ansible_hostname }}" # Obligatorio: Nombre único en Zabbix
|
Server: "192.168.1.10" # IP/host del servidor Zabbix
|
||||||
User: root # Usuario para ejecutar comandos
|
ServerActive: "192.168.1.10" # Servidor activo
|
||||||
AllowRoot: 1
|
Hostname: "{{ ansible_hostname }}" # Nombre único en Zabbix
|
||||||
|
AllowRoot: 1 # Permitir ejecución como root
|
||||||
# Ejecutar servicio como root
|
|
||||||
zabbix_agent_user: root
|
# Ejecutar servicio como root
|
||||||
zabbix_agent_group: root
|
zabbix_agent_user: root
|
||||||
|
zabbix_agent_group: root
|
||||||
|
|
||||||
|
tasks:
|
||||||
|
- name: Copiar configuración personalizada
|
||||||
|
ansible.builtin.copy:
|
||||||
|
src: config/zabbix_agent2.conf # Archivo en tu directorio de Ansible
|
||||||
|
dest: /etc/zabbix/zabbix_agent2.conf
|
||||||
|
owner: root
|
||||||
|
group: root
|
||||||
|
mode: 0644
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user