ansible-role-zabbix-server/roles/zabbix_server/tasks/instalar_plantilla_extensiones.yml
2024-10-22 18:19:12 -05:00

28 lines
1005 B
YAML

---
# Enlace git zabbix para templates 6.4
# https://git.zabbix.com/projects/ZBX/repos/zabbix/browse/templates?at=release%2F6.4
#
# Se debe modificar con los nuevos templates
# Descarga e instala plantilla para OS Linux que corresponde a las extensiones
# de agente Zabbix instaladas por el rol zabbix_agent_extensions
#
#
#
- name: Descargar plantilla en formato XML
get_url:
url: 'https://raw.githubusercontent.com/scoopex/zabbix-agent-extensions/master/zabbix_templates/5.2/custom-os-linux.xml'
dest: '{{ role_path }}/files/agent_extensions_5.2_custom_os_linux.xml'
mode: '0444'
delegate_to: ansible_server
- name: Importar plantilla en servidor Zabbix usando API
zabbix_template:
server_url: "http://{{ hostvars['zabbix_server'].ansible_fqdn }}/zabbix"
login_user: "{{ zabbix_admin_user }}"
login_password: "{{ zabbix_admin_pass }}"
template_xml: "{{ lookup('file', 'agent_extensions_5.2_custom_os_linux.xml') }}"
state: present
delegate_to: ansible_server