aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Meusel <tim@bastelfreak.de>2021-02-09 12:28:39 +0100
committerGitHub <noreply@github.com>2021-02-09 12:28:39 +0100
commite22b12852d840869edb75ba1fbf767af75ba1b6d (patch)
tree08f58a8f8badbea9f429401e76c1e3180c472656
parentfb8ed26cdceb012c3395a8d897b98785b17f087f (diff)
parentc5c71bcb480d19387d761e760f3e6190c241f9eb (diff)
downloadpuppet-ferm-e22b12852d840869edb75ba1fbf767af75ba1b6d.tar.gz
puppet-ferm-e22b12852d840869edb75ba1fbf767af75ba1b6d.tar.bz2
Merge pull request #119 from voxpupuli/modulesync
modulesync 4.0.0
-rw-r--r--.github/CONTRIBUTING.md5
-rw-r--r--.github/workflows/ci.yml75
-rw-r--r--.github/workflows/release.yml29
-rw-r--r--.msync.yml2
-rw-r--r--.pmtignore17
-rw-r--r--.sync.yml11
-rw-r--r--.travis.yml101
-rw-r--r--Gemfile27
-rw-r--r--REFERENCE.md8
-rw-r--r--Rakefile9
-rwxr-xr-xfiles/ferm95
-rw-r--r--manifests/init.pp2
-rw-r--r--manifests/install.pp10
-rw-r--r--metadata.json11
-rw-r--r--spec/acceptance/ferm_spec.rb9
-rw-r--r--spec/classes/ferm_spec.rb10
16 files changed, 137 insertions, 284 deletions
diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md
index cace33e..f1f88cc 100644
--- a/.github/CONTRIBUTING.md
+++ b/.github/CONTRIBUTING.md
@@ -232,14 +232,14 @@ simple tests against it after applying the module. You can run this
with:
```sh
-bundle exec rake acceptance
+bundle exec rake beaker
```
This will run the tests on the module's default nodeset. You can override the
nodeset used, e.g.,
```sh
-BEAKER_set=centos-7-x64 bundle exec rake acceptance
+BEAKER_set=centos-7-x64 bundle exec rake beaker
```
There are default rake tasks for the various acceptance test modules, e.g.,
@@ -269,7 +269,6 @@ The following strings are known to work:
* ubuntu2004
* debian9
* debian10
-* centos6
* centos7
* centos8
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
new file mode 100644
index 0000000..b4f47e8
--- /dev/null
+++ b/.github/workflows/ci.yml
@@ -0,0 +1,75 @@
+name: CI
+
+on: pull_request
+
+jobs:
+ setup_matrix:
+ name: 'Setup Test Matrix'
+ runs-on: ubuntu-latest
+ outputs:
+ beaker_setfiles: ${{ steps.get-outputs.outputs.beaker_setfiles }}
+ puppet_major_versions: ${{ steps.get-outputs.outputs.puppet_major_versions }}
+ puppet_unit_test_matrix: ${{ steps.get-outputs.outputs.puppet_unit_test_matrix }}
+ env:
+ BUNDLE_WITHOUT: development:test:release
+ steps:
+ - uses: actions/checkout@v2
+ - name: Setup ruby
+ uses: ruby/setup-ruby@v1
+ with:
+ ruby-version: '2.7'
+ bundler-cache: true
+ - name: Run rake validate
+ run: bundle exec rake validate
+ - name: Setup Test Matrix
+ id: get-outputs
+ run: bundle exec metadata2gha --use-fqdn --pidfile-workaround false
+
+ unit:
+ needs: setup_matrix
+ runs-on: ubuntu-latest
+ strategy:
+ fail-fast: false
+ matrix:
+ include: ${{fromJson(needs.setup_matrix.outputs.puppet_unit_test_matrix)}}
+ env:
+ BUNDLE_WITHOUT: development:system_tests:release
+ PUPPET_VERSION: "~> ${{ matrix.puppet }}.0"
+ name: Puppet ${{ matrix.puppet }} (Ruby ${{ matrix.ruby }})
+ steps:
+ - uses: actions/checkout@v2
+ - name: Setup ruby
+ uses: ruby/setup-ruby@v1
+ with:
+ ruby-version: ${{ matrix.ruby }}
+ bundler-cache: true
+ - name: Run tests
+ run: bundle exec rake
+
+ acceptance:
+ needs: setup_matrix
+ runs-on: ubuntu-latest
+ env:
+ BUNDLE_WITHOUT: development:test:release
+ strategy:
+ fail-fast: false
+ matrix:
+ setfile: ${{fromJson(needs.setup_matrix.outputs.beaker_setfiles)}}
+ puppet: ${{fromJson(needs.setup_matrix.outputs.puppet_major_versions)}}
+ name: ${{ matrix.puppet.name }} - ${{ matrix.setfile.name }}
+ steps:
+ - name: Enable IPv6 on docker
+ run: |
+ echo '{"ipv6":true,"fixed-cidr-v6":"2001:db8:1::/64"}' | sudo tee /etc/docker/daemon.json
+ sudo service docker restart
+ - uses: actions/checkout@v2
+ - name: Setup ruby
+ uses: ruby/setup-ruby@v1
+ with:
+ ruby-version: '2.7'
+ bundler-cache: true
+ - name: Run tests
+ run: bundle exec rake beaker
+ env:
+ BEAKER_PUPPET_COLLECTION: ${{ matrix.puppet.collection }}
+ BEAKER_setfile: ${{ matrix.setfile.value }}
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
new file mode 100644
index 0000000..68b8528
--- /dev/null
+++ b/.github/workflows/release.yml
@@ -0,0 +1,29 @@
+name: Release
+
+on:
+ push:
+ tags:
+ - '*'
+
+env:
+ BUNDLE_WITHOUT: development:test:system_tests
+
+jobs:
+ deploy:
+ name: 'deploy to forge'
+ runs-on: ubuntu-latest
+ steps:
+ - name: Checkout repository
+ uses: actions/checkout@v2
+ - name: Setup Ruby
+ uses: ruby/setup-ruby@v1
+ with:
+ ruby-version: '2.7'
+ bundler-cache: true
+ - name: Build and Deploy
+ env:
+ # Configure secrets here:
+ # https://docs.github.com/en/free-pro-team@latest/actions/reference/encrypted-secrets
+ BLACKSMITH_FORGE_USERNAME: '${{ secrets.PUPPET_FORGE_USERNAME }}'
+ BLACKSMITH_FORGE_API_KEY: '${{ secrets.PUPPET_FORGE_API_KEY }}'
+ run: bundle exec rake module:push
diff --git a/.msync.yml b/.msync.yml
index 5758ace..a0770a8 100644
--- a/.msync.yml
+++ b/.msync.yml
@@ -1,2 +1,2 @@
---
-modulesync_config_version: '3.1.0'
+modulesync_config_version: '4.0.0'
diff --git a/.pmtignore b/.pmtignore
index 4e6d54b..33a8c65 100644
--- a/.pmtignore
+++ b/.pmtignore
@@ -1,11 +1,12 @@
docs/
pkg/
+Gemfile
Gemfile.lock
Gemfile.local
vendor/
.vendor/
-spec/fixtures/manifests/
-spec/fixtures/modules/
+spec/
+Rakefile
.vagrant/
.bundle/
.ruby-version
@@ -13,9 +14,21 @@ coverage/
log/
.idea/
.dependencies/
+.github/
.librarian/
Puppetfile.lock
*.iml
+.editorconfig
+.fixtures.yml
+.gitignore
+.msync.yml
+.overcommit.yml
+.pmtignore
+.rspec
+.rspec_parallel
+.rubocop.yml
+.sync.yml
.*.sw?
.yardoc/
+.yardopts
Dockerfile
diff --git a/.sync.yml b/.sync.yml
index 50b5210..35424a9 100644
--- a/.sync.yml
+++ b/.sync.yml
@@ -1,15 +1,4 @@
---
-.travis.yml:
- docker_sets:
- - set: debian9-64
- - set: debian10-64
- - set: centos6-64
- - set: centos7-64
- - set: ubuntu1604-64
- - set: ubuntu1804-64
- - set: ubuntu2004-64
- secure: "J7AG0AHVdEVql4c7cwJZCjbXFp5tehPnlS3REkUKu9s3Px+XRb+073W7hM2alfxB5Qo3mqyMdgyjIRMQyXXqfb54QmDG6Y1XfRIcNK/C6TL9JscC7rXN1gXJhrdZiQOtfXa3HFcWJkbsQrjnPbQ5y+
-b5VdkzIthLkIa4IpQEYSQC5i88nDixF8dgApLGgC0CcmS+14iXZgJ2T89A7QiSbvhnIsszaIQucw91/Kled9mUT2cJlFrMXLfd3hycR/ftLJeBe6MvnlaflSqEWfz9UA7EW63JX13hhyNNaf26JsFyG7P7UiH6+dBGXX3xLPKeq032VysZzbmA1GFZYiGk0obAtqMlrfbcpsLceyg1FCku2/lv/6P9dkfjN0N0z7pgL0lGjjhN3lNwU997fIXq/tt3dxbXKFV2Ok16p/55VjV5i2U79bNTn6oZpqLzB6ZEc9WOb3DvBsLP5ooThSVtrZecTFZbjRFAT/Vd0nd/qIzdxEoaVVaSPOpaZf6v1Ojy3RMzSSOUdweDBNh0B+9p0tVDpiLhRYpAFbw1JH2X0dlPqtrKS+BNU8xwktfK5KGpvvfXdU+pWUKxP1MnzrmX5jDX3dIh7pkGRvaKSD5RTmufCVaR0neEBV3VERPPYLDKueGc3BgWtVqaEyZwuM5AMJJuWKkTIQsUPsXKbIqyP5c="
Gemfile:
optional:
':test':
diff --git a/.travis.yml b/.travis.yml
deleted file mode 100644
index 1a85e7c..0000000
--- a/.travis.yml
+++ /dev/null
@@ -1,101 +0,0 @@
----
-# yamllint disable rule:line-length rule:truthy
-os: linux
-dist: focal
-language: ruby
-cache: bundler
-before_install:
- - yes | gem update --system
- - bundle --version
-script:
- - 'bundle exec rake $CHECK'
-jobs:
- fast_finish: true
- include:
- - rvm: 2.4.4
- bundler_args: --without system_tests development release
- env: PUPPET_VERSION="~> 5.0" CHECK=test
- - rvm: 2.5.3
- bundler_args: --without system_tests development release
- env: PUPPET_VERSION="~> 6.0" CHECK=test_with_coveralls
- - rvm: 2.5.3
- bundler_args: --without system_tests development release
- env: PUPPET_VERSION="~> 6.0" CHECK=rubocop
- - rvm: 2.4.4
- bundler_args: --without system_tests development release
- env: PUPPET_VERSION="~> 5.0" CHECK=build DEPLOY_TO_FORGE=yes
- - rvm: 2.5.3
- bundler_args: --without development release
- env: BEAKER_PUPPET_COLLECTION=puppet5 BEAKER_setfile=debian9-64 CHECK=beaker
- services: docker
- - rvm: 2.5.3
- bundler_args: --without development release
- env: BEAKER_PUPPET_COLLECTION=puppet6 BEAKER_setfile=debian9-64 CHECK=beaker
- services: docker
- - rvm: 2.5.3
- bundler_args: --without development release
- env: BEAKER_PUPPET_COLLECTION=puppet5 BEAKER_setfile=debian10-64 CHECK=beaker
- services: docker
- - rvm: 2.5.3
- bundler_args: --without development release
- env: BEAKER_PUPPET_COLLECTION=puppet6 BEAKER_setfile=debian10-64 CHECK=beaker
- services: docker
- - rvm: 2.5.3
- bundler_args: --without development release
- env: BEAKER_PUPPET_COLLECTION=puppet5 BEAKER_setfile=centos6-64 CHECK=beaker
- services: docker
- - rvm: 2.5.3
- bundler_args: --without development release
- env: BEAKER_PUPPET_COLLECTION=puppet6 BEAKER_setfile=centos6-64 CHECK=beaker
- services: docker
- - rvm: 2.5.3
- bundler_args: --without development release
- env: BEAKER_PUPPET_COLLECTION=puppet5 BEAKER_setfile=centos7-64 CHECK=beaker
- services: docker
- - rvm: 2.5.3
- bundler_args: --without development release
- env: BEAKER_PUPPET_COLLECTION=puppet6 BEAKER_setfile=centos7-64 CHECK=beaker
- services: docker
- - rvm: 2.5.3
- bundler_args: --without development release
- env: BEAKER_PUPPET_COLLECTION=puppet5 BEAKER_setfile=ubuntu1604-64 CHECK=beaker
- services: docker
- - rvm: 2.5.3
- bundler_args: --without development release
- env: BEAKER_PUPPET_COLLECTION=puppet6 BEAKER_setfile=ubuntu1604-64 CHECK=beaker
- services: docker
- - rvm: 2.5.3
- bundler_args: --without development release
- env: BEAKER_PUPPET_COLLECTION=puppet5 BEAKER_setfile=ubuntu1804-64 CHECK=beaker
- services: docker
- - rvm: 2.5.3
- bundler_args: --without development release
- env: BEAKER_PUPPET_COLLECTION=puppet6 BEAKER_setfile=ubuntu1804-64 CHECK=beaker
- services: docker
- - rvm: 2.5.3
- bundler_args: --without development release
- env: BEAKER_PUPPET_COLLECTION=puppet6 BEAKER_setfile=ubuntu2004-64 CHECK=beaker
- services: docker
-branches:
- only:
- - master
- - /^v\d/
-notifications:
- email: false
- webhooks: https://voxpupu.li/incoming/travis
- irc:
- on_success: always
- on_failure: always
- channels:
- - "chat.freenode.org#voxpupuli-notifications"
-deploy:
- provider: puppetforge
- username: puppet
- password:
- secure: "J7AG0AHVdEVql4c7cwJZCjbXFp5tehPnlS3REkUKu9s3Px+XRb+073W7hM2alfxB5Qo3mqyMdgyjIRMQyXXqfb54QmDG6Y1XfRIcNK/C6TL9JscC7rXN1gXJhrdZiQOtfXa3HFcWJkbsQrjnPbQ5y+ b5VdkzIthLkIa4IpQEYSQC5i88nDixF8dgApLGgC0CcmS+14iXZgJ2T89A7QiSbvhnIsszaIQucw91/Kled9mUT2cJlFrMXLfd3hycR/ftLJeBe6MvnlaflSqEWfz9UA7EW63JX13hhyNNaf26JsFyG7P7UiH6+dBGXX3xLPKeq032VysZzbmA1GFZYiGk0obAtqMlrfbcpsLceyg1FCku2/lv/6P9dkfjN0N0z7pgL0lGjjhN3lNwU997fIXq/tt3dxbXKFV2Ok16p/55VjV5i2U79bNTn6oZpqLzB6ZEc9WOb3DvBsLP5ooThSVtrZecTFZbjRFAT/Vd0nd/qIzdxEoaVVaSPOpaZf6v1Ojy3RMzSSOUdweDBNh0B+9p0tVDpiLhRYpAFbw1JH2X0dlPqtrKS+BNU8xwktfK5KGpvvfXdU+pWUKxP1MnzrmX5jDX3dIh7pkGRvaKSD5RTmufCVaR0neEBV3VERPPYLDKueGc3BgWtVqaEyZwuM5AMJJuWKkTIQsUPsXKbIqyP5c="
- on:
- tags: true
- # all_branches is required to use tags
- all_branches: true
- # Only publish the build marked with "DEPLOY_TO_FORGE"
- condition: "$DEPLOY_TO_FORGE = yes"
diff --git a/Gemfile b/Gemfile
index df44af0..53c1491 100644
--- a/Gemfile
+++ b/Gemfile
@@ -1,15 +1,5 @@
source ENV['GEM_SOURCE'] || "https://rubygems.org"
-def location_for(place, fake_version = nil)
- if place =~ /^(git[:@][^#]*)#(.*)/
- [fake_version, { :git => $1, :branch => $2, :require => false }].compact
- elsif place =~ /^file:\/\/(.*)/
- ['>= 0', { :path => File.expand_path($1), :require => false }]
- else
- [place, { :require => false }]
- end
-end
-
group :test do
gem 'voxpupuli-test', '~> 2.1', :require => false
gem 'coveralls', :require => false
@@ -18,14 +8,13 @@ group :test do
end
group :development do
- gem 'travis', :require => false
- gem 'travis-lint', :require => false
gem 'guard-rake', :require => false
gem 'overcommit', '>= 0.39.1', :require => false
end
group :system_tests do
- gem 'voxpupuli-acceptance', :require => false
+ gem 'puppet_metadata', '~> 0.3.0', :require => false
+ gem 'voxpupuli-acceptance', :require => false
end
group :release do
@@ -35,15 +24,11 @@ group :release do
gem 'puppet-strings', '>= 2.2', :require => false
end
+gem 'puppetlabs_spec_helper', '~> 2.0', :require => false
+gem 'rake', :require => false
+gem 'facter', ENV['FACTER_GEM_VERSION'], :require => false, :groups => [:test]
-
-if facterversion = ENV['FACTER_GEM_VERSION']
- gem 'facter', facterversion.to_s, :require => false, :groups => [:test]
-else
- gem 'facter', :require => false, :groups => [:test]
-end
-
-ENV['PUPPET_VERSION'].nil? ? puppetversion = '~> 6.0' : puppetversion = ENV['PUPPET_VERSION'].to_s
+puppetversion = ENV['PUPPET_VERSION'] || '~> 6.0'
gem 'puppet', puppetversion, :require => false, :groups => [:test]
# vim: syntax=ruby
diff --git a/REFERENCE.md b/REFERENCE.md
index 4092bc1..5b91153 100644
--- a/REFERENCE.md
+++ b/REFERENCE.md
@@ -94,14 +94,6 @@ Disable/Enable the management of the ferm default config
Default value: ``false``
-##### `manage_initfile`
-
-Data type: `Boolean`
-
-Disable/Enable the management of the ferm init script for RedHat-based OS
-
-Default value: ``false``
-
##### `configfile`
Data type: `Stdlib::Absolutepath`
diff --git a/Rakefile b/Rakefile
index b450fe7..d1bf749 100644
--- a/Rakefile
+++ b/Rakefile
@@ -1,4 +1,10 @@
-require 'voxpupuli/test/rake'
+# Attempt to load voxupuli-test (which pulls in puppetlabs_spec_helper),
+# otherwise attempt to load it directly.
+begin
+ require 'voxpupuli/test/rake'
+rescue LoadError
+ require 'puppetlabs_spec_helper/rake_tasks'
+end
# load optional tasks for releases
# only available if gem group releases is installed
@@ -26,6 +32,7 @@ end
begin
require 'github_changelog_generator/task'
+ require 'puppet_blacksmith'
GitHubChangelogGenerator::RakeTask.new :changelog do |config|
version = (Blacksmith::Modulefile.new).version
config.future_release = "v#{version}" if version =~ /^\d+\.\d+.\d+$/
diff --git a/files/ferm b/files/ferm
deleted file mode 100755
index fc2001d..0000000
--- a/files/ferm
+++ /dev/null
@@ -1,95 +0,0 @@
-#!/bin/sh
-
-# -----------------------------------------------------------------------------
-# ------------------------[ MANAGED BY PUPPET ]--------------------------------
-# -----------------------------------------------------------------------------
-#
-# ferm Configure ferm firewall rules from /etc/ferm.conf
-#
-# Inspired by Max Kellermann <max@duempel.org>
-#
-# Version: $Revision: 001 $
-### BEGIN INIT INFO
-# Provides: ferm
-# Required-Start: $network $remote_fs
-# Required-Stop: $network $remote_fs
-# Default-Start: 2 3 4 5
-# Default-Stop: 0 1 6
-# Description: Starts ferm firewall configuration
-# short-description: ferm firewall configuration
-### END INIT INFO
-
-PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
-FERM=/usr/sbin/ferm
-CONFIG=/etc/ferm.conf
-NAME=ferm
-DESC="firewall"
-
-test -x "${FERM}" || exit 0
-test -f "${CONFIG}" || exit 0
-
-# shellcheck disable=SC1091
-[ -r /etc/sysconfig/ferm ] && . /etc/sysconfig/ferm
-
-lockfile=/var/lock/subsys/$NAME
-
-umask 0077
-
-FAST=${FAST:-yes}
-OPTIONS="${OPTIONS}"
-
-set -e
-
-# shellcheck disable=SC2086
-configure_ferm() {
- if [ "${FAST}" = "yes" ]; then
- ${FERM} ${OPTIONS} ${CONFIG} || return ${?}
- else
- ${FERM} ${OPTIONS} --slow ${CONFIG} || return ${?}
- fi
-}
-
-case "${1}" in
- start|reload|restart|force-reload)
- # shellcheck disable=SC2039
- echo -n "${1}ing ${DESC}" "${NAME}"
- configure_ferm
- RETVAL=$?
- if [ $RETVAL -eq 0 ]; then
- touch $lockfile
- echo " ... ok."
- else
- echo "... failed!"
- fi
- exit $RETVAL
- ;;
- stop)
- # shellcheck disable=SC2039
- echo -n "stopping ${DESC}" "${NAME}"
- OPTIONS="${OPTIONS} --flush"
- configure_ferm
- RETVAL=$?
- if [ $RETVAL -eq 0 ]; then
- rm -f $lockfile
- echo " ... ok."
- else
- echo "... failed!"
- fi
- exit $RETVAL
- ;;
- status)
- if [ -f $lockfile ]; then
- echo "${NAME} has configured iptables rules."
- else
- echo "${NAME} has NOT configured iptables rules."
- exit 1
- fi
- ;;
- *)
- N=/etc/init.d/${NAME}
- echo "Usage: ${N} {start|stop|restart|reload|force-reload|status}"
- exit 1
- ;;
-esac
-
-exit 0
diff --git a/manifests/init.pp b/manifests/init.pp
index 0484995..9317fbf 100644
--- a/manifests/init.pp
+++ b/manifests/init.pp
@@ -29,7 +29,6 @@
#
# @param manage_service Disable/Enable the management of the ferm daemon
# @param manage_configfile Disable/Enable the management of the ferm default config
-# @param manage_initfile Disable/Enable the management of the ferm init script for RedHat-based OS
# @param configfile Path to the config file
# @param configdirectory Path to the directory where the module stores ferm configuration files
# @param forward_disable_conntrack Enable/Disable the generation of conntrack rules for the FORWARD chain
@@ -55,7 +54,6 @@ class ferm (
Stdlib::Absolutepath $configdirectory,
Boolean $manage_service = false,
Boolean $manage_configfile = false,
- Boolean $manage_initfile = false,
Boolean $forward_disable_conntrack = true,
Boolean $output_disable_conntrack = true,
Boolean $input_disable_conntrack = false,
diff --git a/manifests/install.pp b/manifests/install.pp
index c61a194..c27cedf 100644
--- a/manifests/install.pp
+++ b/manifests/install.pp
@@ -42,14 +42,4 @@ class ferm::install {
fail("unexpected install_method ${ferm::install_method}")
}
}
-
- if $ferm::manage_initfile {
- if $facts['os']['family'] == 'RedHat' and versioncmp($facts['os']['release']['major'], '6') <= 0 {
- file { '/etc/init.d/ferm':
- ensure => 'file',
- mode => '0755',
- source => "puppet:///modules/${module_name}/ferm",
- }
- }
- }
}
diff --git a/metadata.json b/metadata.json
index 8fd8f2b..466bb9e 100644
--- a/metadata.json
+++ b/metadata.json
@@ -29,14 +29,12 @@
{
"operatingsystem": "CentOS",
"operatingsystemrelease": [
- "6",
"7"
]
},
{
"operatingsystem": "RedHat",
"operatingsystemrelease": [
- "6",
"7"
]
},
@@ -49,12 +47,6 @@
]
},
{
- "operatingsystem": "Fedora",
- "operatingsystemrelease": [
- "26"
- ]
- },
- {
"operatingsystem": "Debian",
"operatingsystemrelease": [
"9",
@@ -67,7 +59,6 @@
{
"operatingsystem": "VirtuozzoLinux",
"operatingsystemrelease": [
- "6",
"7"
]
}
@@ -75,7 +66,7 @@
"requirements": [
{
"name": "puppet",
- "version_requirement": ">= 5.5.8 < 7.0.0"
+ "version_requirement": ">= 6.1.0 < 8.0.0"
}
]
}
diff --git a/spec/acceptance/ferm_spec.rb b/spec/acceptance/ferm_spec.rb
index eee01fa..326ed9f 100644
--- a/spec/acceptance/ferm_spec.rb
+++ b/spec/acceptance/ferm_spec.rb
@@ -5,13 +5,6 @@ os_release = fact('os.release.major')
sut_os = "#{os_name}-#{os_release}"
-manage_initfile = case sut_os
- when 'CentOS-6'
- true
- else
- false
- end
-
iptables_output = case sut_os
when 'Debian-10'
[
@@ -43,7 +36,6 @@ basic_manifest = %(
class { 'ferm':
manage_service => true,
manage_configfile => true,
- manage_initfile => #{manage_initfile}, # CentOS-6 does not provide init script
forward_policy => 'DROP',
output_policy => 'ACCEPT',
input_policy => 'DROP',
@@ -166,7 +158,6 @@ describe 'ferm' do
class { 'ferm':
manage_service => true,
manage_configfile => true,
- manage_initfile => #{manage_initfile}, # CentOS-6 does not provide init script
forward_policy => 'DROP',
output_policy => 'ACCEPT',
input_policy => 'DROP',
diff --git a/spec/classes/ferm_spec.rb b/spec/classes/ferm_spec.rb
index d400a7b..b134368 100644
--- a/spec/classes/ferm_spec.rb
+++ b/spec/classes/ferm_spec.rb
@@ -80,17 +80,7 @@ describe 'ferm' do
it { is_expected.to contain_concat__fragment('mangle-OUTPUT-config-include') }
it { is_expected.to contain_concat__fragment('mangle-POSTROUTING-config-include') }
end
- context 'with managed initfile' do
- let :params do
- { manage_initfile: true }
- end
- if facts[:os]['family'] == 'RedHat' && facts[:os]['release']['major'].to_i <= 6
- it { is_expected.to contain_file('/etc/init.d/ferm') }
- else
- it { is_expected.not_to contain_file('/etc/init.d/ferm') }
- end
- end
context 'it creates chains' do
it { is_expected.to contain_concat__fragment('raw-PREROUTING-policy') }
it { is_expected.to contain_concat__fragment('raw-OUTPUT-policy') }