Skip to content

Commit

Permalink
(SIMP-7288) Add EL8 support (#15)
Browse files Browse the repository at this point in the history
SIMP-7288 #close
SIMP-7202 #comment Add EL8 support to simp-deferred_resources
  • Loading branch information
trevor-vaughan authored and jeannegreulich committed Dec 19, 2019
1 parent 6edf554 commit 920861f
Show file tree
Hide file tree
Showing 10 changed files with 71 additions and 49 deletions.
8 changes: 5 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@
.yardoc
dist/
pkg/
spec/fixtures/
spec/fixtures/*
!spec/fixtures/hieradata/
!spec/fixtures/hieradata/*
spec/fixtures/hieradata/hiera.yaml
spec/rp_env/
!/spec/hieradata/default.yaml
!/spec/fixtures/site.pp
.rspec_system
.vagrant/
.bundle/
Expand All @@ -14,3 +15,4 @@ vendor/
junit/
log/
doc/
.idea/
30 changes: 15 additions & 15 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# https://puppet.com/docs/pe/2018.1/overview/getting_support_for_pe.html
# ------------------------------------------------------------------------------
# Release Puppet Ruby EOL
# SIMP 6.3 5.5.10 2.4.4 TBD***
# SIMP 6.3 5.5.16 2.4.4 TBD***
# PE 2018.1 5.5.8 2.4.4 2020-05 (LTS)***
# PE 2019.0 6.0 2.5.1 2019-08-31^^^
#
Expand Down Expand Up @@ -69,10 +69,10 @@ variables:
BEAKER_PUPPET_COLLECTION: 'puppet5'
MATRIX_RUBY_VERSION: '2.4'

.pup_5_5_10: &pup_5_5_10
.pup_5_5_16: &pup_5_5_16
image: 'ruby:2.4'
variables:
PUPPET_VERSION: '5.5.10'
PUPPET_VERSION: '5.5.16'
BEAKER_PUPPET_COLLECTION: 'puppet5'
MATRIX_RUBY_VERSION: '2.4'

Expand Down Expand Up @@ -150,8 +150,8 @@ pup5-unit:
<<: *pup_5
<<: *unit_tests

pup5.5.10-unit:
<<: *pup_5_5_10
pup5.5.16-unit:
<<: *pup_5_5_16
<<: *unit_tests

pup6-unit:
Expand All @@ -160,26 +160,26 @@ pup6-unit:

# Acceptance tests
# ==============================================================================
pup5.5.10:
<<: *pup_5_5_10
pup5.5.16:
<<: *pup_5_5_16
<<: *acceptance_base
script:
- 'bundle exec rake beaker:suites[default,default]'

pup5.5.10-fips:
<<: *pup_5_5_10
pup5.5.16-fips:
<<: *pup_5_5_16
<<: *acceptance_base
script:
- 'BEAKER_fips=yes bundle exec rake beaker:suites[default,default]'

pup5.5.10-oel-combined-x64:
<<: *pup_5_5_10
pup5.5.16-oel-combined-x64:
<<: *pup_5_5_16
<<: *acceptance_base
script:
- 'bundle exec rake beaker:suites[default,oel-combined-x64]'

pup5.5.10-oel-combined-x64-fips:
<<: *pup_5_5_10
pup5.5.16-oel-combined-x64-fips:
<<: *pup_5_5_16
<<: *acceptance_base
<<: *only_with_SIMP_FULL_MATRIX
script:
Expand All @@ -197,8 +197,8 @@ pup6-fips:
script:
- 'BEAKER_fips=yes bundle exec rake beaker:suites[default,default]'

pup5.5.10-fips-compliance:
<<: *pup_5_5_10
pup5.5.16-fips-compliance:
<<: *pup_5_5_16
<<: *compliance_base
script:
- 'BEAKER_fips=yes bundle exec rake beaker:suites[compliance,default]'
Expand Down
3 changes: 3 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
* Wed Dec 11 2019 Trevor Vaughan <tvaughan@onyxpoint.com> - 0.3.0
- Add EL8 support

* Thu Oct 31 2019 Liz Nemsick <lnemsick.simp@gmail.com> - 0.2.3
- Remove 'ftp' and 'games' users and groups when enforcing STIG
compliance.
Expand Down
9 changes: 4 additions & 5 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ gem_sources.each { |gem_source| source gem_source }

group :test do
gem 'rake'
gem 'puppet', ENV.fetch('PUPPET_VERSION', '~> 5.5')
gem 'puppet', ENV.fetch('PUPPET_VERSION', '~> 5.5')
gem 'rspec'
gem 'rspec-puppet'
gem 'hiera-puppet-helper'
Expand All @@ -13,18 +13,17 @@ group :test do
gem 'puppet-strings'
gem 'puppet-lint-empty_string-check', :require => false
gem 'puppet-lint-trailing_comma-check', :require => false
gem 'simp-rspec-puppet-facts', ENV.fetch('SIMP_RSPEC_PUPPET_FACTS_VERSION', '~> 2.0')
gem 'simp-rake-helpers', ENV.fetch('SIMP_RAKE_HELPERS_VERSION', '~> 5.6')
gem 'simp-rspec-puppet-facts', ENV.fetch('SIMP_RSPEC_PUPPET_FACTS_VERSION', ['>= 2.4.0', '< 3.0.0'] )
gem 'simp-rake-helpers', ENV.fetch('SIMP_RAKE_HELPERS_VERSION', ['>= 5.9', '< 6.0'])
end

group :development do
gem 'pry'
gem 'pry-byebug'
gem 'pry-doc'
end

group :system_tests do
gem 'beaker'
gem 'beaker-rspec'
gem 'simp-beaker-helpers', ENV.fetch('SIMP_BEAKER_HELPERS_VERSION', '~> 1.12')
gem 'simp-beaker-helpers', ENV.fetch('SIMP_BEAKER_HELPERS_VERSION', ['>= 1.17.0', '< 2.0.0'])
end
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ This module provides capabilities to add resources to the puppet catalog
>
> **WARNING:**
See [REFERENCE.md](./REFERENCE.md) for full API details.

### This is a SIMP module

This module is a component of the [System Integrity Management Platform](https://simp-project.com),
Expand Down
13 changes: 12 additions & 1 deletion REFERENCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,17 @@ A list of packages to remove.

Default value: {}

##### `remove_ensure`

Data type: `Enum['absent','purged']`

If removing, then this is the state that the packages should have.

* This will be overridden by anything set in options applied to an entry in
the `$remove` Hash.

Default value: 'absent'

##### `install`

Data type: `Variant[Hash, Array]`
Expand Down Expand Up @@ -362,7 +373,7 @@ they exist.

* 'invalidates':
* An Array of entries that this particular parameter invalidates.
This means that the items in the lisst will be set to `nil` in the
This means that the items in the list will be set to `nil` in the
overridden resource.

##### `log_level`
Expand Down
11 changes: 7 additions & 4 deletions metadata.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "simp-deferred_resources",
"version": "0.2.3",
"version": "0.3.0",
"author": "simp",
"summary": "This module creates custom types used to add resources to the catalog after the compilation of the manifests",
"license": "Apache-2.0",
Expand All @@ -25,21 +25,24 @@
"operatingsystem": "CentOS",
"operatingsystemrelease": [
"6",
"7"
"7",
"8"
]
},
{
"operatingsystem": "RedHat",
"operatingsystemrelease": [
"6",
"7"
"7",
"8"
]
},
{
"operatingsystem": "OracleLinux",
"operatingsystemrelease": [
"6",
"7"
"7",
"8"
]
}
],
Expand Down
11 changes: 6 additions & 5 deletions spec/acceptance/nodesets/centos-combined-x64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,20 @@ HOSTS:
el7:
roles:
- default
- master
- server
- client
platform: el-7-x86_64
box: centos/7
hypervisor: vagrant

el6:
roles:
- client
platform: el-6-x86_64
box: centos/6
hypervisor: vagrant

el8:
platform: el-8-x86_64
box: centos/8
hypervisor: vagrant

CONFIG:
log_level: verbose
type: aio
Expand Down
9 changes: 5 additions & 4 deletions spec/acceptance/nodesets/oel-combined-x64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,20 @@ HOSTS:
oel7:
roles:
- default
- master
- client
platform: el-7-x86_64
box: onyxpoint/oel-7-x86_64
hypervisor: vagrant

oel6:
roles:
- client
platform: el-6-x86_64
box: onyxpoint/oel-6-x86_64
hypervisor: vagrant

oel8:
platform: el-8-x86_64
box: generic/oracle8
hypervisor: vagrant

CONFIG:
log_level: verbose
type: aio
Expand Down
24 changes: 12 additions & 12 deletions spec/acceptance/suites/default/00_packages_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
describe 'deferred package resources' do
let(:manifest) {
<<-EOS
package { 'screen': ensure => 'absent'}
package { 'rsh-server': ensure => 'installed'}
package { 'tmpwatch': ensure => 'absent'}
package { 'dos2unix': ensure => 'installed'}
include 'deferred_resources'
EOS
Expand All @@ -16,10 +16,10 @@
---
deferred_resources::packages::remove:
'ypserv': ~
'rsh-server': ~
'dos2unix': ~
'vsftpd': ~
deferred_resources::packages::install:
- 'screen'
- 'tmpwatch'
- 'esc'
- 'zsh'
deferred_resources::packages::install_ensure: 'present'
Expand Down Expand Up @@ -47,12 +47,12 @@

it 'should have correct packages installed' do
# package with ensure absent
['screen'].each do |pkg|
['tmpwatch'].each do |pkg|
expect(host.check_for_package(pkg)).to eq false
end

# previously installed package and package with ensure present
['ypserv','rsh-server'].each do |pkg|
['ypserv','dos2unix'].each do |pkg|
expect(host.check_for_package(pkg)).to eq true
end
end
Expand All @@ -69,7 +69,7 @@
result = apply_manifest_on(host, manifest, :accept_all_exit_codes => true)

# packages ignored by deferred_resources because they are already in the catalogue
['screen','rsh-server'].each do |pkg|
['tmpwatch','dos2unix'].each do |pkg|
expect(result.stdout).to match(/Existing resource 'Package\[#{pkg}\]' .+ has options that differ/m)
end

Expand All @@ -86,13 +86,13 @@

it 'should not have changed the packages installed' do
# package removed by another catalogue resource
['screen'].each do |pkg|
['tmpwatch'].each do |pkg|
expect(host.check_for_package(pkg)).to eq false
end

# 1 package that would have been removed by deferred_resources and
# 1 package installed by another catalog resource
['ypserv','rsh-server'].each do |pkg|
['ypserv','dos2unix'].each do |pkg|
expect(host.check_for_package(pkg)).to eq true
end
end
Expand All @@ -108,7 +108,7 @@
result = apply_manifest_on(host, manifest, :accept_all_exit_codes => true)

# packages ignored by deferred_resources because they are already in the catalogue
['screen','rsh-server'].each do |pkg|
['tmpwatch','dos2unix'].each do |pkg|
expect(result.stdout).not_to match(/Existing resource 'Package\[#{pkg}\]' .+ has options that differ/m)
end

Expand All @@ -122,13 +122,13 @@
it 'should have removed and installed packages' do
# 1st package removed by another catalog resource and 2 remaining packages
# removed by deferred_resources
['screen','ypserv','vsftpd'].each do |pkg|
['tmpwatch','ypserv','vsftpd'].each do |pkg|
expect(host.check_for_package(pkg)).to eq false
end

# 1st package installed by another catalog resource and 2 remaining packages
# removed by deferred_resources
['rsh-server','esc', 'zsh'].each do |pkg|
['dos2unix','esc', 'zsh'].each do |pkg|
expect(host.check_for_package(pkg)).to eq true
end
end
Expand Down

0 comments on commit 920861f

Please sign in to comment.