summaryrefslogtreecommitdiffstats
path: root/playbooks/adhoc/zabbix_setup/setup_zabbix.yml
blob: 286f699e565c45ca4ae140dacde1c270dfb22bc0 (plain)
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
---
- hosts: localhost
  gather_facts: no
  vars_files:
  - vars/template_heartbeat.yml
  - vars/template_os_linux.yml
  vars:
    g_zserver: http://oso-rhel7-zabbix-web.kwoodsontest2.opstest.online.openshift.com/zabbix/api_jsonrpc.php
    g_zuser: Admin
    g_zpassword: zabbix
  roles:
  - ../roles/os_zabbix
  post_tasks:
  - zbxapi:
      server: "{{ g_zserver }}"
      user: "{{ g_zuser }}"
      password: "{{ g_zpassword }}"
      zbx_class: Template
      state: list
      params:
        output: extend
    register: templates

  - debug: var=templates

  - name: Include Template
    include: create_template.yml
    vars:
      ctp_template: "{{ g_template_heartbeat }}"
      ctp_zserver: "{{ g_zserver }}"
      ctp_zuser: "{{ g_zuser }}"
      ctp_zpassword: "{{ g_zpassword }}"

  - name: Include Template
    include: create_template.yml
    vars:
      ctp_template: "{{ g_template_os_linux }}"
      ctp_zserver: "{{ g_zserver }}"
      ctp_zuser: "{{ g_zuser }}"
      ctp_zpassword: "{{ g_zpassword }}"