Ajouter Creation Host Zabbix

This commit is contained in:
l.covela 2025-11-28 16:11:36 +01:00
parent ee07da0a7f
commit 0c9690afcc
1 changed files with 27 additions and 0 deletions

27
Creation Host Zabbix Normal file
View File

@ -0,0 +1,27 @@
- name: Create Zabbix host
hosts: zabbix
gather_facts: no
vars:
ansible_network_os: community.zabbix.zabbix
ansible_connection: httpapi
ansible_httpapi_port: 443
ansible_httpapi_use_ssl: true
ansible_httpapi_validate_certs: false
ansible_zabbix_url_path: ""
tasks:
- name: Create Zabbix host
community.zabbix.zabbix_host:
host_name: "{{ inventory_hostname }}"
host_groups: "{{ zabbix_agent_groups }}"
link_templates: "{{ zabbix_agent_link_templates }}"
status: enabled
state: present
inventory_mode: automatic
interfaces:
- type: agent
main: 1
ip: "{{ ansible_private_host }}"
useip: 1
changed_when: false
tags: api