From b8905db4afc3b96448c02e1e36c37a9a893c5a2e Mon Sep 17 00:00:00 2001 From: Trevor Vaughan Date: Tue, 31 Dec 2019 12:30:45 -0500 Subject: [PATCH] (SIMP-7322) Add EL8 support (#54) * (SIMP-7322) Add EL8 support SIMP-7322 #close SIMP-7202 #comment Add EL8 support to simp-postfix * Update CHANGELOG entry. Update puppet version in gitlab-ci to 5.5.16 Co-authored-by: jeannegreulich --- .gitignore | 14 ++++++---- .gitlab-ci.yml | 28 +++++++++---------- CHANGELOG | 3 ++ Gemfile | 7 ++--- README.md | 15 ++++++++-- REFERENCE.md | 19 +++++++++++++ lib/puppet/provider/postfix_main_cf/ruby.rb | 3 ++ manifests/server.pp | 8 +++++- metadata.json | 31 +++++++++++++-------- spec/acceptance/nodesets/default.yml | 23 +++++++-------- types/inetprotocols.pp | 1 + types/manciphers.pp | 1 + 12 files changed, 102 insertions(+), 51 deletions(-) diff --git a/.gitignore b/.gitignore index 1edd356..9cc3045 100644 --- a/.gitignore +++ b/.gitignore @@ -2,16 +2,18 @@ .yardoc dist/ pkg/ +spec/fixtures/* +!spec/fixtures/hieradata/ +!spec/fixtures/hieradata/* +spec/fixtures/hieradata/hiera.yaml spec/rp_env/ -spec/fixtures/** -!spec/fixtures/site.pp -!spec/fixtures/inspec_profiles -.bundle/ .rspec_system .vagrant/ +.bundle/ Gemfile.lock -doc/ +vendor/ junit/ log/ sec_results/ -vendor/ +doc/ +.idea/ diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index aaeaf51..3d0a02f 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -5,8 +5,8 @@ # 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.5 TBD*** -# PE 2018.1 5.5.8 2.4.5 2020-05 (LTS)*** +# SIMP 6.3 5.5.16 2.4.5 TBD*** +# PE 2018.1 5.5.16 2.4.5 2020-05 (LTS)*** # PE 2019.0 6.0 2.5.1 2019-08-31^^^ # # *** = Modules created for SIMP 6.3+ are not required to support Puppet < 5.5 @@ -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' @@ -149,8 +149,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: @@ -159,26 +159,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' -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' -pup5.5.10-oel: - <<: *pup_5_5_10 +pup5.5.16-oel: + <<: *pup_5_5_16 <<: *acceptance_base script: - 'bundle exec rake beaker:suites[default,oel]' -pup5.5.10-oel-fips: - <<: *pup_5_5_10 +pup5.5.16-oel-fips: + <<: *pup_5_5_16 <<: *acceptance_base <<: *only_with_SIMP_FULL_MATRIX script: diff --git a/CHANGELOG b/CHANGELOG index abbd75c..104c932 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,6 @@ +* Tue Dec 24 2019 Trevor Vaughan - 5.5.0-0 +- Add EL8 support + * Wed Sep 11 2019 Trevor Vaughan - 5.4.0-0 - Add support for simp-simplib 4 diff --git a/Gemfile b/Gemfile index f71b1ab..b466a99 100644 --- a/Gemfile +++ b/Gemfile @@ -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.2') - 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 diff --git a/README.md b/README.md index 9acd333..3fd5edf 100644 --- a/README.md +++ b/README.md @@ -13,8 +13,17 @@ If you find any issues, they can be submitted to our [JIRA](https://simp-project Please read our [Contribution Guide](https://simp.readthedocs.io/en/stable/contributors_guide/index.html). -## Work in Progress +## Module Description -Please excuse us as we transition this code into the public domain. +This module provides for the configuration of the [postfix](http://www.postfix.org/) mail server. -Downloads, discussion, and patches are still welcome! +## Reference + +Plesae see [REFERENCE.md](./REFERENCE.md) for a full reference. + +# Development + +Please read our [Contribution Guide](https://simp.readthedocs.io/en/stable/contributors_guide/index.html). + +Visit the [project homepage](https://simp-project.com) and look at our issues on +[JIRA](https://simp-project.atlassian.net). diff --git a/REFERENCE.md b/REFERENCE.md index 54aa1a7..b74da0e 100644 --- a/REFERENCE.md +++ b/REFERENCE.md @@ -22,6 +22,11 @@ * [`postfix_main_cf`](#postfix_main_cf): Modifies settings in the postfix main.cf configuration file. +**Data types** + +* [`Postfix::InetProtocols`](#postfixinetprotocols): Allowed inet protocol settings +* [`Postfix::ManCiphers`](#postfixmanciphers): Allowed mandatory ciphers + ## Classes ### postfix @@ -315,3 +320,17 @@ namevar The parameter to modify. +## Data types + +### Postfix::InetProtocols + +Allowed inet protocol settings + +Alias of `Array[Enum['all','ipv4','ipv6']]` + +### Postfix::ManCiphers + +Allowed mandatory ciphers + +Alias of `Enum['export', 'low', 'medium', 'high', 'null']` + diff --git a/lib/puppet/provider/postfix_main_cf/ruby.rb b/lib/puppet/provider/postfix_main_cf/ruby.rb index aba86bd..0c08964 100644 --- a/lib/puppet/provider/postfix_main_cf/ruby.rb +++ b/lib/puppet/provider/postfix_main_cf/ruby.rb @@ -1,4 +1,7 @@ Puppet::Type.type(:postfix_main_cf).provide(:ruby) do + desc <<-EOM + Provides for setting items in the postfix main.cf configuration file. + EOM commands :postconf => 'postconf' diff --git a/manifests/server.pp b/manifests/server.pp index d4a384b..3a3ea23 100644 --- a/manifests/server.pp +++ b/manifests/server.pp @@ -94,6 +94,8 @@ } if $firewall { + simplib::assert_optional_dependency($module_name, 'simp/iptables') + include 'iptables' $_dports = $enable_user_connect ? { @@ -108,7 +110,11 @@ } if $enable_tls { - if $haveged { include 'haveged' } + if $haveged { + simplib::assert_optional_dependency($module_name, 'simp/haveged') + + include 'haveged' + } if $enforce_tls { postfix_main_cf { 'smtp_enforce_tls': value => 'yes' } diff --git a/metadata.json b/metadata.json index 4451f70..1423fea 100644 --- a/metadata.json +++ b/metadata.json @@ -1,6 +1,6 @@ { "name": "simp-postfix", - "version": "5.4.0", + "version": "5.5.0", "author": "SIMP Team", "summary": "Manages the Postfix mail server", "license": "Apache-2.0", @@ -15,14 +15,6 @@ "mail" ], "dependencies": [ - { - "name": "simp/haveged", - "version_requirement": ">= 0.3.2 < 1.0.0" - }, - { - "name": "simp/iptables", - "version_requirement": ">= 6.0.0 < 7.0.0" - }, { "name": "puppetlabs/concat", "version_requirement": ">= 3.0.0 < 7.0.0" @@ -36,26 +28,41 @@ "version_requirement": ">= 4.13.1 < 7.0.0" } ], + "simp": { + "optional_dependencies": [ + { + "name": "simp/haveged", + "version_requirement": ">= 0.3.2 < 1.0.0" + }, + { + "name": "simp/iptables", + "version_requirement": ">= 6.0.0 < 7.0.0" + } + ] + }, "operatingsystem_support": [ { "operatingsystem": "CentOS", "operatingsystemrelease": [ "6", - "7" + "7", + "8" ] }, { "operatingsystem": "RedHat", "operatingsystemrelease": [ "6", - "7" + "7", + "8" ] }, { "operatingsystem": "OracleLinux", "operatingsystemrelease": [ "6", - "7" + "7", + "8" ] } ], diff --git a/spec/acceptance/nodesets/default.yml b/spec/acceptance/nodesets/default.yml index bcfc496..bc6a663 100644 --- a/spec/acceptance/nodesets/default.yml +++ b/spec/acceptance/nodesets/default.yml @@ -6,27 +6,28 @@ end -%> HOSTS: - el6: - roles: - - default - - master - - client - platform: el-6-x86_64 - box: centos/6 - hypervisor: <%= hypervisor %> - el7: roles: - - client + - default platform: el-7-x86_64 box: centos/7 hypervisor: <%= hypervisor %> yum_repos: chef-current: - baseurl: 'https://packages.chef.io/repos/yum/current/el/7/$basearch' + baseurl: 'https://packages.chef.io/repos/yum/current/el/$releasever/$basearch' gpgkeys: - https://packages.chef.io/chef.asc + el6: + platform: el-6-x86_64 + box: centos/6 + hypervisor: <%= hypervisor %> + + el8: + platform: el-8-x86_64 + box: centos/8 + hypervisor: <%= hypervisor %> + CONFIG: log_level: verbose type: aio diff --git a/types/inetprotocols.pp b/types/inetprotocols.pp index add06d6..50d2df7 100644 --- a/types/inetprotocols.pp +++ b/types/inetprotocols.pp @@ -1 +1,2 @@ +# Allowed inet protocol settings type Postfix::InetProtocols = Array[Enum['all','ipv4','ipv6']] diff --git a/types/manciphers.pp b/types/manciphers.pp index ba900be..80286d2 100644 --- a/types/manciphers.pp +++ b/types/manciphers.pp @@ -1 +1,2 @@ +# Allowed mandatory ciphers type Postfix::ManCiphers = Enum['export','low','medium','high','null']