Skip to content

Commit

Permalink
1.1 release
Browse files Browse the repository at this point in the history
add symlinks to /usr/sbin

make puppet lint happy
  • Loading branch information
tedwardia committed Dec 13, 2016
1 parent 288faca commit c7a84fd
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 8 deletions.
15 changes: 9 additions & 6 deletions manifests/config.pp
Original file line number Diff line number Diff line change
Expand Up @@ -17,34 +17,37 @@
$merged_config = $default_config + $config
}

$merged_conf = { 'config' => $merged_config }
file { '/usr/local/maldetect/conf.maldet':
ensure => present,
mode => '0644',
owner => root,
group => root,
content => epp('maldet/conf.maldet.epp', { 'config' => $merged_config }),
content => epp('maldet/conf.maldet.epp', $merged_conf),
}

# Allow config overrides for daily cron
$cron_conf = { 'config' => $cron_config }
if versioncmp($maldet::version, '1.5') >= 0 {
file { '/usr/local/maldetect/cron/conf.maldet.cron':
ensure => present,
mode => '0644',
owner => root,
group => root,
content => epp('maldet/conf.maldet.epp', { 'config' => $cron_config }),
content => epp('maldet/conf.maldet.epp', $cron_conf),
}
}

if $facts['service_provider'] == 'redhat' {
# MONITOR_MODE is commented out by default and can prevent maldet service
# from starting when using the init based startup script.
# MONITOR_MODE is commented out by default and can prevent maldet service
# from starting when using the init based startup script.
$monitor_mode = { 'monitor_mode' => $merged_config['default_monitor_mode'] }
if $::facts['service_provider'] == 'redhat' {
file { '/etc/sysconfig/maldet':
ensure => present,
mode => '0644',
owner => root,
group => root,
content => inline_epp('MONITOR_MODE="<%= $monitor_mode %>"', {'monitor_mode' => $merged_config['default_monitor_mode']}),
content => inline_epp('MONITOR_MODE="<%= $monitor_mode %>"', $monitor_mode),
}
}

Expand Down
7 changes: 6 additions & 1 deletion manifests/install.pp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,12 @@
# inotify-tools is used by the maldet service
ensure_packages(['psmisc', 'wget', 'cpulimit', 'inotify-tools', 'perl'])

if $facts['os']['family'] == 'Redhat' {
file { ['/usr/sbin/maldet', '/usr/sbin/lmd']:
ensure => link,
target => '/usr/local/maldetect/maldet',
}

if $::facts['os']['family'] == 'Redhat' {
include ::epel
Class['epel'] ->
Package['psmisc'] ->
Expand Down
2 changes: 1 addition & 1 deletion metadata.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "nexcess-maldet",
"version": "1.0.0",
"version": "1.1.0",
"author": "nexcess",
"summary": "Install and configure Linux Malware Detect",
"license": "Apache-2.0",
Expand Down
4 changes: 4 additions & 0 deletions spec/classes/init_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@
it { should contain_package('cpulimit').with(:ensure => 'present') }
it { should contain_package('inotify-tools').with(:ensure => 'present') }
it { should contain_package('perl').with(:ensure => 'present') }
it { should contain_file('/usr/sbin/maldet').
with(:ensure => 'link') }
it { should contain_file('/usr/sbin/lmd').
with(:ensure => 'link') }
it { should contain_maldet('https://www.rfxn.com/downloads').
with(:ensure => 'present') }

Expand Down

0 comments on commit c7a84fd

Please sign in to comment.