85 changes: 12 additions & 73 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,82 +1,21 @@
---
name: CI

on:
pull_request:
schedule:
- cron: '4 4 * * *'

jobs:
setup_matrix:
if: github.event_name != 'schedule' || github.repository_owner == 'theforeman'
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:system_tests: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 check
run: bundle exec rake check
- name: Run rake validate
run: bundle exec rake validate
- name: Run rake lint
run: bundle exec rake lint
- 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: Unit / 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 parallel_spec
concurrency:
group: ${{ github.ref_name }}
cancel-in-progress: true

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: Acceptance / ${{ matrix.puppet.name }} - ${{ matrix.setfile.name }}
steps:
- 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 }}
# In Puppet 7 the locale ends up being C.UTF-8 if it isn't passed.
# This locale doesn't exist in EL7 and won't be supported either.
LANG: en_US.UTF-8
jobs:
puppet:
name: Puppet
uses: voxpupuli/gha-puppet/.github/workflows/beaker.yml@v1
with:
pidfile_workaround: 'false'
rubocop: false
cache-version: '1'
2 changes: 2 additions & 0 deletions .sync.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,5 @@ Gemfile:
spec/spec_helper.rb:
requires:
- webmock/rspec
spec/spec_helper_acceptance.rb:
locale_workaround: true
18 changes: 18 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,23 @@
# Changelog

## [19.3.0](https://github.com/theforeman/puppet-foreman/tree/19.3.0) (2022-04-08)

[Full Changelog](https://github.com/theforeman/puppet-foreman/compare/19.2.1...19.3.0)

**Implemented enhancements:**

- Include apache::mod::env [\#1038](https://github.com/theforeman/puppet-foreman/pull/1038) ([wbclark](https://github.com/wbclark))
- Refs [\#34505](https://projects.theforeman.org/issues/34505) - Add hammer plugin for foreman\_host\_reports [\#1030](https://github.com/theforeman/puppet-foreman/pull/1030) ([ofedoren](https://github.com/ofedoren))

**Fixed bugs:**

- metadata.json: Use https URL to git repo [\#1036](https://github.com/theforeman/puppet-foreman/pull/1036) ([bastelfreak](https://github.com/bastelfreak))
- Use the new GPG key for Debian packages [\#1034](https://github.com/theforeman/puppet-foreman/pull/1034) ([ekohl](https://github.com/ekohl))

**Merged pull requests:**

- Allow puppetlabs/postgresql 8.x [\#1031](https://github.com/theforeman/puppet-foreman/pull/1031) ([ekohl](https://github.com/ekohl))

## [19.2.1](https://github.com/theforeman/puppet-foreman/tree/19.2.1) (2022-02-21)

[Full Changelog](https://github.com/theforeman/puppet-foreman/compare/19.2.0...19.2.1)
Expand Down
4 changes: 2 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

source 'https://rubygems.org'

gem 'puppet', ENV.key?('PUPPET_VERSION') ? "~> #{ENV['PUPPET_VERSION']}" : '>= 5.5', groups: ['development', 'test']
gem 'puppet', ENV['PUPPET_GEM_VERSION'] || '>= 5.5', groups: ['development', 'test']
gem 'rake'

gem 'kafo_module_lint', {"groups"=>["test"]}
Expand All @@ -15,7 +15,7 @@ gem 'puppet-lint-strict_indent-check', {"groups"=>["test"]}
gem 'puppet-lint-undef_in_function-check', {"groups"=>["test"]}
gem 'voxpupuli-test', '~> 1.4', {"groups"=>["test"]}
gem 'github_changelog_generator', '>= 1.15.0', {"groups"=>["development"]}
gem 'puppet_metadata', '~> 0.3'
gem 'puppet_metadata', '~> 1.3'
gem 'puppet-blacksmith', '>= 6.0.0', {"groups"=>["development"]}
gem 'voxpupuli-acceptance', '~> 1.0', {"groups"=>["system_tests"]}
gem 'puppetlabs_spec_helper', {"groups"=>["system_tests"]}
Expand Down
10 changes: 10 additions & 0 deletions manifests/cli/host_reports.pp
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# = Hammer Host Reports plugin
#
# This installs the Host Reports plugin for Hammer CLI
#
# === Parameters:
#
class foreman::cli::host_reports {
foreman::cli::plugin { 'foreman_host_reports':
}
}
2 changes: 2 additions & 0 deletions manifests/config/apache.pp
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,8 @@
if $suburi {
$custom_fragment = undef
} else {
# mod_env is required by configuration in _assets.conf.erb
include apache::mod::env
$custom_fragment = file('foreman/_assets.conf.erb')
}

Expand Down
2 changes: 1 addition & 1 deletion manifests/repos/apt.pp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# @api private
define foreman::repos::apt (
Variant[Enum['nightly'], Pattern['^\d+\.\d+$']] $repo,
String $key = 'AE0AF310E2EA96B6B6F4BD726F8600B9563278F6',
String $key = '5B7C3E5A735BCB4D615829DC0BDDA991FD7AAC8A',
Stdlib::HTTPUrl $key_location = 'https://deb.theforeman.org/foreman.asc',
Stdlib::HTTPUrl $location = 'https://deb.theforeman.org/',
) {
Expand Down
6 changes: 3 additions & 3 deletions metadata.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"name": "theforeman-foreman",
"version": "19.2.1",
"version": "19.3.0",
"author": "theforeman",
"summary": "Foreman server configuration",
"license": "GPL-3.0+",
"source": "git://github.com/theforeman/puppet-foreman",
"source": "https://github.com/theforeman/puppet-foreman",
"project_page": "https://github.com/theforeman/puppet-foreman",
"issues_url": "https://github.com/theforeman/puppet-foreman/issues",
"description": "Module for configuring Foreman",
Expand All @@ -30,7 +30,7 @@
},
{
"name": "puppetlabs/postgresql",
"version_requirement": ">= 6.5.0 < 8.0.0"
"version_requirement": ">= 6.5.0 < 9.0.0"
},
{
"name": "puppetlabs/stdlib",
Expand Down
3 changes: 2 additions & 1 deletion spec/acceptance/foreman_cli_plugins_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ class { 'foreman::cli':
include foreman::cli::azure
}
include foreman::cli::discovery
include foreman::cli::host_reports
include foreman::cli::remote_execution
include foreman::cli::tasks
include foreman::cli::templates
Expand All @@ -32,7 +33,7 @@ class { 'foreman::cli':

it_behaves_like 'hammer'

['discovery', 'remote_execution', 'tasks', 'templates', 'webhooks', 'puppet'].each do |plugin|
['discovery', 'host_reports', 'remote_execution', 'tasks', 'templates', 'webhooks', 'puppet'].each do |plugin|
package_name = case fact('os.family')
when 'RedHat'
"#{package_prefix}rubygem-hammer_cli_foreman_#{plugin}"
Expand Down
1 change: 1 addition & 0 deletions spec/acceptance/hieradata/common.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---
apache::default_mods: false
foreman::initial_admin_password: changeme
foreman::server_ssl_ca: /etc/foreman-certs/certificate.pem
foreman::server_ssl_cert: /etc/foreman-certs/certificate.pem
Expand Down
2 changes: 1 addition & 1 deletion spec/classes/cli_plugins_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

supported = on_supported_os

['ansible', 'azure', 'discovery', 'katello', 'kubevirt', 'openscap', 'remote_execution', 'tasks', 'templates', 'virt_who_configure', 'webhooks', 'puppet'].each do |plugin|
['ansible', 'azure', 'discovery', 'host_reports', 'katello', 'kubevirt', 'openscap', 'remote_execution', 'tasks', 'templates', 'virt_who_configure', 'webhooks', 'puppet'].each do |plugin|
describe "foreman::cli::#{plugin}" do
supported.each do |os, os_facts|
context "on #{os}" do
Expand Down
2 changes: 1 addition & 1 deletion spec/defines/foreman_repos_apt_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
end

let(:apt_key) do
'AE0AF310E2EA96B6B6F4BD726F8600B9563278F6'
'5B7C3E5A735BCB4D615829DC0BDDA991FD7AAC8A'
end

let(:apt_key_title) do
Expand Down
7 changes: 7 additions & 0 deletions spec/spec_helper_acceptance.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,13 @@
# refresh check if cache needs refresh on next yum command
on host, 'yum clean expire-cache'
end

# In Puppet 7 the locale ends up being C.UTF-8 if it isn't passed.
# This locale doesn't exist in EL7 and won't be supported either.
# At least PostgreSQL runs into this.
if host['hypervisor'] == 'docker' && host['platform'] == 'el-7-x86_64'
ENV['LANG'] = 'en_US.UTF-8'
end
end

Dir["./spec/support/acceptance/**/*.rb"].sort.each { |f| require f }