forked from jdowning/puppet-influxdb
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.pp
More file actions
42 lines (40 loc) · 1.27 KB
/
install.pp
File metadata and controls
42 lines (40 loc) · 1.27 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# == Class: influxdb::install
# DO NO CALL DIRECTLY
class influxdb::install {
package { 'influxdb':
ensure => $influxdb::ensure,
}
if !$influxdb::install_from_repository {
# package source and provider
case $::osfamily {
'Debian': {
$package_provider = 'dpkg'
$package_source = $::architecture ? {
/64/ => "http://s3.amazonaws.com/influxdb/influxdb_${influxdb::version}_amd64.deb",
default => "http://s3.amazonaws.com/influxdb/influxdb_${influxdb::version}_i386.deb",
}
}
'RedHat', 'Amazon': {
$package_provider = 'rpm'
$package_source = $::architecture ? {
/64/ => "http://s3.amazonaws.com/influxdb/influxdb-${influxdb::version}-1.x86_64.rpm",
default => "http://s3.amazonaws.com/influxdb/influxdb-${influxdb::version}-1.i686.rpm",
}
}
default: {
fail('Only supports Debian or RedHat $::osfamily')
}
}
# get the package
staging::file { 'influxdb-package':
source => $package_source,
timeout => 0,
}
# install the package
Package['influxdb']{
provider => $package_provider,
source => '/opt/staging/influxdb/influxdb-package',
require => Staging::File['influxdb-package'],
}
}
}