-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathinventory.example.yml
29 lines (23 loc) · 1.04 KB
/
inventory.example.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
---
plugin: zabbix.zabbix.zabbix_inventory
zabbix_api_url: 'http://localhost:8070'
zabbix_user: 'Admin'
zabbix_password: 'zabbix'
################
query:
selectHostGroups: ['name']
selectInterfaces: ['ip', 'dns', 'useip', 'type']
keyed_groups:
- key: zabbix_hostgroups | map(attribute='name')
separator: ''
compose:
## uses first interface from the list of all interfaces
ansible_host: 'zabbix_interfaces[0].ip if zabbix_interfaces[0].useip | bool
else zabbix_interfaces[0].dns'
### use first agent type interface from the list of all interfaes
# ansible_host: (zabbix_interfaces | selectattr('type','==','1') | first).ip if (zabbix_interfaces | selectattr('type','==','1') | first).useip | bool
# else (zabbix_interfaces | selectattr('type','==','1') | first).dns
## assign proxy group to variable from host role
host_proxy_group: 'zabbix_proxy_group_name if zabbix_proxy_group_name else omit'
## assign proxy to variable from host role
host_proxy: 'zabbix_proxy_name if zabbix_proxy_name else omit'