Puppet module fixes (#546)

! Make sure we add the Sysdig repo and call an update before trying to install Falco
! Remove the require in the service class to fix a dependencies loop
* Bump the version to 0.4.0

falco-CLA-1.0-contributing-entity: Coveo Solutions Inc.
falco-CLA-1.0-signed-off-by: Jean-Philippe Lachance <jplachance@coveo.com>
This commit is contained in:
Jean-Philippe Lachance 2019-03-01 13:53:37 -05:00 committed by Mark Stemm
parent 04b1b4da67
commit e486af6d09
5 changed files with 49 additions and 52 deletions

View File

@ -29,11 +29,13 @@ class falco (
$service_enable = $falco::params::service_enable, $service_enable = $falco::params::service_enable,
$service_restart = $falco::params::service_restart, $service_restart = $falco::params::service_restart,
) inherits falco::params { ) inherits falco::params {
class { 'falco::repo': }
-> class { 'falco::install': }
-> class { 'falco::config': }
~> class { 'falco::service': }
contain falco::install contain falco::install
contain falco::config contain falco::config
contain falco::service
Class['::falco::install']
-> Class['::falco::config']
~> Class['::falco::service']
} }

View File

@ -1,49 +1,7 @@
# == Class: falco::install # == Class: falco::install
class falco::install inherits falco { class falco::install inherits falco {
case $::osfamily {
'Debian': {
apt::source { 'sysdig':
location => 'http://download.draios.com/stable/deb',
release => 'stable-$(ARCH)/',
repos => '',
key => {
source => 'https://s3.amazonaws.com/download.draios.com/DRAIOS-GPG-KEY.public',
id => 'D27A72F32D867DF9300A241574490FD6EC51E8C4'
},
}
ensure_packages(["linux-headers-${::kernelrelease}"])
$dependencies = [
Apt::Source['sysdig'],
Package["linux-headers-${::kernelrelease}"],
]
}
'RedHat': {
include 'epel'
yumrepo { 'sysdig':
baseurl => 'http://download.draios.com/stable/rpm/$basearch',
descr => 'Sysdig repository by Draios',
enabled => 1,
gpgcheck => 0,
}
ensure_packages(["kernel-devel-${::kernelrelease}"])
$dependencies = [
Yumrepo['sysdig'],
Class['epel']
]
}
default: {
$dependencies = []
}
}
package { 'falco': package { 'falco':
ensure => $::falco::package_ensure, ensure => $::falco::package_ensure,
require => $dependencies,
} }
if ($::falco::file_output != undef) { if ($::falco::file_output != undef) {

View File

@ -0,0 +1,41 @@
# == Class: falco::repo
class falco::repo inherits falco {
case $::osfamily {
'Debian': {
include apt::update
Apt::Source [ 'sysdig' ]
-> Class [ 'apt::update' ]
apt::source { 'sysdig':
location => 'http://download.draios.com/stable/deb',
release => 'stable-$(ARCH)/',
repos => '',
key => {
source => 'https://s3.amazonaws.com/download.draios.com/DRAIOS-GPG-KEY.public',
id => 'D27A72F32D867DF9300A241574490FD6EC51E8C4'
},
}
ensure_packages(["linux-headers-${::kernelrelease}"])
}
'RedHat': {
include 'epel'
Yumrepo [ 'sysdig' ]
-> Class [ 'epel' ]
yumrepo { 'sysdig':
baseurl => 'http://download.draios.com/stable/rpm/$basearch',
descr => 'Sysdig repository by Draios',
enabled => 1,
gpgcheck => 0,
}
ensure_packages(["kernel-devel-${::kernelrelease}"])
}
default: {
fail("\"${module_name}\" provides no repository information for OSfamily \"${::osfamily}\"")
}
}
}

View File

@ -16,9 +16,5 @@ class falco::service inherits falco {
enable => $falco::service_enable, enable => $falco::service_enable,
hasstatus => true, hasstatus => true,
hasrestart => $falco::service_restart, hasrestart => $falco::service_restart,
require => [
Class['falco::install'],
Class['falco::config'],
]
} }
} }

View File

@ -1,6 +1,6 @@
{ {
"name": "sysdig-falco", "name": "sysdig-falco",
"version": "0.3.0", "version": "0.4.0",
"author": "sysdig", "author": "sysdig",
"summary": "Sysdig Falco: Behavioral Activity Monitoring With Container Support", "summary": "Sysdig Falco: Behavioral Activity Monitoring With Container Support",
"license": "Apache-2.0", "license": "Apache-2.0",