Skip to content
Closed

El10 #83

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 16 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,26 @@ name: "CI"

on:
pull_request:
push:
branches:
- main
- master

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
Spec:
uses: "puppetlabs/cat-github-actions/.github/workflows/module_ci.yml@main"
secrets: "inherit"
puppet:
name: "Puppet / Unit"
uses: "voxpupuli/gha-puppet/.github/workflows/basic.yml@v3"
with:
puppet_version: '["~> 8.0"]'

Acceptance:
needs: Spec
uses: "puppetlabs/cat-github-actions/.github/workflows/module_acceptance.yml@main"
secrets: "inherit"
acceptance:
name: "Puppet / Acceptance"
needs: puppet
uses: "voxpupuli/gha-puppet/.github/workflows/beaker.yml@v3"
with:
puppet_version: '["~> 8.0"]'
beaker_setfile: '["centos8-64", "centos9-64", "rocky8-64", "rocky9-64", "rocky10-64", "sles15-64", "ubuntu2204-64", "ubuntu2404-64"]'
70 changes: 16 additions & 54 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,67 +1,29 @@
# frozen_string_literal: true

source ENV['GEM_SOURCE'] || 'https://rubygems.org'

def location_for(place_or_version, fake_version = nil)
git_url_regex = %r{\A(?<url>(https?|git)[:@][^#]*)(#(?<branch>.*))?}
file_url_regex = %r{\Afile:\/\/(?<path>.*)}
puppet_version = ENV['PUPPET_GEM_VERSION']

if place_or_version && (git_url = place_or_version.match(git_url_regex))
[fake_version, { git: git_url[:url], branch: git_url[:branch], require: false }].compact
elsif place_or_version && (file_url = place_or_version.match(file_url_regex))
['>= 0', { path: File.expand_path(file_url[:path]), require: false }]
else
[place_or_version, { require: false }]
end
gem 'puppet', puppet_version, require: false if puppet_version
gem 'facter', ENV['FACTER_GEM_VERSION'], require: false if ENV['FACTER_GEM_VERSION']

group :test do
gem 'voxpupuli-test', '~> 9.0', require: false
gem 'facterdb', '~> 2.1', require: false
gem 'rspec-puppet-facts', '~> 4.0', require: false
end

group :development do
gem "json", '= 2.1.0', require: false if Gem::Requirement.create(['>= 2.5.0', '< 2.7.0']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup))
gem "json", '= 2.3.0', require: false if Gem::Requirement.create(['>= 2.7.0', '< 3.0.0']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup))
gem "json", '= 2.5.1', require: false if Gem::Requirement.create(['>= 3.0.0', '< 3.0.5']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup))
gem "json", '= 2.6.1', require: false if Gem::Requirement.create(['>= 3.1.0', '< 3.1.3']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup))
gem "json", '= 2.6.3', require: false if Gem::Requirement.create(['>= 3.2.0', '< 4.0.0']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup))
gem "racc", '~> 1.4.0', require: false if Gem::Requirement.create(['>= 2.7.0', '< 3.0.0']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup))
gem "deep_merge", '~> 1.2.2', require: false
gem "voxpupuli-puppet-lint-plugins", '~> 5.0', require: false
gem "facterdb", '~> 2.1', require: false
gem "metadata-json-lint", '~> 4.0', require: false
gem "rspec-puppet-facts", '~> 4.0', require: false
gem "dependency_checker", '~> 1.0.0', require: false
gem "parallel_tests", '= 3.12.1', require: false
gem "pry", '~> 0.10', require: false
gem "simplecov-console", '~> 0.9', require: false
gem "puppet-debugger", '~> 1.0', require: false
gem "rubocop", '~> 1.50.0', require: false
gem "rubocop-performance", '= 1.16.0', require: false
gem "rubocop-rspec", '= 2.19.0', require: false
gem "rb-readline", '= 0.5.5', require: false, platforms: [:mswin, :mingw, :x64_mingw]
gem "rexml", '>= 3.0.0', '< 3.2.7', require: false
end
group :development, :release_prep do
gem "puppet-strings", '~> 4.0', require: false
gem "puppetlabs_spec_helper", '~> 7.0', require: false
gem 'pry', '~> 0.10', require: false
gem 'puppet-strings', '~> 4.0', require: false
end

group :system_tests do
gem "puppet_litmus", '~> 1.0', require: false, platforms: [:ruby, :x64_mingw]
gem "CFPropertyList", '< 3.0.7', require: false, platforms: [:mswin, :mingw, :x64_mingw]
gem "serverspec", '~> 2.41', require: false
gem 'voxpupuli-acceptance', '~> 3.0', require: false
end

puppet_version = ENV['PUPPET_GEM_VERSION']
facter_version = ENV['FACTER_GEM_VERSION']
hiera_version = ENV['HIERA_GEM_VERSION']

gems = {}

gems['puppet'] = location_for(puppet_version)

# If facter or hiera versions have been specified via the environment
# variables

gems['facter'] = location_for(facter_version) if facter_version
gems['hiera'] = location_for(hiera_version) if hiera_version

gems.each do |gem_name, gem_params|
gem gem_name, *gem_params
group :release do
gem 'voxpupuli-release', '~> 3.0', require: false
end

# Evaluate Gemfile.local and ~/.gemfile if they exist
Expand Down
23 changes: 15 additions & 8 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -1,12 +1,19 @@
# frozen_string_literal: true

require 'bundler'
require 'puppet_litmus/rake_tasks' if Gem.loaded_specs.key? 'puppet_litmus'
require 'puppetlabs_spec_helper/rake_tasks'
require 'puppet-syntax/tasks/puppet-syntax'
require 'puppet-strings/tasks' if Gem.loaded_specs.key? 'puppet-strings'
begin
require 'voxpupuli/test/rake'
rescue LoadError
require 'puppetlabs_spec_helper/rake_tasks'
end

PuppetLint.configuration.send('disable_relative')
PuppetLint.configuration.send('disable_80chars')
PuppetLint.configuration.send('disable_140chars')
begin
require 'voxpupuli/acceptance/rake'
rescue LoadError
# voxpupuli-acceptance not available
end

begin
require 'puppet-strings/tasks'
rescue LoadError
# puppet-strings not available
end
43 changes: 43 additions & 0 deletions data/os/RedHat/10.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
---
postfix::main_alias_database: 'hash:/etc/aliases'
postfix::main_alias_maps: 'hash:/etc/aliases'
postfix::main_command_directory: '/usr/sbin'
postfix::main_compatibility_level: '2'
postfix::main_daemon_directory: '/usr/libexec/postfix'
postfix::main_data_directory: '/var/lib/postfix'
postfix::main_debug_peer_level: '2'
postfix::main_html_directory: 'no'
postfix::main_inet_protocols: 'all'
postfix::main_mail_owner: 'postfix'
postfix::main_mailq_path: '/usr/bin/mailq.postfix'
postfix::main_manpage_directory: '/usr/share/man'
postfix::main_meta_directory: '/etc/postfix'
postfix::main_newaliases_path: '/usr/bin/newaliases.postfix'
postfix::main_readme_directory: '/usr/share/doc/postfix/README_FILES'
postfix::main_sample_directory: '/usr/share/doc/postfix/samples'
postfix::main_sendmail_path: '/usr/sbin/sendmail.postfix'
postfix::main_setgid_group: 'postdrop'
postfix::main_shlib_directory: '/usr/lib64/postfix'
postfix::main_smtpd_tls_cert_file: '/etc/pki/tls/certs/postfix.pem'
postfix::main_smtpd_tls_key_file: '/etc/pki/tls/certs/postfix.key'
postfix::main_smtpd_tls_security_level: 'may'
postfix::main_smtp_tls_cafile: '/etc/pki/tls/certs/ca-bundle.crt'
postfix::main_smtp_tls_capath: '/etc/pki/tls/certs'
postfix::main_smtp_tls_security_level: 'may'
postfix::main_unknown_local_recipient_reject_code: 550
postfix::main_append_dot_mydomain: 'no'
postfix::main_biff: 'no'
postfix::main_mailbox_size_limit: 0
postfix::main_recipient_delimiter: '+'
postfix::main_relayhost: "mailhost.%{facts.networking.domain}"
postfix::main_mydestination: 'localhost'
postfix::main_myorigin: '$myhostname'
postfix::main_myhostname: "%{facts.networking.fqdn}"
postfix::main_queue_directory: '/var/spool/postfix'
postfix::main_transport_maps: '/etc/postfix/transport'
postfix::main_virtual_alias_maps: '/etc/postfix/virtual'
postfix::service_name: 'postfix'
postfix::main_inet_interfaces:
- 'localhost'
postfix::main_mynetworks:
- '127.0.0.0/8'
34 changes: 34 additions & 0 deletions data/os/Rocky/10.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
---
postfix::main_compatibility_level: '2'
postfix::main_queue_directory: '/var/spool/postfix'
postfix::main_command_directory: '/usr/sbin'
postfix::main_daemon_directory: '/usr/libexec/postfix'
postfix::main_data_directory: '/var/lib/postfix'
postfix::main_mail_owner: 'postfix'
postfix::main_inet_protocols: 'all'
postfix::main_mydestination: '$myhostname, localhost.$mydomain, localhost'
postfix::main_unknown_local_recipient_reject_code: 550
postfix::main_alias_maps: 'hash:/etc/aliases'
postfix::main_alias_database: 'hash:/etc/aliases'
postfix::main_debug_peer_level: '2'
postfix::main_sendmail_path: '/usr/sbin/sendmail.postfix'
postfix::main_newaliases_path: '/usr/bin/newaliases.postfix'
postfix::main_mailq_path: '/usr/bin/mailq.postfix'
postfix::main_setgid_group: 'postdrop'
postfix::main_html_directory: 'no'
postfix::main_manpage_directory: '/usr/share/man'
postfix::main_sample_directory: '/usr/share/doc/postfix/samples'
postfix::main_readme_directory: '/usr/share/doc/postfix/README_FILES'
postfix::main_smtpd_tls_cert_file: '/etc/pki/tls/certs/postfix.pem'
postfix::main_smtpd_tls_key_file: '/etc/pki/tls/private/postfix.key'
postfix::main_smtpd_tls_security_level: 'may'
postfix::main_smtp_tls_capath: '/etc/pki/tls/certs'
postfix::main_smtp_tls_cafile: '/etc/pki/tls/certs/ca-bundle.crt'
postfix::main_smtp_tls_security_level: 'may'
postfix::main_meta_directory: '/etc/postfix'
postfix::main_shlib_directory: '/usr/lib64/postfix'
postfix::service_name: 'postfix'
postfix::main_inet_interfaces:
- 'localhost'
postfix::main_custom:
'debugger_command': 'PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin ddd $daemon_directory/$process_name $process_id & sleep 5'
6 changes: 4 additions & 2 deletions metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
"operatingsystem": "RedHat",
"operatingsystemrelease": [
"8",
"9"
"9",
"10"
]
},
{
Expand All @@ -39,7 +40,8 @@
"operatingsystem": "Rocky",
"operatingsystemrelease": [
"8",
"9"
"9",
"10"
]
},
{
Expand Down
40 changes: 40 additions & 0 deletions spec/fixtures/testing/RedHat-10_main.cf
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# This file is being maintained by Puppet.
# DO NOT EDIT

alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
append_dot_mydomain = no
biff = no
command_directory = /usr/sbin
daemon_directory = /usr/libexec/postfix
data_directory = /var/lib/postfix
inet_interfaces = localhost
inet_protocols = all
smtp_tls_CAfile = /etc/pki/tls/certs/ca-bundle.crt
smtp_tls_CApath = /etc/pki/tls/certs
smtp_tls_security_level = may
smtpd_tls_security_level = may
smtpd_tls_key_file = /etc/pki/tls/certs/postfix.key
smtpd_tls_cert_file = /etc/pki/tls/certs/postfix.pem
compatibility_level = 2
debug_peer_level = 2
html_directory = no
mailbox_size_limit = 0
mailq_path = /usr/bin/mailq.postfix
mail_owner = postfix
manpage_directory = /usr/share/man
meta_directory = /etc/postfix
mydestination = localhost
myhostname = foo.example.com
mynetworks = 127.0.0.0/8
myorigin = $myhostname
newaliases_path = /usr/bin/newaliases.postfix
queue_directory = /var/spool/postfix
readme_directory = /usr/share/doc/postfix/README_FILES
recipient_delimiter = +
sample_directory = /usr/share/doc/postfix/samples
sendmail_path = /usr/sbin/sendmail.postfix
relayhost = mailhost.example.com:25
setgid_group = postdrop
shlib_directory = /usr/lib64/postfix
unknown_local_recipient_reject_code = 550
33 changes: 33 additions & 0 deletions spec/fixtures/testing/Rocky-10_main.cf
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# This file is being maintained by Puppet.
# DO NOT EDIT

alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
command_directory = /usr/sbin
daemon_directory = /usr/libexec/postfix
data_directory = /var/lib/postfix
inet_interfaces = localhost
inet_protocols = all
smtp_tls_CAfile = /etc/pki/tls/certs/ca-bundle.crt
smtp_tls_CApath = /etc/pki/tls/certs
smtp_tls_security_level = may
smtpd_tls_security_level = may
smtpd_tls_key_file = /etc/pki/tls/private/postfix.key
smtpd_tls_cert_file = /etc/pki/tls/certs/postfix.pem
compatibility_level = 2
debug_peer_level = 2
html_directory = no
mailq_path = /usr/bin/mailq.postfix
mail_owner = postfix
manpage_directory = /usr/share/man
meta_directory = /etc/postfix
mydestination = $myhostname, localhost.$mydomain, localhost
newaliases_path = /usr/bin/newaliases.postfix
queue_directory = /var/spool/postfix
readme_directory = /usr/share/doc/postfix/README_FILES
sample_directory = /usr/share/doc/postfix/samples
sendmail_path = /usr/sbin/sendmail.postfix
setgid_group = postdrop
shlib_directory = /usr/lib64/postfix
unknown_local_recipient_reject_code = 550
debugger_command = PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin ddd $daemon_directory/$process_name $process_id & sleep 5