28 lines
773 B
Plaintext
28 lines
773 B
Plaintext
- 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
|