Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Christophe Vanlancker <carroarmato0@inuits.eu>
- Loading branch information
1 parent
248fad4
commit 844eb16
Showing
12 changed files
with
194 additions
and
107 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,32 @@ | ||
# class skydive | ||
class skydive ( | ||
$manage_repo = $::skydive::params::manage_repo, | ||
$host_id = $::skydive::params::host_id, | ||
$logging = $::skydive::params::logging, | ||
$graph = $::skydive::params::graph, | ||
$cache = $::skydive::params::cache, | ||
$analyzers = $::skydive::params::analyzers, | ||
$etcd = $::skydive::params::etcd, | ||
$ws_pong_timeout = $::skydive::params::ws_pong_timeout, | ||
$ws_bulk_maxmsg = $::skydive::params::ws_bulk_maxmsg, | ||
$ws_bulk_maxdelay = $::skydive::params::ws_bulk_maxdelay, | ||
$extra_config = {}, | ||
$host_id = $::skydive::params::host_id, | ||
$logging = $::skydive::params::logging, | ||
$graph = $::skydive::params::graph, | ||
$cache = $::skydive::params::cache, | ||
$analyzers = $::skydive::params::analyzers, | ||
$etcd = $::skydive::params::etcd, | ||
$version = $::skydive::params::version, | ||
$web_checksum = $::skydive::params::web_checksum, | ||
$manage_repo = $::skydive::params::manage_repo, | ||
$installation_type = $::skydive::params::installation_type, | ||
$ws_pong_timeout = $::skydive::params::ws_pong_timeout, | ||
$ws_bulk_maxmsg = $::skydive::params::ws_bulk_maxmsg, | ||
$ws_bulk_maxdelay = $::skydive::params::ws_bulk_maxdelay, | ||
$extra_config = {}, | ||
) inherits ::skydive::params { | ||
|
||
contain ::skydive::install::common | ||
# Some validations | ||
## Validate allowed installation_type | ||
if ! ($installation_type in [ 'web', 'package' ]) { | ||
fail("Installation type: ${installation_type} invalid. Allowed installation types are: web, package") | ||
} | ||
# When doing a web install, the version must be specified, 'present' is not valid | ||
if $installation_type == 'web' and $version in ['present', 'latest'] { | ||
fail("Installation type ${installation_type} requires and actual version string equivalent to that on github. Example: 0.13.0") | ||
} | ||
|
||
contain ::skydive::install | ||
contain ::skydive::config | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# class skydive::common::install | ||
class skydive::install { | ||
|
||
case $::skydive::installation_type { | ||
'package': { | ||
contain ::skydive::install::package | ||
} | ||
'web': { | ||
contain ::skydive::install::web | ||
} | ||
default: { | ||
fail("Well this is awkward, there's an issue with the validation of this module") | ||
} | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
class skydive::install::package { | ||
|
||
if $::skydive::manage_repo { | ||
case $::osfamily { | ||
'RedHat': { | ||
yumrepo { 'opstools7-sensu-common-release': | ||
baseurl => 'https://cbs.centos.org/repos/opstools7-sensu-common-release/$basearch/os/', | ||
descr => 'Community Build Service', | ||
enabled => '1', | ||
gpgcheck => '0', | ||
} ~> | ||
exec { 'yum-clean-expire-cache': | ||
command => '/usr/bin/yum clean expire-cache', | ||
refreshonly => true, | ||
} | ||
} | ||
default: { | ||
fail("Module ${module_name} is not supported on osfamily '${::osfamily}'") | ||
} | ||
} | ||
} | ||
|
||
package { 'skydive': | ||
ensure => $::skydive::version, | ||
} | ||
|
||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
class skydive::install::web { | ||
|
||
archive { '/usr/bin/skydive': | ||
source => "https://github.com/skydive-project/skydive/releases/download/v${::skydive::version}/skydive", | ||
extract => false, | ||
cleanup => false, | ||
checksum => $::skydive::web_checksum, | ||
checksum_type => 'sha1', | ||
}-> | ||
# Needed to make the binary executable | ||
file { '/usr/bin/skydive': | ||
ensure => file, | ||
mode => '0550', | ||
} | ||
|
||
$skydive_packages = [ | ||
'skydive', | ||
'skydive-agent', | ||
'skydive-analyzer', | ||
] | ||
|
||
# Ensure Skydive packages are removed if already present | ||
# Handy when switching over from a previous package install | ||
package { $skydive_packages: | ||
ensure => absent, | ||
before => Archive['/usr/bin/skydive'], | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters