-
Notifications
You must be signed in to change notification settings - Fork 0
/
test_zabbix_screen.yml
56 lines (52 loc) · 1.69 KB
/
test_zabbix_screen.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
49
50
51
52
53
54
55
56
- hosts: all
name: Run tests with zabbix_host and zabbix_screen modules
vars:
zabbix_screens:
- name: Linuxes
group: Linux servers
graphs_in_row: 1
graph_names:
- CPU utilization
- Memory usage
graphsrow: 6
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
- name: create zabbix screen
zabbix_screen:
server_url: '{{ zbx_server_url }}'
login_user: '{{ zbx_user }}'
login_password: '{{ zbx_password }}'
validate_certs: '{{ zbx_validate_certs }}'
screens:
- screen_name: "{{ item.name }}"
host_group: "{{ item.group }}"
state: present
graph_names: "{{ item.graph_names }}"
graph_width: 500
graph_height: 100
graphs_in_row: "{{ item.graphs_in_row | int }}"
with_items: "{{ zabbix_screens }}"
delegate_to: localhost