53 changes: 32 additions & 21 deletions .github/workflows/test-failover.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ on:
description: 'Boolean; whether or not to pause for ssh debugging'
required: true
default: 'false'
log_level:
description: 'Bolt log level'
required: false
default: 'debug'

env:
HONEYCOMB_WRITEKEY: 7f3c63a70eecc61d635917de46bea4e6
Expand All @@ -37,13 +41,12 @@ jobs:
strategy:
fail-fast: false
matrix:
architecture:
- "extra-large-with-dr-and-spare-replica"
version:
- "${{ github.event.inputs.version }}"
image:
- "${{ github.event.inputs.image }}"

architecture:
- "extra-large-with-dr"
steps:
- name: 'Start SSH session'
if: ${{ github.event.inputs.ssh-debugging == 'true' }}
Expand Down Expand Up @@ -89,7 +92,7 @@ jobs:
echo STEP_START=$(date +%s) >> $GITHUB_ENV
echo ::endgroup::
- name: 'Provision test cluster (specified architecture with added DR)'
- name: 'Provision test cluster (XL with spare replica)'
timeout-minutes: 15
run: |
echo ::group::prepare
Expand All @@ -106,13 +109,7 @@ jobs:
--modulepath spec/fixtures/modules \
provider=provision_service \
image=${{ matrix.image }} \
architecture=${{ matrix.architecture }}-with-dr
buildevents cmd $TRACE_ID $STEP_ID 'bolt task run provision::provision_service' -- \
bundle exec bolt bolt task run provision::provision_service \
--modulepath spec/fixtures/modules \
action=provision
platform=${{ matrix.image }} \
vars="role: primary"
architecture=${{ matrix.architecture }}-and-spare-replica
echo ::endgroup::
echo ::group::info:request
Expand All @@ -136,7 +133,7 @@ jobs:
timeout-minutes: 120
run: |
buildevents cmd $TRACE_ID $STEP_ID 'bolt plan run peadm_spec::install_test_cluster' -- \
bundle exec bolt plan run peadm_spec::install_test_cluster \
bundle exec bolt plan run peadm_spec::install_test_cluster --log_level ${{ github.event.inputs.log_level }} \
--inventoryfile spec/fixtures/litmus_inventory.yaml \
--modulepath spec/fixtures/modules \
architecture=${{ matrix.architecture }} \
Expand All @@ -154,11 +151,9 @@ jobs:
- name: 'Perform failover'
run: |
buildevents cmd $TRACE_ID $STEP_ID 'bolt plan run peadm_spec::perform_failover' -- \
bundle exec bolt plan run peadm_spec::perform_failover \
bundle exec bolt plan run peadm_spec::perform_failover --log_level ${{ github.event.inputs.log_level }} \
--inventoryfile spec/fixtures/litmus_inventory.yaml \
--modulepath spec/fixtures/modules \
platform=${{ matrix.image }} \
vars="role: primary"
--modulepath spec/fixtures/modules
- name: "Honeycomb: Record falover time"
if: ${{ always() }}
Expand All @@ -178,20 +173,36 @@ jobs:
done
echo "${HOME}/pause absent, continuing workflow."
- name: Set up yq
uses: frenck/action-setup-yq@v1
with:
version: v4.30.5

- name: 'Update inventory'
run: |
# Remove failed primary
yq -i 'del(.groups[].targets[] | select(.vars.role == "primary"))' spec/fixtures/litmus_inventory.yaml
# Swap primary and replica nodes
sed -i.sedbak 's/primary/__tmp__/;s/spare-replica/__tmp2__/;s/replica/primary/;s/__tmp__/replica/;s/__tmp2__/replica/' \
spec/fixtures/litmus_inventory.yaml
echo ::group::info:inventory
sed -e 's/password: .*/password: "[redacted]"/' < spec/fixtures/litmus_inventory.yaml || true
echo ::endgroup::
- name: 'Upgrade PE on test cluster'
if: ${{ always() && github.event.inputs.version_to_upgrade != '' }}
if: ${{ success() && github.event.inputs.version_to_upgrade != '' }}
timeout-minutes: 120
run: |
buildevents cmd $TRACE_ID $STEP_ID 'bolt plan run peadm_spec::upgrade_test_cluster' -- \
bundle exec bolt plan run peadm_spec::upgrade_test_cluster \
bundle exec bolt plan run peadm_spec::upgrade_test_cluster --log_level ${{ github.event.inputs.log_level }} \
--inventoryfile spec/fixtures/litmus_inventory.yaml \
--modulepath spec/fixtures/modules \
architecture='extra-large-with-dr' \
architecture=${{ matrix.architecture }} \
download_mode='direct' \
version=${{ matrix.version_to_upgrade }}
version=${{ github.event.inputs.version_to_upgrade }}
- name: "Honeycomb: Record upgrade time"
if: ${{ always() && github.event.inputs.version_to_upgrade != '' }}
if: ${{ success() && github.event.inputs.version_to_upgrade != '' }}
run: |
echo ::group::honeycomb
buildevents step $TRACE_ID $STEP_ID $STEP_START 'Upgrade PE on test cluster'
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,4 @@ spec/docker/**/*.tar.gz
spec/docker/**/*.asc
spec/docker/**/files/puppet-enterprise*
spec/docker/.task_cache.json
.vscode/settings.json
24 changes: 15 additions & 9 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,25 @@

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.11.1](https://github.com/puppetlabs/puppetlabs-peadm/tree/v3.11.1) (2023-02-10)
## [v3.12.0](https://github.com/puppetlabs/puppetlabs-peadm/tree/v3.12.0) (2023-02-17)

[Full Changelog](https://github.com/puppetlabs/puppetlabs-peadm/compare/v3.11.0...v3.11.1)
[Full Changelog](https://github.com/puppetlabs/puppetlabs-peadm/compare/v3.11.1...v3.12.0)

### Added

- Remove experimental backup/restore plans [\#337](https://github.com/puppetlabs/puppetlabs-peadm/pull/337) ([timidri](https://github.com/timidri))
- add parameter for setting final state of infrastructure agents after upgrade [\#330](https://github.com/puppetlabs/puppetlabs-peadm/pull/330) ([vchepkov](https://github.com/vchepkov))

### Fixed

- Fix group letter assignments during upgrade [\#336](https://github.com/puppetlabs/puppetlabs-peadm/pull/336) ([timidri](https://github.com/timidri))

## [v3.11.1](https://github.com/puppetlabs/puppetlabs-peadm/tree/v3.11.1) (2023-02-10)

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

### Fixed

- fix variable notation [\#331](https://github.com/puppetlabs/puppetlabs-peadm/pull/331) ([vchepkov](https://github.com/vchepkov))

## [v3.11.0](https://github.com/puppetlabs/puppetlabs-peadm/tree/v3.11.0) (2023-02-01)
Expand Down Expand Up @@ -63,6 +72,7 @@ All notable changes to this project will be documented in this file. The format

### Fixed

- Restart compiler services [\#271](https://github.com/puppetlabs/puppetlabs-peadm/pull/271) ([ody](https://github.com/ody))
- Set additional rules on replica when adding compiler [\#270](https://github.com/puppetlabs/puppetlabs-peadm/pull/270) ([ody](https://github.com/ody))
- Updates documentation [\#269](https://github.com/puppetlabs/puppetlabs-peadm/pull/269) ([ody](https://github.com/ody))

Expand All @@ -76,10 +86,6 @@ All notable changes to this project will be documented in this file. The format
- Support PE 2021.6 and 2019.8.11 [\#260](https://github.com/puppetlabs/puppetlabs-peadm/pull/260) ([reidmv](https://github.com/reidmv))
- Add experimental restore plan [\#250](https://github.com/puppetlabs/puppetlabs-peadm/pull/250) ([reidmv](https://github.com/reidmv))

### Fixed

- Restart compiler services [\#271](https://github.com/puppetlabs/puppetlabs-peadm/pull/271) ([ody](https://github.com/ody))

## [v3.6.0](https://github.com/puppetlabs/puppetlabs-peadm/tree/v3.6.0) (2022-05-04)

[Full Changelog](https://github.com/puppetlabs/puppetlabs-peadm/compare/v3.5.0...v3.6.0)
Expand All @@ -90,8 +96,6 @@ All notable changes to this project will be documented in this file. The format

### Fixed

- Add read map so puppetdb can start on new compiler [\#252](https://github.com/puppetlabs/puppetlabs-peadm/pull/252) ([ody](https://github.com/ody))
- Fix json escaping in `bash\_task\_helper` [\#246](https://github.com/puppetlabs/puppetlabs-peadm/pull/246) ([reidmv](https://github.com/reidmv))
- Fix and document recovery procedure for PSQL [\#243](https://github.com/puppetlabs/puppetlabs-peadm/pull/243) ([ody](https://github.com/ody))

## [v3.5.0](https://github.com/puppetlabs/puppetlabs-peadm/tree/v3.5.0) (2022-04-13)
Expand All @@ -102,10 +106,11 @@ All notable changes to this project will be documented in this file. The format

- Add support for SLES 12 [\#245](https://github.com/puppetlabs/puppetlabs-peadm/pull/245) ([MartyEwings](https://github.com/MartyEwings))
- Add `peadm::add\_database` plan [\#241](https://github.com/puppetlabs/puppetlabs-peadm/pull/241) ([ody](https://github.com/ody))
- Add experimental `peadm::util::code\_sync\_status` plan [\#221](https://github.com/puppetlabs/puppetlabs-peadm/pull/221) ([reidmv](https://github.com/reidmv))

### Fixed

- Add read map so puppetdb can start on new compiler [\#252](https://github.com/puppetlabs/puppetlabs-peadm/pull/252) ([ody](https://github.com/ody))
- Fix json escaping in `bash\_task\_helper` [\#246](https://github.com/puppetlabs/puppetlabs-peadm/pull/246) ([reidmv](https://github.com/reidmv))
- Fix load balancer bug in `peadm::get\_peadm\_config` task [\#244](https://github.com/puppetlabs/puppetlabs-peadm/pull/244) ([reidmv](https://github.com/reidmv))

## [v3.4.0](https://github.com/puppetlabs/puppetlabs-peadm/tree/v3.4.0) (2022-03-08)
Expand All @@ -118,6 +123,7 @@ All notable changes to this project will be documented in this file. The format
- Add support for PE 2021.5 [\#237](https://github.com/puppetlabs/puppetlabs-peadm/pull/237) ([reidmv](https://github.com/reidmv))
- Improve handling of unsuitable LANG settings [\#236](https://github.com/puppetlabs/puppetlabs-peadm/pull/236) ([reidmv](https://github.com/reidmv))
- Add `peadm::backup` plan [\#226](https://github.com/puppetlabs/puppetlabs-peadm/pull/226) ([davidsandilands](https://github.com/davidsandilands))
- Add experimental `peadm::util::code\_sync\_status` plan [\#221](https://github.com/puppetlabs/puppetlabs-peadm/pull/221) ([reidmv](https://github.com/reidmv))

### Fixed

Expand Down
3 changes: 0 additions & 3 deletions REFERENCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,11 +93,8 @@
* `peadm::add_replica`: Replace a replica host for a Standard or Large architecture.
Supported use cases:
1: The existing replica is broken, we have a fresh new VM we want to provision the replica to.
The new replica should have the same certname as the broken one.
* `peadm::backup`: Backup the core user settings for puppet infrastructure
* `peadm::misc::divert_code_manager`: This plan exists to account for a scenario where a PE XL
* `peadm::modify_cert_extensions`
* `peadm::restore`: Restore the core user settings for puppet infrastructure from backup
* `peadm::subplans::component_install`: Install a new PEADM component
* `peadm::subplans::configure`: Configure first-time classification and DR setup
* `peadm::subplans::db_populate`: Destructively (re)populates a new or existing database with the contents or a known good source
Expand Down
74 changes: 0 additions & 74 deletions documentation/backup.md

This file was deleted.

46 changes: 0 additions & 46 deletions documentation/restore.md

This file was deleted.

2 changes: 1 addition & 1 deletion functions/assert_supported_architecture.pp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ function peadm::assert_supported_architecture (
# lint:ignore:strict_indent
default: { # Invalid
out::message(inline_epp(@(HEREDOC)))
Invalid architecture! Recieved:
Invalid architecture! Received:
- primary
<% if $replica_host { -%>
- primary-replica
Expand Down
4 changes: 2 additions & 2 deletions functions/assert_supported_pe_version.pp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ function peadm::assert_supported_pe_version (
if $permit_unsafe_versions {
# lint:ignore:strict_indent
warning(@("WARN"/L))
WARNING: Permitting unsafe PE versions. This is not supported or tested.
WARNING: Permitting unsafe PE versions. This is not supported or tested.
Proceeding with this action could result in a broken PE Infrastructure.
| WARN
# lint:endignore
Expand All @@ -21,7 +21,7 @@ function peadm::assert_supported_pe_version (
if (!$supported and $permit_unsafe_versions) {
# lint:ignore:strict_indent
warning(@("WARN"/L))
WARNING: PE version ${version} is NOT SUPPORTED!
WARNING: PE version ${version} is NOT SUPPORTED!
| WARN
# lint:endignore
}
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": "puppetlabs-peadm",
"version": "3.11.1",
"version": "3.12.0",
"author": "puppetlabs",
"summary": "Bolt plans used to deploy an at-scale Puppet Enterprise architecture",
"license": "Apache-2.0",
Expand Down
8 changes: 5 additions & 3 deletions plans/add_replica.pp
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@
# @summary Replace a replica host for a Standard or Large architecture.
# Supported use cases:
# 1: The existing replica is broken, we have a fresh new VM we want to provision the replica to.
# The new replica should have the same certname as the broken one.
# @param primary_host - The hostname and certname of the primary Puppet server
# @param replica_host - The hostname and certname of the replica VM
# @param replica_postgresql_host - The hostname and certname of the host with the replica PE-PosgreSQL database.
# @param replica_postgresql_host - The hostname and certname of the host with the replica PE-PosgreSQL database.
# @param token_file - (optional) the token file in a different location than the default.
#
# Can be a separate host in an XL architecture, or undef in Standard or Large.
plan peadm::add_replica(
# Standard or Large
Expand Down Expand Up @@ -119,7 +120,8 @@
# Race condition, where the provision command checks PuppetDB status and
# probably gets "starting", but fails out because that's not "running".
# Can remove flag when that issue is fixed.
legacy => true,
legacy => false,
# _catch_errors => true, # testing
)

# start puppet service
Expand Down
Loading