[DEL] Removes templates tasks

This commit is contained in:
Jorge Enrique Gómez Gómez 2024-10-24 14:11:48 -05:00
parent b150f40062
commit a7c1017d74
2 changed files with 0 additions and 156 deletions

View File

@ -1,27 +0,0 @@
---
# 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

View File

@ -1,129 +0,0 @@
# github https://git.zabbix.com/projects/ZBX/repos/zabbix/browse/templates?at=refs%2Fheads%2Frelease%2F6.4
---
- name: Crear la carpeta de destino si no existe
file:
path: /usr/share/agofer/repositorio_zabbix
state: directory
mode: '0755'
#- name: Clonar el repositorio de GitHub con profundidad 1
# command: git clone --depth=1 https://git.zabbix.com/scm/zbx/zabbix.git /home/sistemas/repositorio_zabbix
# args:
# creates: /home/sistemas/repositorio_zabbix/.git
#
#- name: Crear la carpeta de destino en el directorio del rol si no existe
# file:
# path: "{{ role_path }}/files"
# state: directory
# mode: '0755'
#
#- name: Mover el contenido del repositorio al directorio del rol
# copy:
# src: "{{ item }}"
# dest: "{{ role_path }}/files/"
# remote_src: yes
# with_fileglob:
# - "/home/sistemas/repositorio_zabbix/*"
#
#- name: Limpiar directorios temporales
# file:
# path: /home/sistemas/repositorio_zabbix
# state: absent
#- name: Import Zabbix templates from JSON
# # set task level variables as we change ansible_connection plugin here
# vars:
# ansible_network_os: community.zabbix.zabbix
# ansible_connection: httpapi
# ansible_httpapi_port: 80
# ansible_httpapi_use_ssl: false
# ansible_httpapi_validate_certs: false
# ansible_zabbix_url_path: ''
# become: False
# community.zabbix.zabbix_template:
# template_json: "{{ lookup('file', 'zabbix_apache2.json') }}"
# state: present
#- name: Import Zabbix templates from XML
# set task level variables as we change ansible_connection plugin here
# vars:
# ansible_network_os: community.zabbix.zabbix
# ansible_connection: httpapi
# ansible_httpapi_port: 80
# ansible_httpapi_use_ssl: false
# ansible_httpapi_validate_certs: false
# ansible_zabbix_url_path: ''
# become: False
# zabbix_template:
# template_xml: "{{ lookup('file', 'zabbix_apache2.xml') }}"
# state: present
#- name: Import Zabbix template from Ansible dict variable
# set task level variables as we change ansible_connection plugin here
# vars:
# ansible_network_os: community.zabbix.zabbix
# ansible_connection: httpapi
# ansible_httpapi_port: 80
# ansible_httpapi_use_ssl: false
# ansible_httpapi_validate_certs: false
# ansible_zabbix_url_path: ''
# become: False
# zabbix_template:
# template_json:
# zabbix_export:
# version: "3.2"
# templates:
# - name: Template for Testing
# description: "Testing template import"
# template: Test Template
# groups:
# - name: Templates
# state: present
#
#- name: Configure macros on the existing Zabbix template
# # set task level variables as we change ansible_connection plugin here
# vars:
# ansible_network_os: community.zabbix.zabbix
# ansible_connection: httpapi
# ansible_httpapi_port: 80
# ansible_httpapi_use_ssl: false
# ansible_httpapi_validate_certs: false
# ansible_zabbix_url_path: ''
# become: False
# zabbix_template:
# template_name: Template
# macros:
# - macro: "{$TEST_MACRO}"
# value: "Example"
# state: present
#
#- name: Add tags to the existing Zabbix template
# set task level variables as we change ansible_connection plugin here
# vars:
# ansible_network_os: community.zabbix.zabbix
# ansible_connection: httpapi
# ansible_httpapi_port: 80
# ansible_httpapi_use_ssl: false
# ansible_httpapi_validate_certs: false
# ansible_zabbix_url_path: ''
# become: False
# zabbix_template:
# template_name: Template
# tags:
# - tag: class
# value: application
# state: present
#
#- name: Delete Zabbix template
# set task level variables as we change ansible_connection plugin here
# vars:
# ansible_network_os: community.zabbix.zabbix
# ansible_connection: httpapi
# ansible_httpapi_port: 80
# ansible_httpapi_use_ssl: false
# ansible_httpapi_validate_certs: false
# ansible_zabbix_url_path: ''
# become: False
# zabbix_template:
# template_name: Template
# state: absent