|
1 | 1 | # == Class: statsd::backends |
2 | 2 | class statsd::backends { |
3 | 3 | $backends = join($statsd::backends, ',') |
| 4 | + $node_base = "${statsd::node_module_dir}/statsd/node_modules" |
4 | 5 |
|
5 | 6 | # Make sure $statsd::influxdb_host is set |
6 | 7 | if $backends =~ /influxdb/ { |
7 | 8 | exec { 'install-statsd-influxdb-backend': |
8 | 9 | command => '/usr/bin/npm install --save statsd-influxdb-backend', |
9 | 10 | cwd => "${statsd::node_module_dir}/statsd", |
10 | | - unless => "/usr/bin/test -d ${statsd::node_module_dir}/statsd/node_modules/statsd-influxdb-backend", |
| 11 | + unless => "/usr/bin/test -d ${node_base}/statsd-influxdb-backend", |
11 | 12 | require => Package['statsd'], |
12 | 13 | } |
13 | 14 | } |
|
17 | 18 | exec { 'install-statsd-librato-backend': |
18 | 19 | command => '/usr/bin/npm install --save statsd-librato-backend', |
19 | 20 | cwd => "${statsd::node_module_dir}/statsd", |
20 | | - unless => "/usr/bin/test -d ${statsd::node_module_dir}/statsd/node_modules/statsd-librato-backend", |
| 21 | + unless => "/usr/bin/test -d ${node_base}/statsd-librato-backend", |
21 | 22 | require => Package['statsd'], |
22 | 23 | } |
23 | 24 | } |
|
27 | 28 | exec { 'install-statsd-stackdriver-backend': |
28 | 29 | command => '/usr/bin/npm install --save stackdriver-statsd-backend', |
29 | 30 | cwd => "${statsd::node_module_dir}/statsd", |
30 | | - unless => "/usr/bin/test -d ${statsd::node_module_dir}/statsd/node_modules/stackdriver-statsd-backend", |
| 31 | + unless => "/usr/bin/test -d ${node_base}/stackdriver-statsd-backend", |
31 | 32 | require => Package['statsd'], |
32 | 33 | } |
33 | 34 | } |
|
0 commit comments