blob: 8a185a1b1564785f2f69c690669b647bd63bdfdc [file] [log] [blame]
Ales Komareka75a89c2014-01-19 17:50:15 +01001{%- if pillar.statsd.server.enabled %}
2
3include:
4- nodejs
5- git
6
7statsd_packages:
8 pkg:
9 - installed
10 - names:
11 - nodejs
12
13statsd_user:
14 user.present:
15 - name: statsd
16 - system: True
17 - home: /srv/statsd
18 - require:
19 git: https://github.com/etsy/statsd.git
20
21https://github.com/etsy/statsd.git:
22 git.latest:
Ales Komarekd16fbbc2014-01-19 18:04:36 +010023 - target: /srv/statsd/statsd
Ales Komareka75a89c2014-01-19 17:50:15 +010024
Ales Komarekd16fbbc2014-01-19 18:04:36 +010025{#
Ales Komareka75a89c2014-01-19 17:50:15 +010026/etc/init.d/statsd:
27 file:
28 - managed
29 - source: salt://statsd/conf/init
30 - user: root
31 - group: root
32 - mode: 744
33 - template: jinja
Ales Komarekd16fbbc2014-01-19 18:04:36 +010034#}
Ales Komareka75a89c2014-01-19 17:50:15 +010035
36statsd:
37 service.running:
Ales Komarekd16fbbc2014-01-19 18:04:36 +010038# - require:
39# - file: /etc/init.d/statsd
Ales Komareka75a89c2014-01-19 17:50:15 +010040 - watch:
41 - file: /etc/statsd/localConfig.js
42
43/etc/statsd/localConfig.js:
44 file:
45 - managed
46 - source: salt://statsd/conf/localConfig.js
47 - user: root
48 - group: root
49 - mode: 644
50 - template: jinja
51
52{#
53/etc/default/statsd:
54 file:
55 - managed
56 - source: salt://statsd/conf/default
57 - user: root
58 - group: root
59 - mode: 644
60 - template: jinja
61
62/srv/statsd/scripts:
63 file:
64 - directory
65 - user: statsd
66 - group: statsd
67 - mode: 770
68 - require:
69 - user: statsd
70 - git: https:://github.com/etsy/statsd.git
71
72/srv/statsd/scripts/start:
73 file:
74 - managed
75 - source: salt://statsd/conf/start
76 - user: root
77 - group: root
78 - mode: 744
79 - template: jinja
80 - require:
81 - file: /srv/statsd/scripts
82#}
83
84/var/log/statsd:
85 file:
86 - directory
87 - user: statsd
88 - group: statsd
89 - mode: 777
90 - require:
91 - user: statsd
92
93update-rc.d statsd defaults:
94 cmd.run:
95 - require:
96 - service: statsd
97
98{%- for backend in pillar.statsd.backends %}
99
100{%- if backend.type == 'amqp' %}
101#statsd_amqp_package:
102# npm.installed:
103# - name: statsd-amqp-backend
104
105install_package:
106 cmd.run:
107 - name: npm install statsd-amqp-backend
108
109{%- endif %}
110
111{%- endfor %}
112
113{%- endif %}