View difference between Paste ID: 3bZ4v9s1 and VJmwg4Af
SHOW: | | - or go back to the newest paste.
1
include:
2
  - zabbix-release
3
    
4
zabbix-agent:
5
  pkg:
6
    - installed
7
    - require: 
8
      - pkg: zabbix-release
9
  service:
10
    - running
11
    - watch:
12
      - file: /etc/zabbix/zabbix_agentd.conf
13
14
zabbix_agentd.conf:
15
  file.managed:
16
    - name: /etc/zabbix/zabbix_agentd.conf
17
    - source: salt://zabbix-agent/zabbix_agentd.conf
18
    - context:
19
      zabbix_server_ip: {{grains.master}}
20-
      zabbix_proxy_ip: {{ salt["mine.get"]("test-mon-jcltest", "network.ip_addrs").get}
20+
      zabbix_proxy_ip: {{ salt["mine.get"]("test-mon-jcltest", "network.ip_addrs").get("test-mon-jcltest")[0] }} 
21
      hostname_tag: {{grains.id}}
22
    - user: root
23
    - group: root
24
    - mode: 644
25
    - template: jinja
26
27
pyzabbix:
28
  pip:
29
    - installed
30
    - require:
31
      - pkg: python-pip
32
33
zabbix_register:
34
  file.managed:
35
    - name: /root/depot/zabbix_register
36
    - source: salt://zabbix-agent/zabbix_register
37
    - template: jinja
38
    - context:
39
      host_ip: {{ grains.ec2_private-ip }}
40
      host_tag: {{ grains.id }}
41
      zabbix_host_group: {{ pillar["zabbix_host_group"] }}
42
      zabbix_passwd: {{ pillar["zabbix_api_passwd"] }}
43
      zabbix_proxy_id: {{ pillar["zabbix_proxy_id"] }}
44
      zabbix_url: {{ pillar["zabbix_url"] }}
45
      zabbix_user: api
46
    - require:
47
      - pkg: zabbix-agent
48
      - file: /etc/zabbix/zabbix_agentd.conf
49
    - user: root
50
    - group: root
51
    - mode: 755
52
  cmd.wait:
53
    - cwd: /tmp
54
    - name: /root/depot/zabbix_register
55
    - watch:
56
      - file: /root/depot/zabbix_register
57
    - require:
58
      - pip: pyzabbix
59
      - pkg: zabbix-agent