Skip to content

Commit

Permalink
Support Puppet 8 and stdlib 9.x
Browse files Browse the repository at this point in the history
Drop Debian 9 and Ubuntu 18.04 as EOL
Add EL9, Debian 11 and Ubuntu 22.04 support
  • Loading branch information
treydock committed Nov 15, 2023
1 parent e85a0d3 commit 5c9cd63
Show file tree
Hide file tree
Showing 13 changed files with 119 additions and 77 deletions.
2 changes: 1 addition & 1 deletion .fixtures.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ fixtures:
repositories:
'stdlib':
repo: 'https://github.com/puppetlabs/puppetlabs-stdlib.git'
ref: 'v8.0.0'
ref: 'v9.0.0'
'host_core':
repo: 'https://github.com/puppetlabs/puppetlabs-host_core.git'
ref: 'v1.1.0'
Expand Down
28 changes: 20 additions & 8 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,27 +15,35 @@ jobs:
fail-fast: false
matrix:
include:
- ruby: 2.7.0
- ruby: 2.7.8
puppet: 7
fixtures: .fixtures.yml
allow_failure: false
- ruby: 2.7.0
- ruby: 2.7.8
puppet: 7
fixtures: .fixtures-latest.yml
allow_failure: true
- ruby: 3.2.2
puppet: 8
fixtures: .fixtures.yml
allow_failure: false
- ruby: 3.2.2
puppet: 8
fixtures: .fixtures-latest.yml
allow_failure: true
env:
BUNDLE_WITHOUT: system_tests:release
PUPPET_GEM_VERSION: "~> ${{ matrix.puppet }}.0"
FACTER_GEM_VERSION: "< 4.0"
FIXTURES_YML: ${{ matrix.fixtures }}
name: Puppet ${{ matrix.puppet }} (Ruby ${{ matrix.ruby }} fixtures=${{ matrix.fixtures }})
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Setup ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
cache-version: 2
bundler: '2.1.0'
- name: Validate
run: bundle exec rake check:symlinks check:git_ignore check:dot_underscore check:test_file rubocop syntax lint metadata_lint
Expand All @@ -47,11 +55,14 @@ jobs:
fail-fast: false
matrix:
set:
- "debian-10"
- "rocky-8"
- "ubuntu-1804"
- "el8"
- "el9"
- "debian-11"
- "ubuntu-2004"
- "ubuntu-2204"
puppet:
- "puppet7"
- "puppet8"
env:
BUNDLE_WITHOUT: development:release
BEAKER_debug: true
Expand All @@ -68,12 +79,13 @@ jobs:
sudo apt-get remove mysql-server --purge
sudo apt-get install apparmor-profiles
sudo apparmor_parser -R /etc/apparmor.d/usr.sbin.mysqld
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Setup ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '2.7'
bundler-cache: true
cache-version: 2
bundler: '2.1.0'
- name: Run tests
run: bundle exec rake beaker
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,18 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '2.7'
bundler-cache: true
cache-version: 2
bundler: '2.1.0'
- name: Build and Deploy
env:
# Configure secrets here:
# https://docs.github.com/en/free-pro-team@latest/actions/reference/encrypted-secrets
BLACKSMITH_FORGE_USERNAME: 'ghoneycutt'
BLACKSMITH_FORGE_USERNAME: 'tailoredautomation'
BLACKSMITH_FORGE_API_KEY: '${{ secrets.PUPPET_FORGE_API_KEY }}'
run: bundle exec rake module:push
30 changes: 5 additions & 25 deletions .sync.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,15 @@
# for the default values.
---
.github/workflows/ci.yaml:
unit_name: Puppet ${{ matrix.puppet }} (Ruby ${{ matrix.ruby }} fixtures=${{ matrix.fixtures }})
unit_includes:
- ruby: '2.7.0'
puppet: '7'
fixtures: .fixtures.yml
allow_failure: false
- ruby: '2.7.0'
puppet: '7'
fixtures: .fixtures-latest.yml
allow_failure: true
acceptance_matrix:
set:
- debian-10
- rocky-8
- ubuntu-1804
- el8
- el9
- debian-11
- ubuntu-2004
puppet:
- puppet7
- puppet8
.travis.yml:
delete: true
Rakefile:
Expand All @@ -32,15 +24,3 @@ Rakefile:
delete: true
appveyor.yml:
delete: true
spec/acceptance/nodesets/centos-6.yml:
delete: true
spec/acceptance/nodesets/centos-7.yml:
delete: true
spec/acceptance/nodesets/centos-8.yml:
delete: true
spec/acceptance/nodesets/ubuntu-1604.yml:
delete: true
spec/acceptance/nodesets/debian-8.yml:
delete: true
spec/acceptance/nodesets/debian-9.yml:
delete: true
27 changes: 9 additions & 18 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,32 +17,23 @@ ruby_version_segments = Gem::Version.new(RUBY_VERSION.dup).segments
minor_version = ruby_version_segments[0..1].join('.')

group :development do
gem "facter", '< 4.0', require: false
gem "fast_gettext", '1.1.0', require: false if Gem::Version.new(RUBY_VERSION.dup) < Gem::Version.new('2.1.0')
gem "fast_gettext", require: false if Gem::Version.new(RUBY_VERSION.dup) >= Gem::Version.new('2.1.0')
gem "json_pure", '<= 2.0.1', require: false if Gem::Version.new(RUBY_VERSION.dup) < Gem::Version.new('2.0.0')
gem "json", '= 1.8.1', require: false if Gem::Version.new(RUBY_VERSION.dup) == Gem::Version.new('2.1.9')
gem "json", '= 2.0.4', require: false if Gem::Requirement.create('~> 2.4.2').satisfied_by?(Gem::Version.new(RUBY_VERSION.dup))
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 "rb-readline", '= 0.5.5', require: false, platforms: [:mswin, :mingw, :x64_mingw]
gem "puppet-module-posix-default-r#{minor_version}", '~> 1.0', require: false, platforms: [:ruby]
gem "puppet-module-posix-dev-r#{minor_version}", '~> 1.0', require: false, platforms: [:ruby]
gem "puppet-module-win-default-r#{minor_version}", '~> 1.0', require: false, platforms: [:mswin, :mingw, :x64_mingw]
gem "puppet-module-win-dev-r#{minor_version}", '~> 1.0', require: false, platforms: [:mswin, :mingw, :x64_mingw]
gem "puppet-lint-param-docs", require: false
gem "voxpupuli-puppet-lint-plugins", '>= 3.0', require: false
gem "github_changelog_generator", require: false, git: 'https://github.com/skywinder/github-changelog-generator', ref: '20ee04ba1234e9e83eb2ffb5056e23d641c7a018' if Gem::Version.new(RUBY_VERSION.dup) >= Gem::Version.new('2.2.2')
gem "voxpupuli-test", '6.0.0', require: false
gem "rubocop-performance", '~> 1.18', require: false
gem "faraday", '~> 1.0', require: false
gem "github_changelog_generator", require: false
gem "puppet-blacksmith", require: false
gem "puppet-strings", require: false
end
group :system_tests do
gem "puppet-module-posix-system-r#{minor_version}", '~> 0.5', require: false, platforms: [:ruby]
gem "puppet-module-win-system-r#{minor_version}", '~> 0.5', require: false, platforms: [:mswin, :mingw, :x64_mingw]
gem "beaker", *location_for(ENV['BEAKER_VERSION'] || '~> 4.0')
gem "beaker", *location_for(ENV['BEAKER_VERSION'] || '~> 4.29')
gem "beaker-abs", *location_for(ENV['BEAKER_ABS_VERSION'] || '~> 0.1')
gem "beaker-pe", require: false
gem "beaker-hostgenerator"
gem "beaker-rspec"
gem "beaker-docker"
gem "beaker-puppet"
gem "beaker-puppet_install_helper", require: false
gem "beaker-module_install_helper", require: false
end

puppet_version = ENV['PUPPET_GEM_VERSION']
Expand Down
4 changes: 2 additions & 2 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# frozen_string_literal: true

require 'bundler'
require 'puppet_litmus/rake_tasks' if Bundler.rubygems.find_name('puppet_litmus').any?
require 'beaker-rspec/rake_task' if Bundler.rubygems.find_name('beaker-rspec').any?
require 'puppetlabs_spec_helper/rake_tasks'
require 'puppet-syntax/tasks/puppet-syntax'
require 'puppet_blacksmith/rake_tasks' if Bundler.rubygems.find_name('puppet-blacksmith').any?
Expand Down Expand Up @@ -57,7 +57,7 @@ if Bundler.rubygems.find_name('github_changelog_generator').any?
config.header = "# Change log\n\nAll notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org)."
config.add_pr_wo_labels = true
config.issues = false
config.merge_prefix = "### UNCATEGORIZED PRS; LABEL THEM ON GITHUB"
config.merge_prefix = "### Merged pull requests:"
config.configure_sections = {
"Changed" => {
"prefix" => "### Changed",
Expand Down
8 changes: 4 additions & 4 deletions metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
},
{
"name": "puppetlabs/stdlib",
"version_requirement": ">= 8.0.0 < 9.0.0"
"version_requirement": ">= 8.0.0 < 10.0.0"
}
],
"operatingsystem_support": [
Expand Down Expand Up @@ -49,11 +49,11 @@
"requirements": [
{
"name": "puppet",
"version_requirement": ">= 7.0.0 < 8.0.0"
"version_requirement": ">= 7.0.0 < 9.0.0"
}
],
"description": "Can ensure entries for localhost, localhost6, and $::fqdn,\nincluding aliases and optionally purge unmanaged entries.",
"pdk-version": "2.5.0",
"pdk-version": "3.0.0",
"template-url": "https://github.com/tailored-automation/pdk-templates#main",
"template-ref": "heads/main-0-g37b4517"
"template-ref": "heads/main-0-g53868f7"
}
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
HOSTS:
debian10:
debian11:
roles:
- agent
platform: debian-10-amd64
platform: debian-11-amd64
hypervisor: docker
image: debian:10
image: debian:11
docker_preserve_image: true
docker_cmd:
- '/sbin/init'
Expand All @@ -14,11 +14,14 @@ HOSTS:
- 'echo "en_US.UTF-8 UTF-8" >> /etc/locale.gen'
- 'echo "LANG=en_US.UTF-8" > /etc/locale.conf'
- 'locale-gen en_US.UTF-8'
docker_container_name: 'hosts-debian10'
docker_env:
- LANG=en_US.UTF-8
- LANGUAGE=en_US.UTF-8
- LC_ALL=en_US.UTF-8
docker_container_name: 'hosts-debian11'
CONFIG:
log_level: debug
type: foss
ssh:
password: root
auth_methods: ["password"]

Original file line number Diff line number Diff line change
@@ -1,22 +1,25 @@
HOSTS:
rocky-8:
el8:
roles:
- agent
platform: el-8-x86_64
hypervisor: docker
image: rockylinux/rockylinux:8
image: almalinux:8
docker_preserve_image: true
docker_cmd:
- '/usr/sbin/init'
docker_image_commands:
- 'yum install -y dnf-utils'
- 'dnf install -y dnf-utils'
- 'dnf config-manager --set-enabled powertools'
- 'yum install -y wget which cronie iproute initscripts'
- 'dnf install -y wget which cronie iproute initscripts'
docker_env:
- LANG=en_US.UTF-8
- LANGUAGE=en_US.UTF-8
- LC_ALL=en_US.UTF-8
docker_container_name: 'hosts-el8'
CONFIG:
log_level: debug
type: foss
ssh:
password: root
auth_methods: ["password"]

25 changes: 25 additions & 0 deletions spec/acceptance/nodesets/el9.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
HOSTS:
el9:
roles:
- agent
platform: el-9-x86_64
hypervisor: docker
image: almalinux:9
docker_preserve_image: true
docker_cmd:
- '/usr/sbin/init'
docker_image_commands:
- 'dnf install -y dnf-utils'
- 'dnf config-manager --set-enabled crb'
- 'dnf install -y wget which cronie iproute initscripts'
docker_env:
- LANG=en_US.UTF-8
- LANGUAGE=en_US.UTF-8
- LC_ALL=en_US.UTF-8
docker_container_name: 'hosts-el9'
CONFIG:
log_level: debug
type: foss
ssh:
password: root
auth_methods: ["password"]
Original file line number Diff line number Diff line change
@@ -1,21 +1,24 @@
HOSTS:
ubuntu1804:
ubuntu2004:
roles:
- agent
platform: ubuntu-18.04-amd64
platform: ubuntu-20.04-amd64
hypervisor : docker
image: ubuntu:18.04
image: ubuntu:20.04
docker_preserve_image: true
docker_cmd: '["/sbin/init"]'
docker_image_commands:
- "rm -f /etc/dpkg/dpkg.cfg.d/excludes"
- 'apt-get install -y wget net-tools locales apt-transport-https ca-certificates'
- 'apt-get install -y wget net-tools iproute2 locales apt-transport-https ca-certificates'
- 'locale-gen en_US.UTF-8'
docker_container_name: 'hosts-ubuntu1804'
docker_env:
- LANG=en_US.UTF-8
- LANGUAGE=en_US.UTF-8
- LC_ALL=en_US.UTF-8
docker_container_name: 'hosts-ubuntu2004'
CONFIG:
log_level: debug
type: foss
ssh:
password: root
auth_methods: ["password"]

24 changes: 24 additions & 0 deletions spec/acceptance/nodesets/ubuntu-2204.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
HOSTS:
ubuntu2204:
roles:
- agent
platform: ubuntu-22.04-amd64
hypervisor : docker
image: ubuntu:22.04
docker_preserve_image: true
docker_cmd: '["/sbin/init"]'
docker_image_commands:
- "rm -f /etc/dpkg/dpkg.cfg.d/excludes"
- 'apt-get install -y wget net-tools iproute2 locales apt-transport-https ca-certificates'
- 'locale-gen en_US.UTF-8'
docker_env:
- LANG=en_US.UTF-8
- LANGUAGE=en_US.UTF-8
- LC_ALL=en_US.UTF-8
docker_container_name: 'hosts-ubuntu2204'
CONFIG:
log_level: debug
type: foss
ssh:
password: root
auth_methods: ["password"]
2 changes: 1 addition & 1 deletion spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
next unless File.exist?(f) && File.readable?(f) && File.size?(f)

begin
default_facts.merge!(YAML.safe_load(File.read(f), [], [], true))
default_facts.merge!(YAML.safe_load(File.read(f)))
rescue => e
RSpec.configuration.reporter.message "WARNING: Unable to load #{f}: #{e}"
end
Expand Down

0 comments on commit 5c9cd63

Please sign in to comment.