Showing with 87 additions and 91 deletions.
  1. +12 −70 .github/workflows/ci.yml
  2. +8 −0 CHANGELOG.md
  3. +2 −2 Gemfile
  4. +10 −1 manifests/server/puppetserver.pp
  5. +1 −1 metadata.json
  6. +52 −17 spec/classes/puppet_server_puppetserver_spec.rb
  7. +2 −0 spec/support/acceptance/puppetserver.rb
82 changes: 12 additions & 70 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,79 +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 true

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 }}
jobs:
puppet:
name: Puppet
uses: voxpupuli/gha-puppet/.github/workflows/beaker.yml@v1
with:
pidfile_workaround: 'true'
rubocop: false
cache-version: '1'
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog

## [16.1.0](https://github.com/theforeman/puppet-puppet/tree/16.1.0) (2022-03-17)

[Full Changelog](https://github.com/theforeman/puppet-puppet/compare/16.0.0...16.1.0)

**Implemented enhancements:**

- Disable FIPS support within JVM for Puppet [\#828](https://github.com/theforeman/puppet-puppet/pull/828) ([ehelms](https://github.com/ehelms))

## [16.0.0](https://github.com/theforeman/puppet-puppet/tree/16.0.0) (2022-02-07)

[Full Changelog](https://github.com/theforeman/puppet-puppet/compare/15.2.0...16.0.0)
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
11 changes: 10 additions & 1 deletion manifests/server/puppetserver.pp
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,9 @@
# @param server_multithreaded
# Configures the puppetserver to use multithreaded jruby.
#
# @param disable_fips
# Disables FIPS support within the JVM
#
# @example
#
# # configure memory for java < 8
Expand Down Expand Up @@ -140,6 +143,7 @@
$max_open_files = $puppet::server::max_open_files,
$versioned_code_id = $puppet::server::versioned_code_id,
$versioned_code_content = $puppet::server::versioned_code_content,
$disable_fips = $facts['os']['family'] == 'RedHat' and $facts['os']['release']['major'] == '8',
) {
include puppet::server

Expand All @@ -149,7 +153,12 @@

$puppetserver_package = pick($puppet::server::package, 'puppetserver')

$jvm_cmd_arr = ["-Xms${jvm_min_heap_size}", "-Xmx${jvm_max_heap_size}", $jvm_extra_args]
$jvm_heap_arr = ["-Xms${jvm_min_heap_size}", "-Xmx${jvm_max_heap_size}"]
if $disable_fips {
$jvm_cmd_arr = $jvm_heap_arr + ['-Dcom.redhat.fips=false', $jvm_extra_args]
} else {
$jvm_cmd_arr = $jvm_heap_arr + [$jvm_extra_args]
}
$jvm_cmd = strip(join(flatten($jvm_cmd_arr), ' '))

if $facts['os']['family'] == 'FreeBSD' {
Expand Down
2 changes: 1 addition & 1 deletion metadata.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "theforeman-puppet",
"version": "16.0.0",
"version": "16.1.0",
"author": "theforeman",
"summary": "Puppet agent and server configuration",
"license": "GPL-3.0+",
Expand Down
69 changes: 52 additions & 17 deletions spec/classes/puppet_server_puppetserver_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,23 @@
.with_incl('/etc/default/puppetserver')
.with_lens('Shellvars.lns')
}
it {
should contain_augeas('puppet::server::puppetserver::jvm')
.with_changes(['set JAVA_ARGS \'"-Xms2G -Xmx2G"\'', 'set JAVA_BIN /usr/bin/java'])
.with_context('/files/etc/default/puppetserver')
.with_incl('/etc/default/puppetserver')
.with_lens('Shellvars.lns')
}
if facts[:os]['family'] == 'RedHat' and facts[:os]['release']['major'] == '8'
it {
should contain_augeas('puppet::server::puppetserver::jvm')
.with_changes(['set JAVA_ARGS \'"-Xms2G -Xmx2G -Dcom.redhat.fips=false"\'', 'set JAVA_BIN /usr/bin/java'])
.with_context('/files/etc/default/puppetserver')
.with_incl('/etc/default/puppetserver')
.with_lens('Shellvars.lns')
}
else
it {
should contain_augeas('puppet::server::puppetserver::jvm')
.with_changes(['set JAVA_ARGS \'"-Xms2G -Xmx2G"\'', 'set JAVA_BIN /usr/bin/java'])
.with_context('/files/etc/default/puppetserver')
.with_incl('/etc/default/puppetserver')
.with_lens('Shellvars.lns')
}
end
it do
should contain_augeas('puppet::server::puppetserver::jruby_jar')
.with_changes(['rm JRUBY_JAR'])
Expand Down Expand Up @@ -374,6 +384,17 @@
.with_changes(['set puppetserver_java_opts \'"-Xms2G -Xmx2G -XX:foo=bar -XX:bar=foo"\''])
.with_context('/files/etc/rc.conf')
}
elsif facts[:os]['family'] == 'RedHat' and facts[:os]['release']['major'] == '8'
it {
should contain_augeas('puppet::server::puppetserver::jvm')
.with_changes([
'set JAVA_ARGS \'"-Xms2G -Xmx2G -Dcom.redhat.fips=false -XX:foo=bar -XX:bar=foo"\'',
'set JAVA_BIN /usr/bin/java'
])
.with_context('/files/etc/default/puppetserver')
.with_incl('/etc/default/puppetserver')
.with_lens('Shellvars.lns')
}
else
it {
should contain_augeas('puppet::server::puppetserver::jvm')
Expand All @@ -390,16 +411,30 @@

describe 'with cli_args parameter', unless: facts[:osfamily] == 'FreeBSD' do
let(:params) { super().merge(server_jvm_cli_args: '-Djava.io.tmpdir=/var/puppettmp') }
it do
should contain_augeas('puppet::server::puppetserver::jvm')
.with_changes([
'set JAVA_ARGS \'"-Xms2G -Xmx2G"\'',
'set JAVA_BIN /usr/bin/java',
'set JAVA_ARGS_CLI \'"-Djava.io.tmpdir=/var/puppettmp"\''
])
.with_context('/files/etc/default/puppetserver')
.with_incl('/etc/default/puppetserver')
.with_lens('Shellvars.lns')
if facts[:os]['family'] == 'RedHat' and facts[:os]['release']['major'] == '8'
it {
should contain_augeas('puppet::server::puppetserver::jvm')
.with_changes([
'set JAVA_ARGS \'"-Xms2G -Xmx2G -Dcom.redhat.fips=false"\'',
'set JAVA_BIN /usr/bin/java',
'set JAVA_ARGS_CLI \'"-Djava.io.tmpdir=/var/puppettmp"\''
])
.with_context('/files/etc/default/puppetserver')
.with_incl('/etc/default/puppetserver')
.with_lens('Shellvars.lns')
}
else
it {
should contain_augeas('puppet::server::puppetserver::jvm')
.with_changes([
'set JAVA_ARGS \'"-Xms2G -Xmx2G"\'',
'set JAVA_BIN /usr/bin/java',
'set JAVA_ARGS_CLI \'"-Djava.io.tmpdir=/var/puppettmp"\''
])
.with_context('/files/etc/default/puppetserver')
.with_incl('/etc/default/puppetserver')
.with_lens('Shellvars.lns')
}
end
end

Expand Down
2 changes: 2 additions & 0 deletions spec/support/acceptance/puppetserver.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
def unsupported_puppetserver
case host_inventory['facter']['os']['name']
when 'Archlinux'
true
when 'Fedora'
true
when 'Ubuntu'
Expand Down