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 | |
| 7 | statsd_packages: |
| 8 | pkg: |
| 9 | - installed |
| 10 | - names: |
| 11 | - nodejs |
| 12 | |
| 13 | statsd_user: |
| 14 | user.present: |
| 15 | - name: statsd |
| 16 | - system: True |
| 17 | - home: /srv/statsd |
| 18 | - require: |
Michael Kutý | b1bb292 | 2014-02-10 21:44:31 +0100 | [diff] [blame^] | 19 | - git: https://github.com/etsy/statsd.git |
Ales Komarek | a75a89c | 2014-01-19 17:50:15 +0100 | [diff] [blame] | 20 | |
| 21 | https://github.com/etsy/statsd.git: |
| 22 | git.latest: |
Ales Komarek | d16fbbc | 2014-01-19 18:04:36 +0100 | [diff] [blame] | 23 | - target: /srv/statsd/statsd |
Ales Komarek | a75a89c | 2014-01-19 17:50:15 +0100 | [diff] [blame] | 24 | |
Michael Kutý | b1bb292 | 2014-02-10 21:44:31 +0100 | [diff] [blame^] | 25 | |
Ales Komarek | a75a89c | 2014-01-19 17:50:15 +0100 | [diff] [blame] | 26 | /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ý | b1bb292 | 2014-02-10 21:44:31 +0100 | [diff] [blame^] | 34 | {# |
Ales Komarek | a75a89c | 2014-01-19 17:50:15 +0100 | [diff] [blame] | 35 | statsd: |
| 36 | service.running: |
Michael Kutý | b1bb292 | 2014-02-10 21:44:31 +0100 | [diff] [blame^] | 37 | - enable: true |
| 38 | - require: |
| 39 | - file: /etc/init.d/statsd |
Ales Komarek | a75a89c | 2014-01-19 17:50:15 +0100 | [diff] [blame] | 40 | - watch: |
| 41 | - file: /etc/statsd/localConfig.js |
Michael Kutý | b1bb292 | 2014-02-10 21:44:31 +0100 | [diff] [blame^] | 42 | #} |
Ales Komarek | a75a89c | 2014-01-19 17:50:15 +0100 | [diff] [blame] | 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 | |
Ales Komarek | a75a89c | 2014-01-19 17:50:15 +0100 | [diff] [blame] | 52 | /var/log/statsd: |
| 53 | file: |
| 54 | - directory |
| 55 | - user: statsd |
| 56 | - group: statsd |
| 57 | - mode: 777 |
| 58 | - require: |
| 59 | - user: statsd |
| 60 | |
Michael Kutý | b1bb292 | 2014-02-10 21:44:31 +0100 | [diff] [blame^] | 61 | {%- for backend in pillar.statsd.server.backends %} |
Ales Komarek | a75a89c | 2014-01-19 17:50:15 +0100 | [diff] [blame] | 62 | |
| 63 | {%- if backend.type == 'amqp' %} |
| 64 | #statsd_amqp_package: |
| 65 | # npm.installed: |
| 66 | # - name: statsd-amqp-backend |
| 67 | |
| 68 | install_package: |
| 69 | cmd.run: |
| 70 | - name: npm install statsd-amqp-backend |
| 71 | |
| 72 | {%- endif %} |
| 73 | |
| 74 | {%- endfor %} |
| 75 | |
| 76 | {%- endif %} |