Showing with 42 additions and 50 deletions.
  1. +1 −1 .sync.yml
  2. +9 −0 CHANGELOG.md
  3. +9 −9 README.md
  4. +1 −1 Rakefile
  5. +1 −1 metadata.json
  6. +1 −1 plans/add_compiler.pp
  7. +5 −12 spec/plans/add_replica_spec.rb
  8. +4 −3 spec/plans/subplans/configure_spec.rb
  9. +4 −10 spec/plans/subplans/install_spec.rb
  10. +7 −12 spec/plans/upgrade_spec.rb
2 changes: 1 addition & 1 deletion .sync.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Gemfile:
Rakefile:
changelog_since_tag: '2.5.0'
extras:
- 'PuppetSyntax.exclude_paths = ["spec/acceptance/**/plans/**/*.pp", "vendor/**/*"]'
- 'PuppetSyntax.exclude_paths = ["plans/**/*.pp", "spec/acceptance/**/plans/**/*.pp", "vendor/**/*"]'
spec/spec_helper.rb:
mock_with: ':rspec'
.gitignore:
Expand Down
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,15 @@

All 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).

## [v3.0.1](https://github.com/puppetlabs/puppetlabs-peadm/tree/v3.0.1) (2021-06-30)

[Full Changelog](https://github.com/puppetlabs/puppetlabs-peadm/compare/v3.0.0...v3.0.1)

### Fixed

- Add missing parenthesis to add\_compiler plan [\#177](https://github.com/puppetlabs/puppetlabs-peadm/pull/177) ([timidri](https://github.com/timidri))
- Use absolute links so they render properly on the Forge [\#175](https://github.com/puppetlabs/puppetlabs-peadm/pull/175) ([binford2k](https://github.com/binford2k))

## [v3.0.0](https://github.com/puppetlabs/puppetlabs-peadm/tree/v3.0.0) (2021-06-29)

[Full Changelog](https://github.com/puppetlabs/puppetlabs-peadm/compare/2.5.0...v3.0.0)
Expand Down
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,21 +58,21 @@ The normal usage pattern for peadm is as follows.

Follow the links below to usage instructions for each peadm plan.

* [Install](documentation/install.md)
* [Upgrade](documentation/upgrade.md)
* [Convert](documentation/convert.md)
* [Status](documentation/status.md)
* [Install](https://github.com/puppetlabs/puppetlabs-peadm/blob/main/documentation/install.md)
* [Upgrade](https://github.com/puppetlabs/puppetlabs-peadm/blob/main/documentation/upgrade.md)
* [Convert](https://github.com/puppetlabs/puppetlabs-peadm/blob/main/documentation/convert.md)
* [Status](https://github.com/puppetlabs/puppetlabs-peadm/blob/main/documentation/status.md)

## Reference

Additional documentation and information pertaining to various aspects or elements of peadm.

* [DR Component Recovery](documentation/recovery.md)
* [DR Component Recovery](https://github.com/puppetlabs/puppetlabs-peadm/blob/main/documentation/recovery.md)
* [PE Architecture Documentation](https://puppet.com/docs/pe/latest/choosing_an_architecture.html)
* [Classification](documentation/classification.md)
* [Architectures](documentation/architectures.md)
* [Testing](documentation/pre_post_checks.md)
* [Docker Based Examples](documentation/docker_examples.md)
* [Classification](https://github.com/puppetlabs/puppetlabs-peadm/blob/main/documentation/classification.md)
* [Architectures](https://github.com/puppetlabs/puppetlabs-peadm/blob/main/documentation/architectures.md)
* [Testing](https://github.com/puppetlabs/puppetlabs-peadm/blob/main/documentation/pre_post_checks.md)
* [Docker Based Examples](https://github.com/puppetlabs/puppetlabs-peadm/blob/main/documentation/docker_examples.md)

## Getting Help

Expand Down
2 changes: 1 addition & 1 deletion Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -87,4 +87,4 @@ EOM
end
end

PuppetSyntax.exclude_paths = ["spec/acceptance/**/plans/**/*.pp", "vendor/**/*"]
PuppetSyntax.exclude_paths = ["plans/**/*.pp", "spec/acceptance/**/plans/**/*.pp", "vendor/**/*"]
2 changes: 1 addition & 1 deletion metadata.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "puppetlabs-peadm",
"version": "3.0.0",
"version": "3.0.1",
"author": "puppetlabs",
"summary": "Bolt plans used to deploy an at-scale Puppet Enterprise architecture",
"license": "Apache-2.0",
Expand Down
2 changes: 1 addition & 1 deletion plans/add_compiler.pp
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
run_command('systemctl start puppet.service', peadm::flatten_compact([
$primary_postgresql_target,
$compiler_target,
])
]))

return("Adding or replacing compiler ${$compiler_target.peadm::certname()} succeeded.")

Expand Down
17 changes: 5 additions & 12 deletions spec/plans/add_replica_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,18 @@
describe 'peadm::install' do
include BoltSpec::Plans

def allow_standard_non_returning_calls(params)
def allow_standard_non_returning_calls
allow_apply
allow_task('peadm::agent_install')
allow_task('peadm::ssl_clean')
allow_task('peadm::submit_csr')
allow_task('peadm::sign_csr')
allow_task('peadm::puppet_runonce')
allow_task('peadm::provision_replica')
allow_command('systemctl start puppet.service')
allow_command("puppet infrastructure forget #{params['replica_host']}")
allow_command("puppet node purge #{params['replica_host']}")
allow_any_task
allow_any_command
end

describe 'basic functionality' do
let(:params) { { 'primary_host' => 'primary', 'replica_host' => 'replica' } }
let(:certdata) { { 'certname' => 'primary', 'extensions' => { '1.3.6.1.4.1.34380.1.1.9813' => 'A' } } }

it 'runs successfully when the primary doesn\'t have alt-names' do
allow_standard_non_returning_calls(params)
allow_standard_non_returning_calls
expect_task('peadm::cert_data').always_return(certdata)
expect_task('peadm::agent_install')
.with_params({ 'server' => 'primary',
Expand All @@ -37,7 +30,7 @@ def allow_standard_non_returning_calls(params)
end

it 'runs successfully when the primary has alt-names' do
allow_standard_non_returning_calls(params)
allow_standard_non_returning_calls
expect_task('peadm::cert_data').always_return(certdata.merge({ 'dns-alt-names' => ['primary', 'alt'] }))
expect_task('peadm::agent_install')
.with_params({ 'server' => 'primary',
Expand Down
7 changes: 4 additions & 3 deletions spec/plans/subplans/configure_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@

describe 'Standard architecture without DR' do
it 'runs successfully' do
expect_task('peadm::read_file').always_return({ 'content' => 'mock' })
expect_task('peadm::puppet_runonce')
expect_command('systemctl start puppet')
allow_apply
allow_any_task
allow_any_plan
allow_any_command

expect_task('peadm::read_file').always_return({ 'content' => 'mock' })
expect_task('peadm::provision_replica').not_be_called
expect_task('peadm::code_manager').not_be_called

Expand Down
14 changes: 4 additions & 10 deletions spec/plans/subplans/install_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,16 @@
include BoltSpec::Plans

it 'minimum variables to run' do
allow_any_task
allow_any_plan
allow_any_command

allow_task('peadm::precheck').return_for_targets(
'primary' => {
'hostname' => 'primary',
'platform' => 'el-7.11-x86_64'
},
)
expect_task('peadm::mkdir_p_file').be_called_times(5)
expect_plan('peadm::util::retrieve_and_upload')
expect_task('peadm::read_file')
expect_task('peadm::pe_install')
expect_command('systemctl stop pe-puppetdb')
expect_command('systemctl start pe-puppetdb')
expect_task('peadm::rbac_token')
expect_task('peadm::code_manager')
expect_task('peadm::puppet_runonce').be_called_times(2)
expect_task('peadm::wait_until_service_ready')

#########
## <🤮>
Expand Down
19 changes: 7 additions & 12 deletions spec/plans/upgrade_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,15 @@
end

it 'minimum variables to run' do
allow_apply
allow_any_task
allow_any_plan
allow_any_command
allow_out_message
expect_task('peadm::cert_data').return_for_targets(
'primary' => trustedjson,
)

expect_task('peadm::cert_data').return_for_targets('primary' => trustedjson)
expect_task('peadm::read_file').always_return({ 'content' => 'mock' })
expect_task('peadm::precheck')
expect_plan('peadm::util::retrieve_and_upload')
expect_command('systemctl stop puppet')
allow_task('peadm::puppet_runonce')
expect_plan('peadm::modify_cert_extensions')
allow_apply
expect_task('peadm::pe_install')
allow_task('peadm::puppet_infra_upgrade')
expect_task('service')

expect(run_plan('peadm::upgrade', 'primary_host' => 'primary', 'version' => '2019.8.6')).to be_ok
end
end