Skip to content

Commit

Permalink
(SIMP-2971) Add $package_ensure (#11)
Browse files Browse the repository at this point in the history
SIMP-2971 #comment update chkrootkit
  • Loading branch information
Nick Miller authored and lnemsick-simp committed Oct 12, 2018
1 parent fab05d9 commit 7ce9764
Show file tree
Hide file tree
Showing 8 changed files with 26 additions and 28 deletions.
4 changes: 2 additions & 2 deletions .fixtures.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
fixtures:
repositories:
stdlib: "https://github.com/puppetlabs/puppetlabs-stdlib.git"
simplib: "https://github.com/simp/pupmod-simp-simplib.git"
stdlib: https://github.com/puppetlabs/puppetlabs-stdlib.git
simplib: https://github.com/simp/pupmod-simp-simplib.git
symlinks:
chkrootkit: "#{source_dir}"
6 changes: 3 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ before_install:
jobs:
include:
- stage: check
rvm: 2.4.1
rvm: 2.4.4
env: STRICT_VARIABLES=yes TRUSTED_NODE_DATA=yes PUPPET_VERSION="~> 5"
script:
- bundle exec rake check:dot_underscore
Expand All @@ -36,7 +36,7 @@ jobs:
- bundle exec puppet module build

- stage: spec
rvm: 2.4.1
rvm: 2.4.4
env: STRICT_VARIABLES=yes TRUSTED_NODE_DATA=yes PUPPET_VERSION="~> 5.0"
script:
- bundle exec rake spec
Expand All @@ -48,7 +48,7 @@ jobs:
- bundle exec rake spec

- stage: deploy
rvm: 2.4.1
rvm: 2.4.4
script:
- true
before_deploy:
Expand Down
9 changes: 7 additions & 2 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
* Fri Sep 07 2018 Liz Nemsick <[email protected]> - 0.0.3-0
* Thu Oct 11 2018 Nick Miller <[email protected]> - 0.1.0-0
- Added $package_ensure parameter
- Changed the package from 'latest' to 'installed'
- It will also respect `simp_options::package_ensure`

* Fri Sep 07 2018 Liz Nemsick <[email protected]> - 0.1.0-0
- Drop Hiera 4 support

* Sat Mar 17 2018 Trevor Vaughan <[email protected]> - 0.0.3-0
* Sat Mar 17 2018 Trevor Vaughan <[email protected]> - 0.1.0-0
- Added OEL and Puppet 5 support

* Thu Jul 06 2017 Liz Nemsick <[email protected]> - 0.0.2-0
Expand Down
1 change: 0 additions & 1 deletion CONTRIBUTORS

This file was deleted.

9 changes: 0 additions & 9 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,9 @@ group :test do
end

group :development do
gem 'travis'
gem 'travis-lint'
gem 'travish'
gem 'puppet-blacksmith'
gem 'guard-rake'
gem 'pry'
gem 'pry-byebug'
gem 'pry-doc'

# `listen` is a dependency of `guard`
# from `listen` 3.1+, `ruby_dep` requires Ruby version >= 2.2.3, ~> 2.2
gem 'listen', '~> 3.0.6'
end

group :system_tests do
Expand Down
21 changes: 12 additions & 9 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,19 @@
# Set to local6.notice, any other syslog destination to forward to syslog.
# Worthless if $syslog is false.
#
# @author Trevor Vaughan <[email protected]>
# @param package_ensure The ensure status of packages to be managed
#
# @author https://github.com/simp/pupmod-simp-chkrootkit/graphs/contributors
#
class chkrootkit (
Boolean $syslog = lookup('simp_options::syslog', { 'default_value' => false }),
String $log_dest = 'local6.notice',
String $minute = '0',
String $hour = '0',
String $monthday = '*',
String $month = '*',
String $weekday = '0'
String $log_dest = 'local6.notice',
String $minute = '0',
String $hour = '0',
String $monthday = '*',
String $month = '*',
String $weekday = '0',
Boolean $syslog = simplib::lookup('simp_options::syslog', { 'default_value' => false }),
String $package_ensure = simplib::lookup('simp_options::package_ensure', { 'default_value' => 'installed' }),
) {

if $syslog {
Expand All @@ -34,7 +37,7 @@
}

package { 'chkrootkit':
ensure => 'latest'
ensure => $package_ensure
}

cron { 'chkrootkit':
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": "simp-chkrootkit",
"version": "0.0.3",
"version": "0.1.0",
"author": "SIMP Team",
"summary": "A SIMP puppet module for managing chkrootkit",
"license": "Apache-2.0",
Expand Down
2 changes: 1 addition & 1 deletion spec/classes/init_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

context 'with syslog => true' do
let(:params) {{
:syslog => true,
:syslog => true,
:log_dest => 'random string that is hard to validate'
}}
it { is_expected.to create_cron('chkrootkit').with_command('/usr/sbin/chkrootkit -n | /bin/logger -p random string that is hard to validate -t chkrootkit') }
Expand Down

0 comments on commit 7ce9764

Please sign in to comment.