-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest_zabbix_map.yml
48 lines (46 loc) · 1.5 KB
/
test_zabbix_map.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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
- hosts: all
tasks:
- block:
- name: Update host with SNMP interface and new template
zabbix_host:
server_url: '{{ zbx_server_url }}'
login_user: '{{ zbx_user }}'
login_password: '{{ zbx_password }}'
host_name: '{{ inventory_hostname }}'
visible_name: '{{ inventory_hostname }}'
validate_certs: '{{ zbx_validate_certs }}'
force: no
host_groups:
- Linux servers
link_templates:
- '{{ zbx_icmp_template }}'
status: enabled
state: present
inventory_mode: disabled
interfaces:
- type: 1
main: 1
useip: 0
ip: "{{ ansible_default_ipv4.address }}"
dns: "{{ inventory_hostname }}"
port: 10050
- type: 2
main: 1
useip: 1
ip: '{{ ansible_default_ipv4.address }}'
dns: "{{ inventory_hostname }}"
port: 161
- name: create zabbix map
zabbix_map:
server_url: '{{ zbx_server_url }}'
login_user: '{{ zbx_user }}'
login_password: '{{ zbx_password }}'
validate_certs: '{{ zbx_validate_certs }}'
name: ansible test
state: present
data: "{{ lookup('template', 'files/map.j2') }}"
default_image: Server_(64)
expand_problem: no
highlight: no
label_type: label
delegate_to: localhost