Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch to nanliu-staging from wget #1

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Modulefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ project_page 'https://github.com/WhatsARanjit/puppet-kibana'
dependency 'abrader/puppet-logstash-reporter'
dependency 'puppetlabs/apache', '>= 1.0.1'
dependency 'elasticsearch/logstash', '>= 0.5.1'
#dependency 'nanliu/staging', '>= 0.4.1'
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ Default configuration where Kibana runs on the Logstash host.

include kibana

NOTE: This requires the fork of nanliu-staging available at:

https://github.com/mhaskel/puppet-staging/tree/strip

## Kibana parameters

* `install_dir`<br />
Expand Down
28 changes: 17 additions & 11 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,36 @@
$install_dir = $apache::docroot,
$logstash_host = $::ipaddress,
$logstash_port = '9200',
$tarball = 'kibana-3.1.0'
$tarball = 'kibana-3.1.0',
$staging_dir = '/var/staging',
$staging_owner = 'pe-puppet',
$staging_group = 'pe-puppet'
) {
$source_url = "https://download.elasticsearch.org/kibana/kibana/${tarball}.tar.gz"
Exec {
path => $::path,
cwd => $install_dir,
}
exec { 'wget-kibana':
command => "wget --no-check-certificate $source_url",
creates => "${install_dir}/${tarball}.tar.gz",
refreshonly => false,
notify => Exec['untar-kibana'],
class { 'staging':
path => $staging_dir,
owner => $staging_owner,
group => $staging_group,
}
exec { 'untar-kibana':
command => "tar zxpf ${tarball}.tar.gz --strip-components=1",
creates => "${install_dir}/README.md",
refreshonly => true,
staging::file { "${tarball}.tar.gz":
source => $source_url,
}
staging::extract { "${tarball}.tar.gz":
target => $install_dir,
strip => '1',
creates => "${install_dir}/${tarball}",
require => Staging::File["${tarball}.tar.gz"],
}
file { "${install_dir}/config.js":
ensure => file,
owner => 'root',
group => $::apache::params::root_group,
mode => '0644',
content => template("${module_name}/config.js.erb"),
require => Exec['untar-kibana'],
require => Staging::Extract["${tarball}.tar.gz"]
}
}