blob: bac494b574f86be6ab7fc1be31aea925037dbea6 [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:
Michael Kutýb1bb2922014-02-10 21:44:31 +010019 - git: https://github.com/etsy/statsd.git
Ales Komareka75a89c2014-01-19 17:50:15 +010020
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
Michael Kutýb1bb2922014-02-10 21:44:31 +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
Michael Kutýb1bb2922014-02-10 21:44:31 +010034{#
Ales Komareka75a89c2014-01-19 17:50:15 +010035statsd:
36 service.running:
Michael Kutýb1bb2922014-02-10 21:44:31 +010037 - enable: true
38 - require:
39 - file: /etc/init.d/statsd
Ales Komareka75a89c2014-01-19 17:50:15 +010040 - watch:
41 - file: /etc/statsd/localConfig.js
Michael Kutýb1bb2922014-02-10 21:44:31 +010042#}
Ales Komareka75a89c2014-01-19 17:50:15 +010043/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
Ales Komareka75a89c2014-01-19 17:50:15 +010052/var/log/statsd:
53 file:
54 - directory
55 - user: statsd
56 - group: statsd
57 - mode: 777
58 - require:
59 - user: statsd
60
Michael Kutýb1bb2922014-02-10 21:44:31 +010061{%- for backend in pillar.statsd.server.backends %}
Ales Komareka75a89c2014-01-19 17:50:15 +010062
63{%- if backend.type == 'amqp' %}
64#statsd_amqp_package:
65# npm.installed:
66# - name: statsd-amqp-backend
67
68install_package:
69 cmd.run:
70 - name: npm install statsd-amqp-backend
71
72{%- endif %}
73
74{%- endfor %}
75
76{%- endif %}