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: |
| 19 | git: https://github.com/etsy/statsd.git |
| 20 | |
| 21 | https://github.com/etsy/statsd.git: |
| 22 | git.latest: |
| 23 | - target: /srv/statsd |
| 24 | |
| 25 | /etc/init.d/statsd: |
| 26 | file: |
| 27 | - managed |
| 28 | - source: salt://statsd/conf/init |
| 29 | - user: root |
| 30 | - group: root |
| 31 | - mode: 744 |
| 32 | - template: jinja |
| 33 | |
| 34 | statsd: |
| 35 | service.running: |
| 36 | - require: |
| 37 | - file: /etc/init.d/statsd |
| 38 | - watch: |
| 39 | - file: /etc/statsd/localConfig.js |
| 40 | |
| 41 | /etc/statsd/localConfig.js: |
| 42 | file: |
| 43 | - managed |
| 44 | - source: salt://statsd/conf/localConfig.js |
| 45 | - user: root |
| 46 | - group: root |
| 47 | - mode: 644 |
| 48 | - template: jinja |
| 49 | |
| 50 | {# |
| 51 | /etc/default/statsd: |
| 52 | file: |
| 53 | - managed |
| 54 | - source: salt://statsd/conf/default |
| 55 | - user: root |
| 56 | - group: root |
| 57 | - mode: 644 |
| 58 | - template: jinja |
| 59 | |
| 60 | /srv/statsd/scripts: |
| 61 | file: |
| 62 | - directory |
| 63 | - user: statsd |
| 64 | - group: statsd |
| 65 | - mode: 770 |
| 66 | - require: |
| 67 | - user: statsd |
| 68 | - git: https:://github.com/etsy/statsd.git |
| 69 | |
| 70 | /srv/statsd/scripts/start: |
| 71 | file: |
| 72 | - managed |
| 73 | - source: salt://statsd/conf/start |
| 74 | - user: root |
| 75 | - group: root |
| 76 | - mode: 744 |
| 77 | - template: jinja |
| 78 | - require: |
| 79 | - file: /srv/statsd/scripts |
| 80 | #} |
| 81 | |
| 82 | /var/log/statsd: |
| 83 | file: |
| 84 | - directory |
| 85 | - user: statsd |
| 86 | - group: statsd |
| 87 | - mode: 777 |
| 88 | - require: |
| 89 | - user: statsd |
| 90 | |
| 91 | update-rc.d statsd defaults: |
| 92 | cmd.run: |
| 93 | - require: |
| 94 | - service: statsd |
| 95 | |
| 96 | {%- for backend in pillar.statsd.backends %} |
| 97 | |
| 98 | {%- if backend.type == 'amqp' %} |
| 99 | #statsd_amqp_package: |
| 100 | # npm.installed: |
| 101 | # - name: statsd-amqp-backend |
| 102 | |
| 103 | install_package: |
| 104 | cmd.run: |
| 105 | - name: npm install statsd-amqp-backend |
| 106 | |
| 107 | {%- endif %} |
| 108 | |
| 109 | {%- endfor %} |
| 110 | |
| 111 | {%- endif %} |