Skip to content

Instantly share code, notes, and snippets.

@gabriel403
Last active December 20, 2015 17:19
Show Gist options
  • Save gabriel403/6167702 to your computer and use it in GitHub Desktop.
Save gabriel403/6167702 to your computer and use it in GitHub Desktop.
class projects::queuesystem::butts(
$jarbase = 'https://logstash.objects.dreamhost.com/release',
$jarfile = 'logstash-1.1.13-monolithic.jar',
$jarpath = "/tmp/$jarfile",
$jdk = 'openjdk-7-jre-headless',
$installpath = '/opt/logstash'
) {
Exec { path => '/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/bin:/sbin'}
include elasticsearch
package { 'curl':
ensure => present,
}
include java::jre
exec { 'get-jarfile':
command => "/usr/bin/curl -L ${jarbase}/${jarfile} -o ${jarpath}",
creates => $jarpath,
require => Package['curl'],
}
file { $installpath:
ensure => directory,
owner => root,
group => root,
mode => '0755',
}
class { 'logstash':
jarfile => $jarpath,
provider => 'custom',
installpath => $installpath,
require => [Exec['get-jarfile'], Class['java::jre'], File[$installpath]],
}
}
Duplicate declaration: File[/opt/logstash/tmp] is already declared in file /tmp/vagrant-puppet/modules-0/logstash/manifests/package.pp at line 101; cannot redeclare at /tmp/vagrant-puppet/modules-0/logstash/manifests/config.pp:63 on node logstash-central.gomad.it
manifests/projects/queuesystem/logstash_setup
class projects::queuesystem::logstash-setup(
$jarbase = 'https://logstash.objects.dreamhost.com/release',
$jarfile = 'logstash-1.1.13-monolithic.jar',
$jarpath = "/tmp/$jarfile",
$jdk = 'openjdk-7-jre-headless',
$installpath = '/opt/logstash'
) {
Exec { path => '/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/bin:/sbin'}
include elasticsearch
package { 'curl':
ensure => present,
}
include java::jre
exec { 'get-jarfile':
command => "/usr/bin/curl -L ${jarbase}/${jarfile} -o ${jarpath}",
creates => $jarpath,
require => Package['curl'],
}
file { $installpath:
ensure => directory,
owner => root,
group => root,
mode => '0755',
}
class { 'logstash':
jarfile => $jarpath,
provider => 'custom',
installpath => $installpath,
require => [Exec['get-jarfile'], Class['java::jre'], File[$installpath]],
}
}
class { 'projects::queuesystem::logstashsetup': }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment