Skip to content

Commit

Permalink
made some minor changes. see changelog.
Browse files Browse the repository at this point in the history
  • Loading branch information
kekogya committed Feb 11, 2020
1 parent f3d9997 commit 32e19dd
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 5 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# Changelog

## Release 1.1.5

**Enhancements**

* Fixed deprecated `validate_legacy` warnings and switched from using params to hiera
* Added `nice` and `ionice` to throttle I/O and CPU load of AIDE
* Added unit test for `util-linux` package
* Added path to `aide init` exec command in `firstrun.pp`
* Update pdk to latest version

## Release 1.0.5

**Bugfixes**
Expand Down
9 changes: 6 additions & 3 deletions manifests/cron.pp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@
$mail_only_on_changes,
) {

# Throttle I/O with nice and ionice
$io = 'nice ionice -c3'

if $nocheck == true {
$cron_ensure = 'absent'
} else {
Expand All @@ -30,15 +33,15 @@
if $mail_only_on_changes {
cron::job { 'aide' :
ensure => $cron_ensure,
command => "AIDE_OUT=$(nice ionice -c3 ${settings} 2>&1) || echo \"\${AIDE_OUT}\" | ${cat_path} -v | ${mail_path} -E -s ${email_subject}",
command => "AIDE_OUT=$(${io} ${settings} 2>&1) || echo \"\${AIDE_OUT}\" | ${cat_path} -v | ${mail_path} -E -s ${email_subject}",
user => 'root',
hour => $hour,
minute => $minute,
}
} else {
cron::job { 'aide':
ensure => $cron_ensure,
command => "nice ionice -c3 ${settings} | ${cat_path} -v | ${mail_path} -s ${email_subject}",
command => "${io} ${settings} | ${cat_path} -v | ${mail_path} -s ${email_subject}",
user => 'root',
hour => $hour,
minute => $minute,
Expand All @@ -47,7 +50,7 @@
} else {
cron::job { 'aide':
ensure => $cron_ensure,
command => "nice ionice -c3 ${aide_path} --config ${conf_path} --check",
command => "${io} ${aide_path} --config ${conf_path} --check",
user => 'root',
hour => $hour,
minute => $minute,
Expand Down
1 change: 1 addition & 0 deletions manifests/firstrun.pp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
exec { 'aide init':
command => "nice ionice -c3 ${aide_path} --init --config ${conf_path}",
user => 'root',
path => ['/usr/bin', '/bin'],
timeout => $init_timeout,
refreshonly => true,
subscribe => Concat['aide.conf'],
Expand Down
4 changes: 2 additions & 2 deletions metadata.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "iu-aide",
"version": "1.0.5",
"version": "1.1.5",
"author": "Kenneth Gyan <kgyan@iu.edu>",
"summary": "Installs, configures, and manages AIDE (Advanced Intrustion Detection Environment).",
"license": "BSD-3-Clause",
Expand Down Expand Up @@ -68,7 +68,7 @@
"cis-benchmarks",
"cis"
],
"pdk-version": "1.15.0",
"pdk-version": "1.16.0",
"template-url": "https://github.com/puppetlabs/pdk-templates.git#1.10.0",
"template-ref": "tags/1.10.0-0-gbba9ac3"
}
1 change: 1 addition & 0 deletions spec/classes/aide_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

it { is_expected.to compile.with_all_deps }
it { is_expected.to contain_class('aide') }
it { is_expected.to contain_package('util-linux').with_ensure('present') }
it { is_expected.to contain_package('aide').with_ensure('latest') }
it { is_expected.to contain_class('aide::cron').that_requires('Package[aide]') }
it { is_expected.to contain_class('aide::config').that_requires('Package[aide]') }
Expand Down
2 changes: 2 additions & 0 deletions spec/classes/cron_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
let(:facts) { os_facts }
let(:settings) { '/usr/bin/aide --config /etc/aide/aide.conf --check' }
let(:email_subject) { 'testserver - AIDE Integrity Check aide@edu' }
let(:io) { 'nice ionice -c3' }
let(:cron_ensure) { 'present' }
let(:params) do
{
Expand All @@ -27,6 +28,7 @@
it { expect(cron_ensure).to eq('present') }
it { expect(settings).to eq('/usr/bin/aide --config /etc/aide/aide.conf --check') }
it { expect(email_subject).to eq('testserver - AIDE Integrity Check aide@edu') }
it { expect(io).to eq('nice ionice -c3') }
it { is_expected.to contain_cron__job('aide') }
end
end
Expand Down

0 comments on commit 32e19dd

Please sign in to comment.