From 7ce976458d467162ed9820ccd6bce9109c714505 Mon Sep 17 00:00:00 2001 From: Nick Miller Date: Fri, 12 Oct 2018 09:46:30 -0400 Subject: [PATCH] (SIMP-2971) Add $package_ensure (#11) SIMP-2971 #comment update chkrootkit --- .fixtures.yml | 4 ++-- .travis.yml | 6 +++--- CHANGELOG | 9 +++++++-- CONTRIBUTORS | 1 - Gemfile | 9 --------- manifests/init.pp | 21 ++++++++++++--------- metadata.json | 2 +- spec/classes/init_spec.rb | 2 +- 8 files changed, 26 insertions(+), 28 deletions(-) delete mode 100644 CONTRIBUTORS diff --git a/.fixtures.yml b/.fixtures.yml index b3097d8..8228a06 100644 --- a/.fixtures.yml +++ b/.fixtures.yml @@ -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}" diff --git a/.travis.yml b/.travis.yml index 47e1095..850e2dc 100644 --- a/.travis.yml +++ b/.travis.yml @@ -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 @@ -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 @@ -48,7 +48,7 @@ jobs: - bundle exec rake spec - stage: deploy - rvm: 2.4.1 + rvm: 2.4.4 script: - true before_deploy: diff --git a/CHANGELOG b/CHANGELOG index 7348d02..60ea792 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,7 +1,12 @@ -* Fri Sep 07 2018 Liz Nemsick - 0.0.3-0 +* Thu Oct 11 2018 Nick Miller - 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 - 0.1.0-0 - Drop Hiera 4 support -* Sat Mar 17 2018 Trevor Vaughan - 0.0.3-0 +* Sat Mar 17 2018 Trevor Vaughan - 0.1.0-0 - Added OEL and Puppet 5 support * Thu Jul 06 2017 Liz Nemsick - 0.0.2-0 diff --git a/CONTRIBUTORS b/CONTRIBUTORS deleted file mode 100644 index 9887fb1..0000000 --- a/CONTRIBUTORS +++ /dev/null @@ -1 +0,0 @@ -SIMP Team diff --git a/Gemfile b/Gemfile index 09b5459..30afeb5 100644 --- a/Gemfile +++ b/Gemfile @@ -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 diff --git a/manifests/init.pp b/manifests/init.pp index adb1e4e..a891d7e 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -14,16 +14,19 @@ # Set to local6.notice, any other syslog destination to forward to syslog. # Worthless if $syslog is false. # -# @author Trevor Vaughan +# @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 { @@ -34,7 +37,7 @@ } package { 'chkrootkit': - ensure => 'latest' + ensure => $package_ensure } cron { 'chkrootkit': diff --git a/metadata.json b/metadata.json index 886565a..f5e020b 100644 --- a/metadata.json +++ b/metadata.json @@ -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", diff --git a/spec/classes/init_spec.rb b/spec/classes/init_spec.rb index 8abc599..a42be3d 100644 --- a/spec/classes/init_spec.rb +++ b/spec/classes/init_spec.rb @@ -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') }