Ales Komarek | a75a89c | 2014-01-19 17:50:15 +0100 | [diff] [blame] | 1 | {%- if pillar.statsd.server.enabled %} |
2 | |||||
3 | include: | ||||
4 | - nodejs | ||||
5 | - git | ||||
6 | |||||
Ales Komarek | a75a89c | 2014-01-19 17:50:15 +0100 | [diff] [blame] | 7 | statsd_user: |
8 | user.present: | ||||
9 | - name: statsd | ||||
10 | - system: True | ||||
11 | - home: /srv/statsd | ||||
12 | - require: | ||||
Michael Kutý | b1bb292 | 2014-02-10 21:44:31 +0100 | [diff] [blame] | 13 | - git: https://github.com/etsy/statsd.git |
Ales Komarek | ceefc48 | 2014-04-10 10:13:23 +0200 | [diff] [blame^] | 14 | - pkg: nodejs_packages |
Ales Komarek | a75a89c | 2014-01-19 17:50:15 +0100 | [diff] [blame] | 15 | |
16 | https://github.com/etsy/statsd.git: | ||||
17 | git.latest: | ||||
Ales Komarek | d16fbbc | 2014-01-19 18:04:36 +0100 | [diff] [blame] | 18 | - target: /srv/statsd/statsd |
Ales Komarek | ceefc48 | 2014-04-10 10:13:23 +0200 | [diff] [blame^] | 19 | - require: |
20 | - pkg: git_packages | ||||
Ales Komarek | a75a89c | 2014-01-19 17:50:15 +0100 | [diff] [blame] | 21 | |
Ales Komarek | ceefc48 | 2014-04-10 10:13:23 +0200 | [diff] [blame^] | 22 | {% if grains.os_family == "Debian" %} |
Michael Kutý | b1bb292 | 2014-02-10 21:44:31 +0100 | [diff] [blame] | 23 | |
Ales Komarek | a75a89c | 2014-01-19 17:50:15 +0100 | [diff] [blame] | 24 | /etc/init.d/statsd: |
Ales Komarek | ceefc48 | 2014-04-10 10:13:23 +0200 | [diff] [blame^] | 25 | file.managed: |
Ales Komarek | a75a89c | 2014-01-19 17:50:15 +0100 | [diff] [blame] | 26 | - source: salt://statsd/conf/init |
27 | - user: root | ||||
28 | - group: root | ||||
29 | - mode: 744 | ||||
30 | - template: jinja | ||||
Ales Komarek | ceefc48 | 2014-04-10 10:13:23 +0200 | [diff] [blame^] | 31 | |
Ales Komarek | a75a89c | 2014-01-19 17:50:15 +0100 | [diff] [blame] | 32 | statsd: |
33 | service.running: | ||||
Michael Kutý | b1bb292 | 2014-02-10 21:44:31 +0100 | [diff] [blame] | 34 | - enable: true |
35 | - require: | ||||
36 | - file: /etc/init.d/statsd | ||||
Ales Komarek | a75a89c | 2014-01-19 17:50:15 +0100 | [diff] [blame] | 37 | - watch: |
38 | - file: /etc/statsd/localConfig.js | ||||
Ales Komarek | ceefc48 | 2014-04-10 10:13:23 +0200 | [diff] [blame^] | 39 | |
40 | {% endif %} | ||||
41 | |||||
Ales Komarek | a75a89c | 2014-01-19 17:50:15 +0100 | [diff] [blame] | 42 | /etc/statsd/localConfig.js: |
Ales Komarek | ceefc48 | 2014-04-10 10:13:23 +0200 | [diff] [blame^] | 43 | file.managed: |
Ales Komarek | a75a89c | 2014-01-19 17:50:15 +0100 | [diff] [blame] | 44 | - source: salt://statsd/conf/localConfig.js |
45 | - user: root | ||||
46 | - group: root | ||||
47 | - mode: 644 | ||||
48 | - template: jinja | ||||
49 | |||||
Ales Komarek | a75a89c | 2014-01-19 17:50:15 +0100 | [diff] [blame] | 50 | /var/log/statsd: |
Ales Komarek | ceefc48 | 2014-04-10 10:13:23 +0200 | [diff] [blame^] | 51 | file.directory: |
Ales Komarek | a75a89c | 2014-01-19 17:50:15 +0100 | [diff] [blame] | 52 | - user: statsd |
53 | - group: statsd | ||||
54 | - mode: 777 | ||||
55 | - require: | ||||
56 | - user: statsd | ||||
57 | |||||
Michael Kutý | b1bb292 | 2014-02-10 21:44:31 +0100 | [diff] [blame] | 58 | {%- for backend in pillar.statsd.server.backends %} |
Ales Komarek | a75a89c | 2014-01-19 17:50:15 +0100 | [diff] [blame] | 59 | |
60 | {%- if backend.type == 'amqp' %} | ||||
Ales Komarek | ceefc48 | 2014-04-10 10:13:23 +0200 | [diff] [blame^] | 61 | |
Ales Komarek | a75a89c | 2014-01-19 17:50:15 +0100 | [diff] [blame] | 62 | #statsd_amqp_package: |
63 | # npm.installed: | ||||
64 | # - name: statsd-amqp-backend | ||||
65 | |||||
66 | install_package: | ||||
67 | cmd.run: | ||||
68 | - name: npm install statsd-amqp-backend | ||||
69 | |||||
70 | {%- endif %} | ||||
71 | |||||
72 | {%- endfor %} | ||||
73 | |||||
74 | {%- endif %} |