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: |
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 | |
Ales Komarek | d16fbbc | 2014-01-19 18:04:36 +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 |
Ales Komarek | d16fbbc | 2014-01-19 18:04:36 +0100 | [diff] [blame^] | 34 | #} |
Ales Komarek | a75a89c | 2014-01-19 17:50:15 +0100 | [diff] [blame] | 35 | |
| 36 | statsd: |
| 37 | service.running: |
Ales Komarek | d16fbbc | 2014-01-19 18:04:36 +0100 | [diff] [blame^] | 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 |
| 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 | |
| 93 | update-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 | |
| 105 | install_package: |
| 106 | cmd.run: |
| 107 | - name: npm install statsd-amqp-backend |
| 108 | |
| 109 | {%- endif %} |
| 110 | |
| 111 | {%- endfor %} |
| 112 | |
| 113 | {%- endif %} |