From 6f88c9a692897f86bd08c3ec16dd7e3f03ff39fe Mon Sep 17 00:00:00 2001 From: petergmurphy Date: Thu, 13 Feb 2025 11:01:24 +0000 Subject: [PATCH 01/30] temp remove CI tests --- .github/workflows/README.md | 26 -- .github/workflows/add-to-project.yml | 16 -- .github/workflows/auto_release.yml | 62 ----- .github/workflows/ci.yml | 18 -- .github/workflows/mend.yml | 17 -- .github/workflows/nightly.yml | 18 -- .github/workflows/release-prep.yml | 15 -- .github/workflows/release.yml | 8 - .github/workflows/spec.yml | 90 ------- .../workflows/test-add-compiler-matrix.yml | 105 -------- .github/workflows/test-add-compiler.yaml | 115 --------- .../workflows/test-add-replica-matrix.yaml | 112 --------- .github/workflows/test-add-replica.yaml | 121 --------- .../test-backup-restore-migration.yaml | 217 ---------------- .github/workflows/test-backup-restore.yaml | 231 ------------------ .github/workflows/test-failover.yaml | 140 ----------- .../workflows/test-fips-install-matrix.yaml | 101 -------- .../workflows/test-install-latest-dev.yaml | 120 --------- ...est-install-latest-xlarge-dev-nightly.yaml | 106 -------- .github/workflows/test-install-matrix.yaml | 99 -------- .github/workflows/test-install-rhel-9.yaml | 99 -------- .github/workflows/test-install.yaml | 107 -------- .github/workflows/test-legacy-compilers.yaml | 161 ------------ .github/workflows/test-legacy-upgrade.yaml | 205 ---------------- .../workflows/test-upgrade-latest-dev.yaml | 135 ---------- ...est-upgrade-latest-xlarge-dev-nightly.yaml | 96 -------- .github/workflows/test-upgrade-matrix.yaml | 139 ----------- .github/workflows/test-upgrade.yaml | 130 ---------- .github/workflows/yamlformatter.yml | 40 --- 29 files changed, 2849 deletions(-) delete mode 100644 .github/workflows/README.md delete mode 100644 .github/workflows/add-to-project.yml delete mode 100644 .github/workflows/auto_release.yml delete mode 100644 .github/workflows/ci.yml delete mode 100644 .github/workflows/mend.yml delete mode 100644 .github/workflows/nightly.yml delete mode 100644 .github/workflows/release-prep.yml delete mode 100644 .github/workflows/release.yml delete mode 100644 .github/workflows/spec.yml delete mode 100644 .github/workflows/test-add-compiler-matrix.yml delete mode 100644 .github/workflows/test-add-compiler.yaml delete mode 100644 .github/workflows/test-add-replica-matrix.yaml delete mode 100644 .github/workflows/test-add-replica.yaml delete mode 100644 .github/workflows/test-backup-restore-migration.yaml delete mode 100644 .github/workflows/test-backup-restore.yaml delete mode 100644 .github/workflows/test-failover.yaml delete mode 100644 .github/workflows/test-fips-install-matrix.yaml delete mode 100644 .github/workflows/test-install-latest-dev.yaml delete mode 100644 .github/workflows/test-install-latest-xlarge-dev-nightly.yaml delete mode 100644 .github/workflows/test-install-matrix.yaml delete mode 100644 .github/workflows/test-install-rhel-9.yaml delete mode 100644 .github/workflows/test-install.yaml delete mode 100644 .github/workflows/test-legacy-compilers.yaml delete mode 100644 .github/workflows/test-legacy-upgrade.yaml delete mode 100644 .github/workflows/test-upgrade-latest-dev.yaml delete mode 100644 .github/workflows/test-upgrade-latest-xlarge-dev-nightly.yaml delete mode 100644 .github/workflows/test-upgrade-matrix.yaml delete mode 100644 .github/workflows/test-upgrade.yaml delete mode 100644 .github/workflows/yamlformatter.yml diff --git a/.github/workflows/README.md b/.github/workflows/README.md deleted file mode 100644 index d2269b66a..000000000 --- a/.github/workflows/README.md +++ /dev/null @@ -1,26 +0,0 @@ -# PEADM Workflows for Github Actions - -These workflows enable acceptance testing of peadm plans using Github Actions. The Puppet Cloud CI tool from the IAC team is used to provision VMs for testing, and a fixtures module, peadm\_spec, is used to run Bolt-based testing plans. The fixtures module is located in the spec/acceptance/peadm\_spec directory. - -## Using workflows - -Most workflows start with the same core functionality: provision Cloud CI VMs, then use peadm::provision to install PE. If the installation is successfull, more testing may be performed after that. - -If a workflow supports ssh debugging, an optional extra step is added to permit users to ssh into the runner VM prior to the workflow kicking off properly. The credentials and ngrok configuration to enable this must be set as secrets on the Github repository. Once connected, the user can resume flow by touching a "continue" file, and, if they would like flow to pause before tearing down VMs, touch a "pause" file as well. When the pause file is removed, the tear-down will resume. - -There are six supported architectures for most tests: - -* standard -* standard-with-dr -* large -* large-with-dr -* extra-large -* extra-large-with-dr - -### PR Test ### - -PRs are tested ONLY when a review is requested. This is to prevent unnecessary and expensive testing runs kicking off simply when filing a PR, waiting instead until a user signals the PR is ready for testing by requesting a review. - -### Note for maintainers ### - -The `steps:` of each of these three workflows are identical, with the exception of the first step in the debugging flow (which is the ssh step). When modifying the steps of any flow, the others should therefore be updatable with a simple full copy-paste. At some point we should wrap these up into composite flows of their own. diff --git a/.github/workflows/add-to-project.yml b/.github/workflows/add-to-project.yml deleted file mode 100644 index af10e834d..000000000 --- a/.github/workflows/add-to-project.yml +++ /dev/null @@ -1,16 +0,0 @@ ---- -name: Add new issue to Solarch project -on: - issues: - types: [opened] -jobs: - add-to-project: - name: Add issue to project - runs-on: ubuntu-latest - steps: - - uses: actions/add-to-project@v1.0.2 - with: - # You can target a repository in a different organization - # to the issue - project-url: https://github.com/orgs/puppetlabs/projects/55 - github-token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/auto_release.yml b/.github/workflows/auto_release.yml deleted file mode 100644 index b80e8641a..000000000 --- a/.github/workflows/auto_release.yml +++ /dev/null @@ -1,62 +0,0 @@ ---- -name: Auto release -on: - workflow_dispatch: -env: - CHANGELOG_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} -jobs: - auto_release: - name: Automatic release prep - runs-on: ubuntu-20.04 - steps: - - name: Checkout Source - if: ${{ github.repository_owner == 'puppetlabs' }} - uses: actions/checkout@v4 - with: - fetch-depth: 0 - persist-credentials: false - - name: PDK Release prep - uses: docker://puppet/puppet-dev-tools:4.x - with: - args: pdk release prep --force --debug - env: - CHANGELOG_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: Get Version - if: ${{ github.repository_owner == 'puppetlabs' }} - id: gv - run: | - echo "::set-output name=ver::$(jq --raw-output .version metadata.json)" - - name: Check if a release is necessary - if: ${{ github.repository_owner == 'puppetlabs' }} - id: check - run: | - git diff --quiet CHANGELOG.md && echo "::set-output name=release::false" || echo "::set-output name=release::true" - - name: Commit changes - if: ${{ github.repository_owner == 'puppetlabs' && steps.check.outputs.release == 'true' }} - run: | - git config --local user.email "${{ github.repository_owner }}@users.noreply.github.com" - git config --local user.name "GitHub Action" - git add . - git commit -m "Release prep v${{ steps.gv.outputs.ver }}" - - name: Create Pull Request - id: cpr - uses: puppetlabs/peter-evans-create-pull-request@v3 - if: ${{ github.repository_owner == 'puppetlabs' && steps.check.outputs.release == 'true' }} - with: - token: ${{ secrets.GITHUB_TOKEN }} - commit-message: Release prep v${{ steps.gv.outputs.ver }} - branch: release-prep - delete-branch: true - title: Release prep v${{ steps.gv.outputs.ver }} - body: | - Automated release-prep through [pdk-templates](https://github.com/puppetlabs/pdk-templates/blob/main/moduleroot/.github/workflows/auto_release.yml.erb) from commit ${{ github.sha }}. - Please verify before merging: - - [ ] last [nightly](https://github.com/${{ github.repository }}/actions/workflows/nightly.yml) run is green - - [ ] [Changelog](https://github.com/${{ github.repository }}/blob/release-prep/CHANGELOG.md) is readable and has no unlabeled pull requests - - [ ] Ensure the [changelog](https://github.com/${{ github.repository }}/blob/release-prep/CHANGELOG.md) version and [metadata](https://github.com/${{ github.repository }}/blob/release-prep/metadata.json) version match - labels: maintenance - - name: PR outputs - if: ${{ github.repository_owner == 'puppetlabs' && steps.check.outputs.release == 'true' }} - run: |- - echo "Pull Request Number - ${{ steps.cpr.outputs.pull-request-number }}" - echo "Pull Request URL - ${{ steps.cpr.outputs.pull-request-url }}" diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml deleted file mode 100644 index 5b71bfcff..000000000 --- a/.github/workflows/ci.yml +++ /dev/null @@ -1,18 +0,0 @@ ---- -name: ci -on: - pull_request: - branches: [main] - workflow_dispatch: -jobs: - Spec: - if: ${{ github.repository_owner == 'puppetlabs' }} - uses: puppetlabs/cat-github-actions/.github/workflows/module_ci.yml@main - secrets: inherit - Acceptance: - if: ${{ github.repository_owner == 'puppetlabs' }} - needs: Spec - uses: puppetlabs/cat-github-actions/.github/workflows/module_acceptance.yml@main - with: - flags: --provision-service - secrets: inherit diff --git a/.github/workflows/mend.yml b/.github/workflows/mend.yml deleted file mode 100644 index 356894f3f..000000000 --- a/.github/workflows/mend.yml +++ /dev/null @@ -1,17 +0,0 @@ ---- -name: mend -on: - pull_request: - types: [closed] - branches: [main] - schedule: - - cron: 0 0 * * * - workflow_dispatch: -jobs: - mend: - if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' - || (github.event.pull_request.merged == true && github.ref == 'refs/heads/main') - uses: puppetlabs/cat-github-actions/.github/workflows/tooling_mend_ruby.yml@main - secrets: inherit - with: - product_name: InsTalleR diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml deleted file mode 100644 index d1d53a215..000000000 --- a/.github/workflows/nightly.yml +++ /dev/null @@ -1,18 +0,0 @@ ---- -name: nightly -on: - schedule: - - cron: 0 0 * * * - workflow_dispatch: -jobs: - Spec: - if: ${{ github.repository_owner == 'puppetlabs' }} - uses: puppetlabs/cat-github-actions/.github/workflows/module_ci.yml@main - secrets: inherit - Acceptance: - if: ${{ github.repository_owner == 'puppetlabs' }} - needs: Spec - uses: puppetlabs/cat-github-actions/.github/workflows/module_acceptance.yml@main - with: - flags: --provision-service - secrets: inherit diff --git a/.github/workflows/release-prep.yml b/.github/workflows/release-prep.yml deleted file mode 100644 index 0511ff7d7..000000000 --- a/.github/workflows/release-prep.yml +++ /dev/null @@ -1,15 +0,0 @@ ---- -name: Release Prep -on: - workflow_dispatch: - inputs: - version: - description: Module version to be released. Must be a valid semver string. - (1.2.3) - required: true -jobs: - release_prep: - uses: puppetlabs/cat-github-actions/.github/workflows/module_release_prep.yml@main - with: - version: ${{ github.event.inputs.version }} - secrets: inherit diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml deleted file mode 100644 index f856ef68e..000000000 --- a/.github/workflows/release.yml +++ /dev/null @@ -1,8 +0,0 @@ ---- -name: Publish module -on: - workflow_dispatch: -jobs: - release: - uses: puppetlabs/cat-github-actions/.github/workflows/module_release.yml@main - secrets: inherit diff --git a/.github/workflows/spec.yml b/.github/workflows/spec.yml deleted file mode 100644 index 0880d1c6f..000000000 --- a/.github/workflows/spec.yml +++ /dev/null @@ -1,90 +0,0 @@ ---- -name: Spec Tests -on: - schedule: - - cron: 0 0 * * * - workflow_dispatch: - pull_request: - paths: - - .github/workflows/**/* - - spec/**/* - - lib/**/* - - tasks/**/* - - functions/**/* - - types/**/* - - plans/**/* - - hiera/**/* - - manifests/**/* - - templates/**/* - - files/**/* - - metadata.json - - Rakefile - - Gemfile - - provision.yaml - - .rspec - - .rubocop.yml - - .puppet-lint.rc - - .fixtures.yml -jobs: - setup_matrix: - name: Setup Test Matrix - runs-on: ubuntu-20.04 - outputs: - spec_matrix: ${{ steps.get-matrix.outputs.spec_matrix }} - steps: - - name: Checkout Source - uses: actions/checkout@v4 - if: ${{ github.repository_owner == 'puppetlabs' }} - - name: Activate Ruby 2.7 - uses: ruby/setup-ruby@v1 - if: ${{ github.repository_owner == 'puppetlabs' }} - with: - ruby-version: '2.7' - bundler-cache: true - - name: Print bundle environment - if: ${{ github.repository_owner == 'puppetlabs' }} - run: | - echo ::group::bundler environment - bundle env - echo ::endgroup:: - - name: Run Static & Syntax Tests - if: ${{ github.repository_owner == 'puppetlabs' }} - run: | - bundle exec rake validate lint check rubocop - - name: Setup Spec Test Matrix - id: get-matrix - run: | - if [ '${{ github.repository_owner }}' == 'puppetlabs' ]; then - bundle exec matrix_from_metadata_v2 - else - echo "::set-output name=spec_matrix::{}" - fi - Spec: - name: 'Spec Tests (Puppet: ${{matrix.puppet_version}}, Ruby Ver: ${{matrix.ruby_version}})' - needs: [setup_matrix] - if: ${{ needs.setup_matrix.outputs.spec_matrix != '{}' }} - runs-on: ubuntu-20.04 - strategy: - fail-fast: false - matrix: ${{fromJson(needs.setup_matrix.outputs.spec_matrix)}} - env: - PUPPET_GEM_VERSION: ${{ matrix.puppet_version }} - FACTER_GEM_VERSION: https://github.com/puppetlabs/facter#main - steps: - - run: | - echo "SANITIZED_PUPPET_VERSION=$(echo '${{ matrix.puppet_version }}' | sed 's/~> //g')" >> $GITHUB_ENV - - name: Checkout Source - uses: actions/checkout@v4 - - name: Activate Ruby ${{ matrix.ruby_version }} - uses: ruby/setup-ruby@v1 - with: - ruby-version: ${{matrix.ruby_version}} - bundler-cache: true - - name: Print bundle environment - run: | - echo ::group::bundler environment - bundle env - echo ::endgroup:: - - name: Run parallel_spec tests - run: |- - bundle exec rake parallel_spec diff --git a/.github/workflows/test-add-compiler-matrix.yml b/.github/workflows/test-add-compiler-matrix.yml deleted file mode 100644 index 6da1fddc6..000000000 --- a/.github/workflows/test-add-compiler-matrix.yml +++ /dev/null @@ -1,105 +0,0 @@ ---- -name: Add compiler matrix -on: - pull_request: - paths: - - .github/workflows/**/* - - spec/**/* - - lib/**/* - - tasks/**/* - - functions/**/* - - types/**/* - - plans/**/* - - hiera/**/* - - manifests/**/* - - templates/**/* - - files/**/* - - metadata.json - - Rakefile - - Gemfile - - provision.yaml - - .rspec - - .rubocop.yml - - .puppet-lint.rc - - .fixtures.yml - branches: [main] - workflow_dispatch: {} -jobs: - test-add-compiler: - name: PE ${{ matrix.version }} ${{ matrix.architecture }} on ${{ matrix.image }} - runs-on: ubuntu-20.04 - env: - BOLT_GEM: true - BOLT_DISABLE_ANALYTICS: true - LANG: en_US.UTF-8 - strategy: - fail-fast: false - matrix: - architecture: [standard, large, extra-large] - version: [2021.7.9, 2023.8.1, 2025.0.0] - image: [almalinux-cloud/almalinux-8] - steps: - - name: Checkout Source - uses: actions/checkout@v4 - - name: Activate Ruby 2.7 - uses: ruby/setup-ruby@v1 - with: - ruby-version: '2.7' - bundler-cache: true - - name: Print bundle environment - if: ${{ github.repository_owner == 'puppetlabs' }} - run: | - echo ::group::info:bundler - bundle env - echo ::endgroup:: - - name: Provision test cluster - timeout-minutes: 15 - run: | - echo ::group::prepare - mkdir -p $HOME/.ssh - echo 'Host *' > $HOME/.ssh/config - echo ' ServerAliveInterval 150' >> $HOME/.ssh/config - echo ' ServerAliveCountMax 2' >> $HOME/.ssh/config - bundle exec rake spec_prep - echo ::endgroup:: - echo ::group::provision - bundle exec bolt plan run peadm_spec::provision_test_cluster \ - --modulepath spec/fixtures/modules \ - provider=provision_service \ - image=${{ matrix.image }} \ - architecture=${{ matrix.architecture }}-with-extra-compiler - echo ::endgroup:: - echo ::group::info:request - cat request.json || true; echo - echo ::endgroup:: - echo ::group::info:inventory - sed -e 's/password: .*/password: "[redacted]"/' < spec/fixtures/litmus_inventory.yaml || true - echo ::endgroup:: - - name: Install PE on test cluster - timeout-minutes: 120 - run: | - bundle exec bolt plan run peadm_spec::install_test_cluster \ - --inventoryfile spec/fixtures/litmus_inventory.yaml \ - --modulepath spec/fixtures/modules \ - architecture=${{ matrix.architecture }} \ - console_password=${{ secrets.CONSOLE_PASSWORD }} \ - version=${{ matrix.version }} - - name: Run add_compilers plan - timeout-minutes: 50 - run: | - bundle exec bolt plan run peadm_spec::add_compilers -v \ - --inventoryfile spec/fixtures/litmus_inventory.yaml \ - --modulepath spec/fixtures/modules \ - architecture=${{ matrix.architecture }} - - name: Tear down test cluster - if: ${{ always() }} - continue-on-error: true - run: |- - if [ -f spec/fixtures/litmus_inventory.yaml ]; then - echo ::group::tear_down - bundle exec rake 'litmus:tear_down' - echo ::endgroup:: - echo ::group::info:request - cat request.json || true; echo - echo ::endgroup:: - fi diff --git a/.github/workflows/test-add-compiler.yaml b/.github/workflows/test-add-compiler.yaml deleted file mode 100644 index 46eeedc4f..000000000 --- a/.github/workflows/test-add-compiler.yaml +++ /dev/null @@ -1,115 +0,0 @@ ---- -name: Add Compiler test -on: - workflow_dispatch: - inputs: - image: - description: GCP image for test cluster - required: true - default: almalinux-cloud/almalinux-8 - architecture: - description: PE architecture to test - required: true - default: large - version: - description: PE version to install - required: true - default: 2023.8.1 - ssh-debugging: - description: Boolean; whether or not to pause for ssh debugging - required: true - default: 'false' -jobs: - test-add-compiler: - name: PE ${{ matrix.version }} ${{ matrix.architecture }} on ${{ matrix.image }} - runs-on: ubuntu-20.04 - env: - BOLT_GEM: true - BOLT_DISABLE_ANALYTICS: true - LANG: en_US.UTF-8 - strategy: - fail-fast: false - matrix: - architecture: ['${{ github.event.inputs.architecture }}'] - version: ['${{ github.event.inputs.version }}'] - image: ['${{ github.event.inputs.image }}'] - steps: - - name: Start SSH session - if: ${{ github.event.inputs.ssh-debugging == 'true' }} - uses: luchihoratiu/debug-via-ssh@main - with: - NGROK_AUTH_TOKEN: ${{ secrets.NGROK_AUTH_TOKEN }} - SSH_PASS: ${{ secrets.SSH_PASS }} - - name: Checkout Source - uses: actions/checkout@v4 - - name: Activate Ruby 2.7 - uses: ruby/setup-ruby@v1 - with: - ruby-version: '2.7' - bundler-cache: true - - name: Print bundle environment - if: ${{ github.repository_owner == 'puppetlabs' }} - run: | - echo ::group::info:bundler - bundle env - echo ::endgroup:: - - name: Provision test cluster (specified architecture with added compiler) - timeout-minutes: 15 - run: | - echo ::group::prepare - mkdir -p $HOME/.ssh - echo 'Host *' > $HOME/.ssh/config - echo ' ServerAliveInterval 150' >> $HOME/.ssh/config - echo ' ServerAliveCountMax 2' >> $HOME/.ssh/config - bundle exec rake spec_prep - echo ::endgroup:: - echo ::group::provision - bundle exec bolt plan run peadm_spec::provision_test_cluster \ - --modulepath spec/fixtures/modules \ - provider=provision_service \ - image=${{ matrix.image }} \ - architecture=${{ matrix.architecture }}-with-extra-compiler - echo ::endgroup:: - echo ::group::info:request - cat request.json || true; echo - echo ::endgroup:: - echo ::group::info:inventory - sed -e 's/password: .*/password: "[redacted]"/' < spec/fixtures/litmus_inventory.yaml || true - echo ::endgroup:: - - name: Install PE on test cluster - timeout-minutes: 120 - run: | - bundle exec bolt plan run peadm_spec::install_test_cluster \ - --inventoryfile spec/fixtures/litmus_inventory.yaml \ - --modulepath spec/fixtures/modules \ - architecture=${{ matrix.architecture }} \ - version=${{ matrix.version }} \ - console_password=${{ secrets.CONSOLE_PASSWORD }} - - name: Run add_compilers plan - timeout-minutes: 50 - run: | - bundle exec bolt plan run peadm_spec::add_compilers -v \ - --inventoryfile spec/fixtures/litmus_inventory.yaml \ - --modulepath spec/fixtures/modules \ - architecture=${{ matrix.architecture }} \ - --stream - - name: Wait as long as the file ${HOME}/pause file is present - if: ${{ always() && github.event.inputs.ssh-debugging == 'true' }} - run: | - while [ -f "${HOME}/pause" ] ; do - echo "${HOME}/pause present, sleeping for 60 seconds..." - sleep 60 - done - echo "${HOME}/pause absent, continuing workflow." - - name: Tear down test cluster - if: ${{ always() }} - continue-on-error: true - run: |- - if [ -f spec/fixtures/litmus_inventory.yaml ]; then - echo ::group::tear_down - bundle exec rake 'litmus:tear_down' - echo ::endgroup:: - echo ::group::info:request - cat request.json || true; echo - echo ::endgroup:: - fi diff --git a/.github/workflows/test-add-replica-matrix.yaml b/.github/workflows/test-add-replica-matrix.yaml deleted file mode 100644 index a4cb89f61..000000000 --- a/.github/workflows/test-add-replica-matrix.yaml +++ /dev/null @@ -1,112 +0,0 @@ ---- -name: Add replica matrix -on: - pull_request: - paths: - - .github/workflows/**/* - - spec/**/* - - lib/**/* - - tasks/**/* - - functions/**/* - - types/**/* - - plans/**/* - - hiera/**/* - - manifests/**/* - - templates/**/* - - files/**/* - - metadata.json - - Rakefile - - Gemfile - - provision.yaml - - .rspec - - .rubocop.yml - - .puppet-lint.rc - - .fixtures.yml - branches: [main] - workflow_dispatch: {} -jobs: - test-add-replica: - name: PE ${{ matrix.version }} ${{ matrix.architecture }} on ${{ matrix.image }} - runs-on: ubuntu-20.04 - env: - BOLT_GEM: true - BOLT_DISABLE_ANALYTICS: true - LANG: en_US.UTF-8 - strategy: - fail-fast: false - matrix: - architecture: [standard, standard-with-dr, large, extra-large] - version: [2023.8.1, 2025.0.0] - image: [almalinux-cloud/almalinux-8] - steps: - - name: Checkout Source - uses: actions/checkout@v4 - - name: Activate Ruby 2.7 - uses: ruby/setup-ruby@v1 - with: - ruby-version: '2.7' - bundler-cache: true - - name: Print bundle environment - if: ${{ github.repository_owner == 'puppetlabs' }} - run: | - echo ::group::info:bundler - bundle env - echo ::endgroup:: - - name: Provision test cluster (specified architecture and a spare replica) - timeout-minutes: 15 - run: | - echo ::group::prepare - mkdir -p $HOME/.ssh - echo 'Host *' > $HOME/.ssh/config - echo ' ServerAliveInterval 150' >> $HOME/.ssh/config - echo ' ServerAliveCountMax 2' >> $HOME/.ssh/config - bundle exec rake spec_prep - echo ::endgroup:: - echo ::group::provision - bundle exec bolt plan run peadm_spec::provision_test_cluster \ - --modulepath spec/fixtures/modules \ - provider=provision_service \ - image=${{ matrix.image }} \ - architecture=${{ matrix.architecture }}-and-spare-replica - echo ::endgroup:: - echo ::group::info:request - cat request.json || true; echo - echo ::endgroup:: - echo ::group::info:inventory - sed -e 's/password: .*/password: "[redacted]"/' < spec/fixtures/litmus_inventory.yaml || true - echo ::endgroup:: - - name: Install PE on test cluster - timeout-minutes: 120 - run: | - bundle exec bolt plan run peadm_spec::install_test_cluster \ - --inventoryfile spec/fixtures/litmus_inventory.yaml \ - --modulepath spec/fixtures/modules \ - architecture=${{ matrix.architecture }} \ - version=${{ matrix.version }} \ - console_password=${{ secrets.CONSOLE_PASSWORD }} \ - code_manager_auto_configure=true - - name: Run add_replica plan - timeout-minutes: 60 - run: | - bundle exec bolt plan run peadm_spec::add_replica -v \ - --inventoryfile spec/fixtures/litmus_inventory.yaml \ - --modulepath spec/fixtures/modules \ - --stream - - name: Verify that replica was added - timeout-minutes: 10 - run: | - bundle exec bolt plan run peadm_spec::verify_replica -v \ - --inventoryfile spec/fixtures/litmus_inventory.yaml \ - --modulepath spec/fixtures/modules - - name: Tear down test cluster - if: ${{ always() }} - continue-on-error: true - run: |- - if [ -f spec/fixtures/litmus_inventory.yaml ]; then - echo ::group::tear_down - bundle exec rake 'litmus:tear_down' - echo ::endgroup:: - echo ::group::info:request - cat request.json || true; echo - echo ::endgroup:: - fi diff --git a/.github/workflows/test-add-replica.yaml b/.github/workflows/test-add-replica.yaml deleted file mode 100644 index 4ce32630e..000000000 --- a/.github/workflows/test-add-replica.yaml +++ /dev/null @@ -1,121 +0,0 @@ ---- -name: Add Replica test -on: - workflow_dispatch: - inputs: - image: - description: GCP image for test cluster - required: true - default: almalinux-cloud/almalinux-8 - architecture: - description: PE architecture to test - required: true - default: standard - version: - description: PE version to install - required: true - default: 2023.8.1 - ssh-debugging: - description: Boolean; whether or not to pause for ssh debugging - required: true - default: 'false' -jobs: - test-add-replica: - name: PE ${{ matrix.version }} ${{ matrix.architecture }} on ${{ matrix.image }} - runs-on: ubuntu-20.04 - env: - BOLT_GEM: true - BOLT_DISABLE_ANALYTICS: true - LANG: en_US.UTF-8 - strategy: - fail-fast: false - matrix: - architecture: ['${{ github.event.inputs.architecture }}'] - version: ['${{ github.event.inputs.version }}'] - image: ['${{ github.event.inputs.image }}'] - steps: - - name: Start SSH session - if: ${{ github.event.inputs.ssh-debugging == 'true' }} - uses: luchihoratiu/debug-via-ssh@main - with: - NGROK_AUTH_TOKEN: ${{ secrets.NGROK_AUTH_TOKEN }} - SSH_PASS: ${{ secrets.SSH_PASS }} - - name: Checkout Source - uses: actions/checkout@v4 - - name: Activate Ruby 2.7 - uses: ruby/setup-ruby@v1 - with: - ruby-version: '2.7' - bundler-cache: true - - name: Print bundle environment - if: ${{ github.repository_owner == 'puppetlabs' }} - run: | - echo ::group::info:bundler - bundle env - echo ::endgroup:: - - name: Provision test cluster (specified architecture with spare replica) - timeout-minutes: 15 - run: | - echo ::group::prepare - mkdir -p $HOME/.ssh - echo 'Host *' > $HOME/.ssh/config - echo ' ServerAliveInterval 150' >> $HOME/.ssh/config - echo ' ServerAliveCountMax 2' >> $HOME/.ssh/config - bundle exec rake spec_prep - echo ::endgroup:: - echo ::group::provision - bundle exec bolt plan run peadm_spec::provision_test_cluster \ - --modulepath spec/fixtures/modules \ - provider=provision_service \ - image=${{ matrix.image }} \ - architecture=${{ matrix.architecture }}-and-spare-replica - echo ::endgroup:: - echo ::group::info:request - cat request.json || true; echo - echo ::endgroup:: - echo ::group::info:inventory - sed -e 's/password: .*/password: "[redacted]"/' < spec/fixtures/litmus_inventory.yaml || true - echo ::endgroup:: - - name: Install PE on test cluster - timeout-minutes: 120 - run: | - bundle exec bolt plan run peadm_spec::install_test_cluster \ - --inventoryfile spec/fixtures/litmus_inventory.yaml \ - --modulepath spec/fixtures/modules \ - architecture=${{ matrix.architecture }} \ - version=${{ matrix.version }} \ - console_password=${{ secrets.CONSOLE_PASSWORD }} \ - code_manager_auto_configure=true - - name: Run add_replica plan - timeout-minutes: 60 - run: | - bundle exec bolt plan run peadm_spec::add_replica -v \ - --inventoryfile spec/fixtures/litmus_inventory.yaml \ - --modulepath spec/fixtures/modules \ - --stream - - name: Verify that replica was added - timeout-minutes: 10 - run: | - bundle exec bolt plan run peadm_spec::verify_replica -v \ - --inventoryfile spec/fixtures/litmus_inventory.yaml \ - --modulepath spec/fixtures/modules - - name: Wait as long as the file ${HOME}/pause file is present - if: ${{ always() && github.event.inputs.ssh-debugging == 'true' }} - run: | - while [ -f "${HOME}/pause" ] ; do - echo "${HOME}/pause present, sleeping for 60 seconds..." - sleep 60 - done - echo "${HOME}/pause absent, continuing workflow." - - name: Tear down test cluster - if: ${{ always() }} - continue-on-error: true - run: |- - if [ -f spec/fixtures/litmus_inventory.yaml ]; then - echo ::group::tear_down - bundle exec rake 'litmus:tear_down' - echo ::endgroup:: - echo ::group::info:request - cat request.json || true; echo - echo ::endgroup:: - fi diff --git a/.github/workflows/test-backup-restore-migration.yaml b/.github/workflows/test-backup-restore-migration.yaml deleted file mode 100644 index c8f6e3936..000000000 --- a/.github/workflows/test-backup-restore-migration.yaml +++ /dev/null @@ -1,217 +0,0 @@ ---- -name: Backup and restore test -on: - workflow_dispatch: - inputs: - image: - description: GCP image for test cluster - required: true - default: almalinux-cloud/almalinux-8 - architecture: - description: PE architecture to test - required: true - default: standard - version: - description: PE version to install - required: true - default: 2021.7.4 - ssh-debugging: - description: Boolean; whether or not to pause for ssh debugging - required: true - default: 'false' -jobs: - backup: - name: 'Backup: Cluster A: PE ${{ inputs.version }} ${{ inputs.architecture }} - on ${{ inputs.image }}' - runs-on: ubuntu-20.04 - env: - BOLT_GEM: true - BOLT_DISABLE_ANALYTICS: true - LANG: en_US.UTF-8 - steps: - - name: Start SSH session - if: ${{ github.event.inputs.ssh-debugging == 'true' }} - uses: luchihoratiu/debug-via-ssh@main - with: - NGROK_AUTH_TOKEN: ${{ secrets.NGROK_AUTH_TOKEN }} - SSH_PASS: ${{ secrets.SSH_PASS }} - - name: Checkout Source - uses: actions/checkout@v4 - - name: Activate Ruby 2.7 - uses: ruby/setup-ruby@v1 - with: - ruby-version: '2.7' - bundler-cache: true - - name: Print bundle environment - if: ${{ github.repository_owner == 'puppetlabs' }} - run: | - echo ::group::info:bundler - bundle env - echo ::endgroup:: - - name: Provision test cluster - timeout-minutes: 15 - run: | - echo ::group::prepare - mkdir -p $HOME/.ssh - echo 'Host *' > $HOME/.ssh/config - echo ' ServerAliveInterval 150' >> $HOME/.ssh/config - echo ' ServerAliveCountMax 2' >> $HOME/.ssh/config - bundle exec rake spec_prep - echo ::endgroup:: - echo ::group::provision - bundle exec bolt plan run peadm_spec::provision_test_cluster \ - --modulepath spec/fixtures/modules \ - provider=provision_service \ - image=${{ inputs.image }} \ - architecture=${{ inputs.architecture }} - echo ::endgroup:: - echo ::group::info:request - cat request.json || true; echo - echo ::endgroup:: - echo ::group::info:inventory - sed -e 's/password: .*/password: "[redacted]"/' < spec/fixtures/litmus_inventory.yaml || true - echo ::endgroup:: - - # - name: Save inventory file A to an artifact - # uses: actions/upload-artifact@v3 - # with: - # name: inventory_A - # path: spec/fixtures/litmus_inventory.yaml - - name: Install PE on test cluster - timeout-minutes: 120 - run: | - bundle exec bolt plan run peadm_spec::install_test_cluster \ - --inventoryfile spec/fixtures/litmus_inventory.yaml \ - --modulepath spec/fixtures/modules \ - architecture=${{ inputs.architecture }} \ - version=${{ inputs.version }} \ - console_password=${{ secrets.CONSOLE_PASSWORD }} - - name: Start SSH session - if: github.event.inputs.ssh-debugging == 'true' - uses: luchihoratiu/debug-via-ssh@main - with: - NGROK_AUTH_TOKEN: ${{ secrets.NGROK_AUTH_TOKEN }} - SSH_PASS: ${{ secrets.SSH_PASS }} - - # - name: Download artifacts - # # if: always() - # uses: actions/download-artifact@v3 - # with: - # path: spec/fixtures/ - - name: perform PE backup of cluster A - timeout-minutes: 10 - continue-on-error: true - run: | - echo ::group::prepare - mkdir -p $HOME/.ssh - echo 'Host *' > $HOME/.ssh/config - echo ' ServerAliveInterval 150' >> $HOME/.ssh/config - echo ' ServerAliveCountMax 2' >> $HOME/.ssh/config - bundle exec rake spec_prep - echo ::endgroup:: - echo ::group::backup - bundle exec bolt plan run peadm_spec::test_backup \ - --inventoryfile spec/fixtures/litmus_inventory.yaml \ - --modulepath spec/fixtures/modules - echo ::endgroup:: - - name: Wait as long as the file ${HOME}/pause file is present - continue-on-error: true - # if: ${{ always() && github.event.inputs.ssh-debugging == 'true' }} - if: github.event.inputs.ssh-debugging == 'true' - run: | - while [ -f "${HOME}/pause" ] ; do - echo "${HOME}/pause present, sleeping for 60 seconds..." - sleep 10 - done - echo "${HOME}/pause absent, continuing workflow." - - name: Tear down cluster A - if: always() - run: | - if [ -f spec/fixtures/litmus_inventory.yaml ]; then - echo ::group::tear_down - bundle exec rake 'litmus:tear_down' - echo ::endgroup:: - echo ::group::info:request - cat request.json || true; echo - echo ::endgroup:: - fi - restore: - name: 'Restore: Cluster B: PE ${{ inputs.version }} ${{ inputs.architecture }} - on ${{ inputs.image }}' - runs-on: ubuntu-20.04 - env: - BOLT_GEM: true - BOLT_DISABLE_ANALYTICS: true - LANG: en_US.UTF-8 - steps: - - name: Checkout Source - uses: actions/checkout@v4 - - name: Activate Ruby 2.7 - uses: ruby/setup-ruby@v1 - with: - ruby-version: '2.7' - bundler-cache: true - - name: Print bundle environment - if: ${{ github.repository_owner == 'puppetlabs' }} - run: | - echo ::group::info:bundler - bundle env - echo ::endgroup:: - - name: Provision test cluster - timeout-minutes: 15 - run: | - echo ::group::prepare - mkdir -p $HOME/.ssh - echo 'Host *' > $HOME/.ssh/config - echo ' ServerAliveInterval 150' >> $HOME/.ssh/config - echo ' ServerAliveCountMax 2' >> $HOME/.ssh/config - bundle exec rake spec_prep - echo ::endgroup:: - echo ::group::provision - bundle exec bolt plan run peadm_spec::provision_test_cluster \ - --modulepath spec/fixtures/modules \ - provider=provision_service \ - image=${{ inputs.image }} \ - architecture=${{ inputs.architecture }} - echo ::endgroup:: - echo ::group::info:request - cat request.json || true; echo - echo ::endgroup:: - echo ::group::info:inventory - sed -e 's/password: .*/password: "[redacted]"/' < spec/fixtures/litmus_inventory.yaml || true - echo ::endgroup:: - - # - name: Save inventory file B to an artifact - # uses: actions/upload-artifact@v3 - # with: - # name: inventory_B - # path: spec/fixtures/litmus_inventory.yaml - - name: Install PE on test cluster - timeout-minutes: 120 - run: | - bundle exec bolt plan run peadm_spec::install_test_cluster \ - --inventoryfile spec/fixtures/litmus_inventory.yaml \ - --modulepath spec/fixtures/modules \ - architecture=${{ inputs.architecture }} \ - version=${{ inputs.version }} \ - console_password=${{ secrets.CONSOLE_PASSWORD }} - - name: Wait for backup to finish - uses: lewagon/wait-on-check-action@v1.3.4 - with: - ref: ${{ github.ref }} - check-name: 'Backup: Cluster A: PE ${{ inputs.version }} ${{ inputs.architecture }} - on ${{ inputs.image }}' - repo-token: ${{ secrets.GITHUB_TOKEN }} - wait-interval: 10 - - name: Tear down cluster B - if: always() - run: |- - cp spec/fixtures/inventory_B/litmus_inventory.yaml spec/fixtures/litmus_inventory.yaml || true - if [ -f spec/fixtures/litmus_inventory.yaml ]; then - echo ::group::tear_down - bundle exec rake 'litmus:tear_down' - echo ::endgroup:: - echo ::group::info:request - cat request.json || true; echo - echo ::endgroup:: - fi diff --git a/.github/workflows/test-backup-restore.yaml b/.github/workflows/test-backup-restore.yaml deleted file mode 100644 index 2f951632e..000000000 --- a/.github/workflows/test-backup-restore.yaml +++ /dev/null @@ -1,231 +0,0 @@ ---- -name: Backup and restore test -on: - pull_request: - types: [ready_for_review] - workflow_dispatch: - inputs: - image: - description: GCP image for test cluster - required: true - default: almalinux-cloud/almalinux-8 - architecture: - description: PE architecture to test - required: true - default: standard - type: choice - options: - - standard - - standard-with-dr - - large - - large-with-dr - - extra-large - - extra-large-with-dr - version: - description: PE version to install - required: true - default: 2025.0.0 - ssh-debugging: - description: Boolean; whether or not to pause for ssh debugging - required: true - default: 'false' -jobs: - backup-restore-test: - name: "Backup, break and restore cluster: PE ${{ github.event.inputs.version || '2025.0.0' }}\ - \ ${{ github.event.inputs.architecture || 'extra-large' }} on ${{ github.event.inputs.image || 'almalinux-cloud/almalinux-8' }}" - runs-on: ubuntu-20.04 - env: - BOLT_GEM: true - BOLT_DISABLE_ANALYTICS: true - LANG: en_US.UTF-8 - steps: - - name: Start SSH session - if: ${{ github.event.inputs.ssh-debugging == 'true' }} - uses: luchihoratiu/debug-via-ssh@main - with: - NGROK_AUTH_TOKEN: ${{ secrets.NGROK_AUTH_TOKEN }} - SSH_PASS: ${{ secrets.SSH_PASS }} - - name: Checkout Source - uses: actions/checkout@v4 - - name: Activate Ruby 2.7 - uses: ruby/setup-ruby@v1 - with: - ruby-version: '2.7' - bundler-cache: true - - name: Print bundle environment - if: ${{ github.repository_owner == 'puppetlabs' }} - run: | - echo ::group::info:bundler - bundle env - echo ::endgroup:: - - name: Provision test cluster - timeout-minutes: 15 - run: | - echo ::group::prepare - mkdir -p $HOME/.ssh - echo 'Host *' > $HOME/.ssh/config - echo ' ServerAliveInterval 150' >> $HOME/.ssh/config - echo ' ServerAliveCountMax 2' >> $HOME/.ssh/config - bundle exec rake spec_prep - echo ::endgroup:: - echo ::group::provision - bundle exec bolt plan run peadm_spec::provision_test_cluster \ - --modulepath spec/fixtures/modules \ - provider=provision_service \ - image=${{ github.event.inputs.image || 'almalinux-cloud/almalinux-8' }} \ - architecture=${{ github.event.inputs.architecture || 'extra-large' }} - echo ::endgroup:: - echo ::group::info:request - cat request.json || true; echo - echo ::endgroup:: - echo ::group::info:inventory - sed -e 's/password: .*/password: "[redacted]"/' < spec/fixtures/litmus_inventory.yaml || true - echo ::endgroup:: - - name: Install PE on test cluster - timeout-minutes: 120 - run: | - bundle exec bolt plan run peadm_spec::install_test_cluster \ - --inventoryfile spec/fixtures/litmus_inventory.yaml \ - --modulepath spec/fixtures/modules \ - architecture=${{ github.event.inputs.architecture || 'extra-large' }} \ - version=${{ github.event.inputs.version || '2023.5.0' }} \ - console_password=${{ secrets.CONSOLE_PASSWORD }} \ - --stream - - name: Perform peadm backup of cluster - timeout-minutes: 10 - continue-on-error: true - run: | - echo ::group::prepare - mkdir -p $HOME/.ssh - echo 'Host *' > $HOME/.ssh/config - echo ' ServerAliveInterval 150' >> $HOME/.ssh/config - echo ' ServerAliveCountMax 2' >> $HOME/.ssh/config - bundle exec rake spec_prep - echo ::endgroup:: - echo ::group::backup - bundle exec bolt plan run peadm_spec::test_backup \ - --inventoryfile spec/fixtures/litmus_inventory.yaml \ - --modulepath spec/fixtures/modules \ - --stream - echo ::endgroup:: - - name: Set up yq - uses: frenck/action-setup-yq@v1 - with: - version: v4.30.5 - - name: Break the primary host - run: | - primary=$(yq '.groups[].targets[] | select(.vars.role == "primary") | .uri' spec/fixtures/litmus_inventory.yaml) - echo "Removing ssl directories" - bundle exec bolt command run "rm -rf /etc/puppetlabs/puppetserver/ca /etc/puppetlabs/puppet/ssl" -t $primary --inventoryfile spec/fixtures/litmus_inventory.yaml - echo "Removing classifier database" - bundle exec bolt command run "rm -rf /opt/puppetlabs/server/data/postgresql/classifier" -t $primary --inventoryfile spec/fixtures/litmus_inventory.yaml - # TODO if arch is XL, run pe-uninstaller on the primary database - - name: Output PE cluster status - run: | - primary=$(yq '.groups[].targets[] | select(.vars.role == "primary") | .uri' spec/fixtures/litmus_inventory.yaml) - bundle exec bolt command run "puppet infrastructure status" -t $primary --inventoryfile spec/fixtures/litmus_inventory.yaml - - name: Reinstall PE on the primary host - continue-on-error: true - run: | - primary=$(yq '.groups[].targets[] | select(.vars.role == "primary") | .uri' spec/fixtures/litmus_inventory.yaml) - bundle exec bolt task run peadm::reinstall_pe uninstall=true version=${{ github.event.inputs.version || '2023.5.0' }} -t $primary \ - --inventoryfile spec/fixtures/litmus_inventory.yaml \ - --modulepath spec/fixtures/modules \ - --verbose \ - --stream - - name: Perform peadm recovery restore of primary server - timeout-minutes: 30 - continue-on-error: true - run: | - echo ::group::prepare - mkdir -p $HOME/.ssh - echo 'Host *' > $HOME/.ssh/config - echo ' ServerAliveInterval 150' >> $HOME/.ssh/config - echo ' ServerAliveCountMax 2' >> $HOME/.ssh/config - bundle exec rake spec_prep - echo ::endgroup:: - primary=$(yq '.groups[].targets[] | select(.vars.role == "primary") | .uri' spec/fixtures/litmus_inventory.yaml) - - # TODO update the restore to: - # - restore the puppetdb in the standard cases - # - not restore the puppetdb if there is a broken external db - echo ::group::restore - bundle exec bolt plan run peadm_spec::test_restore \ - --inventoryfile spec/fixtures/litmus_inventory.yaml \ - --modulepath spec/fixtures/modules \ - --stream \ - || true # ignore errors - echo ::endgroup:: - - name: Output PE cluster status - run: | - primary=$(yq '.groups[].targets[] | select(.vars.role == "primary") | .uri' spec/fixtures/litmus_inventory.yaml) - bundle exec bolt command run "puppet infrastructure status" -t $primary --inventoryfile spec/fixtures/litmus_inventory.yaml - - name: Smoke test - run: | - bundle exec bolt plan run peadm_spec::puppet_run_test \ - --inventoryfile spec/fixtures/litmus_inventory.yaml \ - --modulepath spec/fixtures/modules \ - --stream - - name: Break external DB - if: ${{ github.event.inputs.architecture || 'extra-large' }} == 'extra-large' - run: | - echo "Uninstalling PE from primary database" - primary_db=$(yq '.groups[].targets[] | select(.vars.role == "primary-pdb-postgresql") | .uri' spec/fixtures/litmus_inventory.yaml) - bundle exec bolt command run "/opt/puppetlabs/bin/puppet-enterprise-uninstaller -p -d -y || true" -t $primary_db \ - --inventoryfile spec/fixtures/litmus_inventory.yaml \ - --modulepath spec/fixtures/modules \ - --verbose \ - --stream - - name: Output PE cluster status - if: ${{ github.event.inputs.architecture || 'extra-large' }} == 'extra-large' - run: | - primary=$(yq '.groups[].targets[] | select(.vars.role == "primary") | .uri' spec/fixtures/litmus_inventory.yaml) - bundle exec bolt command run "puppet infrastructure status" -t $primary --inventoryfile spec/fixtures/litmus_inventory.yaml - - name: Setup Primary DB in XL - if: ${{ github.event.inputs.architecture || 'extra-large' }} == 'extra-large' - run: | - primary_db=$(yq '.groups[].targets[] | select(.vars.role == "primary-pdb-postgresql") | .uri' spec/fixtures/litmus_inventory.yaml) - bundle exec bolt plan run peadm::util::init_db_server db_host=$primary_db \ - install_pe=true \ - --inventoryfile spec/fixtures/litmus_inventory.yaml \ - --modulepath spec/fixtures/modules \ - --stream \ - || true # ignore errors - - # restore the puppetdb database - bundle exec bolt plan run peadm_spec::test_restore restore_type="recovery-db" \ - --inventoryfile spec/fixtures/litmus_inventory.yaml \ - --modulepath spec/fixtures/modules \ - --stream - - name: Output PE cluster status - if: ${{ github.event.inputs.architecture || 'extra-large' }} == 'extra-large' - run: | - primary=$(yq '.groups[].targets[] | select(.vars.role == "primary") | .uri' spec/fixtures/litmus_inventory.yaml) - bundle exec bolt command run "puppet infrastructure status" -t $primary --inventoryfile spec/fixtures/litmus_inventory.yaml - - name: Smoke test - if: ${{ github.event.inputs.architecture || 'extra-large' }} == 'extra-large' - run: | - bundle exec bolt plan run peadm_spec::puppet_run_test \ - --inventoryfile spec/fixtures/litmus_inventory.yaml \ - --modulepath spec/fixtures/modules \ - --stream - - name: Wait as long as the file ${HOME}/pause file is present - continue-on-error: true - if: ${{ always() && github.event.inputs.ssh-debugging == 'true' }} - run: | - while [ -f "${HOME}/pause" ] ; do - echo "${HOME}/pause present, sleeping for 60 seconds..." - sleep 10 - done - echo "${HOME}/pause absent, continuing workflow." - - name: Tear down cluster - if: always() - run: |- - if [ -f spec/fixtures/litmus_inventory.yaml ]; then - echo ::group::tear_down - bundle exec rake 'litmus:tear_down' - echo ::endgroup:: - echo ::group::info:request - cat request.json || true; echo - echo ::endgroup:: - fi diff --git a/.github/workflows/test-failover.yaml b/.github/workflows/test-failover.yaml deleted file mode 100644 index 139b47ae6..000000000 --- a/.github/workflows/test-failover.yaml +++ /dev/null @@ -1,140 +0,0 @@ ---- -name: Failover test -on: - workflow_dispatch: - inputs: - image: - description: GCP image for test cluster - required: true - default: almalinux-cloud/almalinux-8 - version: - description: PE version to install - required: true - default: 2019.8.12 - version_to_upgrade: - description: PE version to upgrade to - required: false - default: 2023.8.1 - ssh-debugging: - description: Boolean; whether or not to pause for ssh debugging - required: true - default: 'false' - log_level: - description: Bolt log level - required: false - default: debug -jobs: - test-failover: - name: PE ${{ matrix.version }} ${{ matrix.architecture }} on ${{ matrix.image }} - runs-on: ubuntu-20.04 - env: - BOLT_GEM: true - BOLT_DISABLE_ANALYTICS: true - LANG: en_US.UTF-8 - strategy: - fail-fast: false - matrix: - 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' }} - uses: luchihoratiu/debug-via-ssh@main - with: - NGROK_AUTH_TOKEN: ${{ secrets.NGROK_AUTH_TOKEN }} - SSH_PASS: ${{ secrets.SSH_PASS }} - - name: Checkout Source - uses: actions/checkout@v4 - - name: Activate Ruby 2.7 - uses: ruby/setup-ruby@v1 - with: - ruby-version: '2.7' - bundler-cache: true - - name: Print bundle environment - if: ${{ github.repository_owner == 'puppetlabs' }} - run: | - echo ::group::info:bundler - bundle env - echo ::endgroup:: - - name: Provision test cluster (XL with spare replica) - timeout-minutes: 15 - run: | - echo ::group::prepare - mkdir -p $HOME/.ssh - echo 'Host *' > $HOME/.ssh/config - echo ' ServerAliveInterval 150' >> $HOME/.ssh/config - echo ' ServerAliveCountMax 2' >> $HOME/.ssh/config - bundle exec rake spec_prep - echo ::endgroup:: - echo ::group::provision - bundle exec bolt plan run peadm_spec::provision_test_cluster \ - --modulepath spec/fixtures/modules \ - provider=provision_service \ - image=${{ matrix.image }} \ - architecture=${{ matrix.architecture }}-and-spare-replica - echo ::endgroup:: - echo ::group::info:request - cat request.json || true; echo - echo ::endgroup:: - echo ::group::info:inventory - sed -e 's/password: .*/password: "[redacted]"/' < spec/fixtures/litmus_inventory.yaml || true - echo ::endgroup:: - - name: Install PE on test cluster - timeout-minutes: 120 - run: | - 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 }} \ - version=${{ matrix.version }} \ - console_password=${{ secrets.CONSOLE_PASSWORD }} - - name: Perform failover - run: | - 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 - - name: Wait as long as the file ${HOME}/pause file is present - if: ${{ always() && github.event.inputs.ssh-debugging == 'true' }} - run: | - while [ -f "${HOME}/pause" ] ; do - echo "${HOME}/pause present, sleeping for 60 seconds..." - sleep 60 - 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: ${{ success() && github.event.inputs.version_to_upgrade != '' }} - timeout-minutes: 120 - run: | - 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=${{ matrix.architecture }} \ - download_mode='direct' \ - version=${{ github.event.inputs.version_to_upgrade }} - - name: Tear down test cluster - if: ${{ always() }} - continue-on-error: true - run: |- - if [ -f spec/fixtures/litmus_inventory.yaml ]; then - echo ::group::tear_down - bundle exec rake 'litmus:tear_down' - echo ::endgroup:: - echo ::group::info:request - cat request.json || true; echo - echo ::endgroup:: - fi diff --git a/.github/workflows/test-fips-install-matrix.yaml b/.github/workflows/test-fips-install-matrix.yaml deleted file mode 100644 index 494459ce7..000000000 --- a/.github/workflows/test-fips-install-matrix.yaml +++ /dev/null @@ -1,101 +0,0 @@ ---- -name: Install fips test matrix -on: - pull_request: - paths: - - .github/workflows/**/* - - spec/**/* - - lib/**/* - - tasks/**/* - - functions/**/* - - types/**/* - - plans/**/* - - hiera/**/* - - manifests/**/* - - templates/**/* - - files/**/* - - metadata.json - - Rakefile - - Gemfile - - provision.yaml - - .rspec - - .rubocop.yml - - .puppet-lint.rc - - .fixtures.yml - branches: [main] - workflow_dispatch: {} -jobs: - test-install: - name: PE ${{ matrix.version }} ${{ matrix.architecture }} on ${{ matrix.image }} - with fips ${{ matrix.fips }} - runs-on: ubuntu-20.04 - env: - BOLT_GEM: true - BOLT_DISABLE_ANALYTICS: true - LANG: en_US.UTF-8 - strategy: - fail-fast: false - matrix: - architecture: [standard-with-dr, large, extra-large-with-dr] - version: [2019.8.12, 2021.7.9, 2023.8.1, 2025.0.0] - image: [rhel-8] - fips: [enable] - steps: - - name: Checkout Source - uses: actions/checkout@v4 - - name: Activate Ruby 2.7 - uses: ruby/setup-ruby@v1 - with: - ruby-version: '2.7' - bundler-cache: true - - name: Print bundle environment - if: ${{ github.repository_owner == 'puppetlabs' }} - run: | - echo ::group::info:bundler - bundle env - echo ::endgroup:: - - name: Provision test cluster - timeout-minutes: 15 - run: | - echo ::group::prepare - mkdir -p $HOME/.ssh - echo 'Host *' > $HOME/.ssh/config - echo ' ServerAliveInterval 150' >> $HOME/.ssh/config - echo ' ServerAliveCountMax 2' >> $HOME/.ssh/config - bundle exec rake spec_prep - echo ::endgroup:: - echo ::group::provision - bundle exec bolt plan run peadm_spec::provision_test_cluster \ - --modulepath spec/fixtures/modules \ - provider=provision_service \ - image=${{ matrix.image }} \ - architecture=${{ matrix.architecture }} - echo ::endgroup:: - echo ::group::info:request - cat request.json || true; echo - echo ::endgroup:: - echo ::group::info:inventory - sed -e 's/password: .*/password: "[redacted]"/' < spec/fixtures/litmus_inventory.yaml || true - echo ::endgroup:: - - name: Install PE on test cluster - timeout-minutes: 120 - run: | - bundle exec bolt plan run peadm_spec::install_test_cluster \ - --inventoryfile spec/fixtures/litmus_inventory.yaml \ - --modulepath spec/fixtures/modules \ - architecture=${{ matrix.architecture }} \ - version=${{ matrix.version }} \ - fips=${{ matrix.fips }} \ - console_password=${{ secrets.CONSOLE_PASSWORD }} - - name: Tear down test cluster - if: ${{ always() }} - continue-on-error: true - run: |- - if [ -f spec/fixtures/litmus_inventory.yaml ]; then - echo ::group::tear_down - bundle exec rake 'litmus:tear_down' - echo ::endgroup:: - echo ::group::info:request - cat request.json || true; echo - echo ::endgroup:: - fi diff --git a/.github/workflows/test-install-latest-dev.yaml b/.github/workflows/test-install-latest-dev.yaml deleted file mode 100644 index 9f1d08f21..000000000 --- a/.github/workflows/test-install-latest-dev.yaml +++ /dev/null @@ -1,120 +0,0 @@ ---- -name: Install latest dev test -on: - workflow_dispatch: - inputs: - image: - description: GCP image for test cluster - required: true - default: almalinux-cloud/almalinux-8 - architecture: - type: choice - required: true - default: standard - description: PE architecture to test - options: - - standard - - standard-with-dr - - large - - large-with-dr - - extra-large - - extra-large-with-dr - ssh-debugging: - description: Boolean; whether or not to pause for ssh debugging - required: true - default: 'false' -jobs: - test-install: - name: PE ${{ matrix.version }} ${{ matrix.architecture }} on ${{ matrix.image }} - runs-on: ubuntu-20.04 - env: - BOLT_GEM: true - BOLT_DISABLE_ANALYTICS: true - LANG: en_US.UTF-8 - strategy: - fail-fast: false - matrix: - architecture: ['${{ github.event.inputs.architecture }}'] - image: ['${{ github.event.inputs.image }}'] - steps: - - name: Start SSH session - if: ${{ github.event.inputs.ssh-debugging == 'true' }} - uses: luchihoratiu/debug-via-ssh@main - with: - NGROK_AUTH_TOKEN: ${{ secrets.NGROK_AUTH_TOKEN }} - SSH_PASS: ${{ secrets.SSH_PASS }} - - name: Checkout Source - uses: actions/checkout@v4 - - name: Activate Ruby 2.7 - uses: ruby/setup-ruby@v1 - with: - ruby-version: '2.7' - bundler-cache: true - - name: Print bundle environment - if: ${{ github.repository_owner == 'puppetlabs' }} - run: | - echo ::group::info:bundler - bundle env - echo ::endgroup:: - - name: Provision test cluster - timeout-minutes: 15 - run: | - echo ::group::prepare - mkdir -p $HOME/.ssh - echo 'Host *' > $HOME/.ssh/config - echo ' ServerAliveInterval 150' >> $HOME/.ssh/config - echo ' ServerAliveCountMax 2' >> $HOME/.ssh/config - bundle exec rake spec_prep - echo ::endgroup:: - echo ::group::provision - bundle exec bolt plan run peadm_spec::provision_test_cluster \ - --modulepath spec/fixtures/modules \ - provider=provision_service \ - image=${{ matrix.image }} \ - architecture=${{ matrix.architecture }} - echo ::endgroup:: - echo ::group::info:request - cat request.json || true; echo - echo ::endgroup:: - echo ::group::info:inventory - sed -e 's/password: .*/password: "[redacted]"/' < spec/fixtures/litmus_inventory.yaml || true - echo ::endgroup:: - - name: Activate twingate to obtain unreleased build - uses: twingate/github-action@main - with: - service-key: ${{ secrets.TWINGATE_PUBLIC_REPO_KEY }} - - name: Get latest build name - id: latest - run: | - echo "::set-output name=ver::$(curl -q https://artifactory.delivery.puppetlabs.net/artifactory/generic_enterprise__local/main/ci-ready/LATEST)" - - name: Install PE on test cluster - timeout-minutes: 120 - run: | - bundle exec bolt plan run peadm_spec::install_test_cluster \ - --inventoryfile spec/fixtures/litmus_inventory.yaml \ - --modulepath spec/fixtures/modules \ - permit_unsafe_versions=true \ - download_mode="bolthost" \ - architecture=${{ matrix.architecture }} \ - pe_installer_source="https://artifactory.delivery.puppetlabs.net/artifactory/generic_enterprise__local/main/ci-ready/puppet-enterprise-${{ steps.latest.outputs.ver }}-el-8-x86_64.tar" \ - console_password=${{ secrets.CONSOLE_PASSWORD }} - - name: Wait as long as the file ${HOME}/pause file is present - if: ${{ always() && github.event.inputs.ssh-debugging == 'true' }} - run: | - while [ -f "${HOME}/pause" ] ; do - echo "${HOME}/pause present, sleeping for 60 seconds..." - sleep 60 - done - echo "${HOME}/pause absent, continuing workflow." - - name: Tear down test cluster - if: ${{ always() }} - continue-on-error: true - run: |- - if [ -f spec/fixtures/litmus_inventory.yaml ]; then - echo ::group::tear_down - bundle exec rake 'litmus:tear_down' - echo ::endgroup:: - echo ::group::info:request - cat request.json || true; echo - echo ::endgroup:: - fi diff --git a/.github/workflows/test-install-latest-xlarge-dev-nightly.yaml b/.github/workflows/test-install-latest-xlarge-dev-nightly.yaml deleted file mode 100644 index e39073a35..000000000 --- a/.github/workflows/test-install-latest-xlarge-dev-nightly.yaml +++ /dev/null @@ -1,106 +0,0 @@ ---- -name: Install latest dev test nightly -on: - schedule: - - cron: 0 3 * * * - workflow_dispatch: - inputs: - ssh-debugging: - description: Boolean; whether or not to pause for ssh debugging - required: true - default: 'false' -jobs: - test-install: - name: PE nightly using ${{ matrix.architecture }} on ${{ matrix.image }} - runs-on: ubuntu-20.04 - env: - BOLT_GEM: true - BOLT_DISABLE_ANALYTICS: true - LANG: en_US.UTF-8 - strategy: - fail-fast: false - matrix: - architecture: [extra-large-with-dr] - image: [almalinux-cloud/almalinux-8] - steps: - - name: Start SSH session - if: ${{ github.event.inputs.ssh-debugging == 'true' }} - uses: luchihoratiu/debug-via-ssh@main - with: - NGROK_AUTH_TOKEN: ${{ secrets.NGROK_AUTH_TOKEN }} - SSH_PASS: ${{ secrets.SSH_PASS }} - - name: Checkout Source - uses: actions/checkout@v4 - - name: Activate Ruby 2.7 - uses: ruby/setup-ruby@v1 - with: - ruby-version: '2.7' - bundler-cache: true - - name: Print bundle environment - if: ${{ github.repository_owner == 'puppetlabs' }} - run: | - echo ::group::info:bundler - bundle env - echo ::endgroup:: - - name: Provision test cluster - timeout-minutes: 15 - run: | - echo ::group::prepare - mkdir -p $HOME/.ssh - echo 'Host *' > $HOME/.ssh/config - echo ' ServerAliveInterval 150' >> $HOME/.ssh/config - echo ' ServerAliveCountMax 2' >> $HOME/.ssh/config - bundle exec rake spec_prep - echo ::endgroup:: - echo ::group::provision - bundle exec bolt plan run peadm_spec::provision_test_cluster \ - --modulepath spec/fixtures/modules \ - provider=provision_service \ - image=${{ matrix.image }} \ - architecture=${{ matrix.architecture }} - echo ::endgroup:: - echo ::group::info:request - cat request.json || true; echo - echo ::endgroup:: - echo ::group::info:inventory - sed -e 's/password: .*/password: "[redacted]"/' < spec/fixtures/litmus_inventory.yaml || true - echo ::endgroup:: - - name: Activate twingate to obtain unreleased build - uses: twingate/github-action@main - with: - service-key: ${{ secrets.TWINGATE_PUBLIC_REPO_KEY }} - - name: Get latest build name - id: latest - run: | - echo "::set-output name=ver::$(curl -q https://artifactory.delivery.puppetlabs.net/artifactory/generic_enterprise__local/main/ci-ready/LATEST)" - - name: Install PE on test cluster - timeout-minutes: 120 - run: | - bundle exec bolt plan run peadm_spec::install_test_cluster \ - --inventoryfile spec/fixtures/litmus_inventory.yaml \ - --modulepath spec/fixtures/modules \ - permit_unsafe_versions=true \ - download_mode="bolthost" \ - architecture=${{ matrix.architecture }} \ - pe_installer_source="https://artifactory.delivery.puppetlabs.net/artifactory/generic_enterprise__local/main/ci-ready/puppet-enterprise-${{ steps.latest.outputs.ver }}-el-8-x86_64.tar" \ - console_password=${{ secrets.CONSOLE_PASSWORD }} - - name: Wait as long as the file ${HOME}/pause file is present - if: ${{ always() && github.event.inputs.ssh-debugging == 'true' }} - run: | - while [ -f "${HOME}/pause" ] ; do - echo "${HOME}/pause present, sleeping for 60 seconds..." - sleep 60 - done - echo "${HOME}/pause absent, continuing workflow." - - name: Tear down test cluster - if: ${{ always() }} - continue-on-error: true - run: |- - if [ -f spec/fixtures/litmus_inventory.yaml ]; then - echo ::group::tear_down - bundle exec rake 'litmus:tear_down' - echo ::endgroup:: - echo ::group::info:request - cat request.json || true; echo - echo ::endgroup:: - fi diff --git a/.github/workflows/test-install-matrix.yaml b/.github/workflows/test-install-matrix.yaml deleted file mode 100644 index 41d20583f..000000000 --- a/.github/workflows/test-install-matrix.yaml +++ /dev/null @@ -1,99 +0,0 @@ ---- -name: Install test matrix -on: - pull_request: - paths: - - .github/workflows/**/* - - spec/**/* - - lib/**/* - - tasks/**/* - - functions/**/* - - types/**/* - - plans/**/* - - hiera/**/* - - manifests/**/* - - templates/**/* - - files/**/* - - metadata.json - - Rakefile - - Gemfile - - provision.yaml - - .rspec - - .rubocop.yml - - .puppet-lint.rc - - .fixtures.yml - branches: [main] - workflow_dispatch: {} -jobs: - test-install: - name: PE ${{ matrix.version }} ${{ matrix.architecture }} on ${{ matrix.image }} - runs-on: ubuntu-20.04 - env: - BOLT_GEM: true - BOLT_DISABLE_ANALYTICS: true - LANG: en_US.UTF-8 - strategy: - fail-fast: false - matrix: - architecture: [standard-with-dr, large, extra-large-with-dr] - version: [2019.8.12, 2021.7.9, 2023.8.1, 2025.0.0] - image: [almalinux-cloud/almalinux-8] - steps: - - name: Checkout Source - uses: actions/checkout@v4 - - name: Activate Ruby 2.7 - uses: ruby/setup-ruby@v1 - with: - ruby-version: '2.7' - bundler-cache: true - - name: Print bundle environment - if: ${{ github.repository_owner == 'puppetlabs' }} - run: | - echo ::group::info:bundler - bundle env - echo ::endgroup:: - - name: Provision test cluster - timeout-minutes: 15 - run: | - echo ::group::prepare - mkdir -p $HOME/.ssh - echo 'Host *' > $HOME/.ssh/config - echo ' ServerAliveInterval 150' >> $HOME/.ssh/config - echo ' ServerAliveCountMax 2' >> $HOME/.ssh/config - bundle exec rake spec_prep - echo ::endgroup:: - echo ::group::provision - bundle exec bolt plan run peadm_spec::provision_test_cluster \ - --modulepath spec/fixtures/modules \ - provider=provision_service \ - image=${{ matrix.image }} \ - architecture=${{ matrix.architecture }} \ - --log-level trace - echo ::endgroup:: - echo ::group::info:request - cat request.json || true; echo - echo ::endgroup:: - echo ::group::info:inventory - sed -e 's/password: .*/password: "[redacted]"/' < spec/fixtures/litmus_inventory.yaml || true - echo ::endgroup:: - - name: Install PE on test cluster - timeout-minutes: 120 - run: | - bundle exec bolt plan run peadm_spec::install_test_cluster \ - --inventoryfile spec/fixtures/litmus_inventory.yaml \ - --modulepath spec/fixtures/modules \ - architecture=${{ matrix.architecture }} \ - version=${{ matrix.version }} \ - console_password=${{ secrets.CONSOLE_PASSWORD }} - - name: Tear down test cluster - if: ${{ always() }} - continue-on-error: true - run: |- - if [ -f spec/fixtures/litmus_inventory.yaml ]; then - echo ::group::tear_down - bundle exec rake 'litmus:tear_down' - echo ::endgroup:: - echo ::group::info:request - cat request.json || true; echo - echo ::endgroup:: - fi diff --git a/.github/workflows/test-install-rhel-9.yaml b/.github/workflows/test-install-rhel-9.yaml deleted file mode 100644 index 793eebd1d..000000000 --- a/.github/workflows/test-install-rhel-9.yaml +++ /dev/null @@ -1,99 +0,0 @@ ---- -name: Install test rhel-9 -on: - pull_request: - paths: - - .github/workflows/**/* - - spec/**/* - - lib/**/* - - tasks/**/* - - functions/**/* - - types/**/* - - plans/**/* - - hiera/**/* - - manifests/**/* - - templates/**/* - - files/**/* - - metadata.json - - Rakefile - - Gemfile - - provision.yaml - - .rspec - - .rubocop.yml - - .puppet-lint.rc - - .fixtures.yml - branches: [main] - workflow_dispatch: {} -jobs: - test-install: - name: PE ${{ matrix.version }} ${{ matrix.architecture }} on ${{ matrix.image }} - runs-on: ubuntu-20.04 - env: - BOLT_GEM: true - BOLT_DISABLE_ANALYTICS: true - LANG: en_US.UTF-8 - strategy: - fail-fast: false - matrix: - architecture: [standard-with-dr, large, extra-large-with-dr] - version: [2021.7.9, 2023.8.1, 2025.0.0] - image: [rhel-9] - steps: - - name: Checkout Source - uses: actions/checkout@v4 - - name: Activate Ruby 2.7 - uses: ruby/setup-ruby@v1 - with: - ruby-version: '2.7' - bundler-cache: true - - name: Print bundle environment - if: ${{ github.repository_owner == 'puppetlabs' }} - run: | - echo ::group::info:bundler - bundle env - echo ::endgroup:: - - name: Provision test cluster - timeout-minutes: 15 - run: | - echo ::group::prepare - mkdir -p $HOME/.ssh - echo 'Host *' > $HOME/.ssh/config - echo ' ServerAliveInterval 150' >> $HOME/.ssh/config - echo ' ServerAliveCountMax 2' >> $HOME/.ssh/config - bundle exec rake spec_prep - echo ::endgroup:: - echo ::group::provision - bundle exec bolt plan run peadm_spec::provision_test_cluster \ - --modulepath spec/fixtures/modules \ - provider=provision_service \ - image=${{ matrix.image }} \ - architecture=${{ matrix.architecture }} \ - --log-level trace - echo ::endgroup:: - echo ::group::info:request - cat request.json || true; echo - echo ::endgroup:: - echo ::group::info:inventory - sed -e 's/password: .*/password: "[redacted]"/' < spec/fixtures/litmus_inventory.yaml || true - echo ::endgroup:: - - name: Install PE on test cluster - timeout-minutes: 120 - run: | - bundle exec bolt plan run peadm_spec::install_test_cluster \ - --inventoryfile spec/fixtures/litmus_inventory.yaml \ - --modulepath spec/fixtures/modules \ - architecture=${{ matrix.architecture }} \ - version=${{ matrix.version }} \ - console_password=${{ secrets.CONSOLE_PASSWORD }} - - name: Tear down test cluster - if: ${{ always() }} - continue-on-error: true - run: |- - if [ -f spec/fixtures/litmus_inventory.yaml ]; then - echo ::group::tear_down - bundle exec rake 'litmus:tear_down' - echo ::endgroup:: - echo ::group::info:request - cat request.json || true; echo - echo ::endgroup:: - fi diff --git a/.github/workflows/test-install.yaml b/.github/workflows/test-install.yaml deleted file mode 100644 index 8fd9df7be..000000000 --- a/.github/workflows/test-install.yaml +++ /dev/null @@ -1,107 +0,0 @@ ---- -name: Install test -on: - workflow_dispatch: - inputs: - image: - description: GCP image for test cluster - required: true - default: almalinux-cloud/almalinux-8 - architecture: - description: PE architecture to test - required: true - default: standard - version: - description: PE version to install - required: true - default: 2023.8.1 - ssh-debugging: - description: Boolean; whether or not to pause for ssh debugging - required: true - default: 'false' -jobs: - test-install: - name: PE ${{ matrix.version }} ${{ matrix.architecture }} on ${{ matrix.image }} - runs-on: ubuntu-20.04 - env: - BOLT_GEM: true - BOLT_DISABLE_ANALYTICS: true - LANG: en_US.UTF-8 - strategy: - fail-fast: false - matrix: - architecture: ['${{ github.event.inputs.architecture }}'] - version: ['${{ github.event.inputs.version }}'] - image: ['${{ github.event.inputs.image }}'] - steps: - - name: Start SSH session - if: ${{ github.event.inputs.ssh-debugging == 'true' }} - uses: luchihoratiu/debug-via-ssh@main - with: - NGROK_AUTH_TOKEN: ${{ secrets.NGROK_AUTH_TOKEN }} - SSH_PASS: ${{ secrets.SSH_PASS }} - - name: Checkout Source - uses: actions/checkout@v4 - - name: Activate Ruby 2.7 - uses: ruby/setup-ruby@v1 - with: - ruby-version: '2.7' - bundler-cache: true - - name: Print bundle environment - if: ${{ github.repository_owner == 'puppetlabs' }} - run: | - echo ::group::info:bundler - bundle env - echo ::endgroup:: - - name: Provision test cluster - timeout-minutes: 15 - run: | - echo ::group::prepare - mkdir -p $HOME/.ssh - echo 'Host *' > $HOME/.ssh/config - echo ' ServerAliveInterval 150' >> $HOME/.ssh/config - echo ' ServerAliveCountMax 2' >> $HOME/.ssh/config - bundle exec rake spec_prep - echo ::endgroup:: - echo ::group::provision - bundle exec bolt plan run peadm_spec::provision_test_cluster \ - --modulepath spec/fixtures/modules \ - provider=provision_service \ - image=${{ matrix.image }} \ - architecture=${{ matrix.architecture }} - echo ::endgroup:: - echo ::group::info:request - cat request.json || true; echo - echo ::endgroup:: - echo ::group::info:inventory - sed -e 's/password: .*/password: "[redacted]"/' < spec/fixtures/litmus_inventory.yaml || true - echo ::endgroup:: - - name: Install PE on test cluster - timeout-minutes: 120 - run: | - bundle exec bolt plan run peadm_spec::install_test_cluster \ - --inventoryfile spec/fixtures/litmus_inventory.yaml \ - --modulepath spec/fixtures/modules \ - architecture=${{ matrix.architecture }} \ - version=${{ matrix.version }} \ - console_password=${{ secrets.CONSOLE_PASSWORD }} - - name: Wait as long as the file ${HOME}/pause file is present - if: ${{ always() && github.event.inputs.ssh-debugging == 'true' }} - run: | - while [ -f "${HOME}/pause" ] ; do - echo "${HOME}/pause present, sleeping for 60 seconds..." - sleep 60 - done - echo "${HOME}/pause absent, continuing workflow." - - name: Tear down test cluster - if: ${{ always() }} - continue-on-error: true - run: |- - if [ -f spec/fixtures/litmus_inventory.yaml ]; then - echo ::group::tear_down - bundle exec rake 'litmus:tear_down' - echo ::endgroup:: - echo ::group::info:request - cat request.json || true; echo - echo ::endgroup:: - fi diff --git a/.github/workflows/test-legacy-compilers.yaml b/.github/workflows/test-legacy-compilers.yaml deleted file mode 100644 index 254a8b997..000000000 --- a/.github/workflows/test-legacy-compilers.yaml +++ /dev/null @@ -1,161 +0,0 @@ ---- -name: Convert compiler to legacy -on: - pull_request: - paths: - - .github/workflows/**/* - - spec/**/* - - lib/**/* - - tasks/**/* - - functions/**/* - - types/**/* - - plans/**/* - - hiera/**/* - - manifests/**/* - - templates/**/* - - files/**/* - - metadata.json - - Rakefile - - Gemfile - - provision.yaml - - .rspec - - .rubocop.yml - - .puppet-lint.rc - - .fixtures.yml - branches: [main] - workflow_dispatch: - inputs: - ssh-debugging: - description: Boolean; whether or not to pause for ssh debugging - required: true - default: 'false' -jobs: - convert_compiler: - name: Convert compilers to legacy - runs-on: ubuntu-20.04 - env: - BOLT_GEM: true - BOLT_DISABLE_ANALYTICS: true - LANG: en_US.UTF-8 - steps: - - name: Start SSH session - if: ${{ github.event.inputs.ssh-debugging == 'true' }} - uses: luchihoratiu/debug-via-ssh@main - with: - NGROK_AUTH_TOKEN: ${{ secrets.NGROK_AUTH_TOKEN }} - SSH_PASS: ${{ secrets.SSH_PASS }} - - name: Checkout Source - uses: actions/checkout@v4 - - name: Activate Ruby 2.7 - uses: ruby/setup-ruby@v1 - with: - ruby-version: '2.7' - bundler-cache: true - - name: Print bundle environment - if: ${{ github.repository_owner == 'puppetlabs' }} - run: | - echo ::group::info:bundler - bundle env - echo ::endgroup:: - - name: Provision test cluster - timeout-minutes: 15 - run: | - echo ::group::prepare - mkdir -p $HOME/.ssh - echo 'Host *' > $HOME/.ssh/config - echo ' ServerAliveInterval 150' >> $HOME/.ssh/config - echo ' ServerAliveCountMax 2' >> $HOME/.ssh/config - bundle exec rake spec_prep - echo ::endgroup:: - echo ::group::provision - bundle exec bolt plan run peadm_spec::provision_test_cluster \ - --modulepath spec/fixtures/modules \ - provider=provision_service \ - image=almalinux-cloud/almalinux-8 \ - architecture=large-with-dr - echo ::endgroup:: - echo ::group::certnames - bundle exec bolt plan run peadm_spec::add_inventory_hostnames \ - --inventory spec/fixtures/litmus_inventory.yaml \ - --modulepath spec/fixtures/modules \ - --no-host-key-check \ - inventory_file=spec/fixtures/litmus_inventory.yaml - echo ::endgroup:: - echo ::group::info:request - cat request.json || true; echo - echo ::endgroup:: - echo ::group::info:inventory - sed -e 's/password: .*/password: "[redacted]"/' < spec/fixtures/litmus_inventory.yaml || true - echo ::endgroup:: - - name: Set up yq - uses: frenck/action-setup-yq@v1 - with: - version: v4.30.5 - - name: Install PE on test cluster - timeout-minutes: 120 - run: | - bundle exec bolt plan run peadm_spec::install_test_cluster \ - --inventoryfile spec/fixtures/litmus_inventory.yaml \ - --modulepath spec/fixtures/modules \ - architecture=large-with-dr \ - console_password=${{ secrets.CONSOLE_PASSWORD }} \ - version=2025.0.0 - - name: Wait as long as the file ${HOME}/pause file is present - if: ${{ always() && github.event.inputs.ssh-debugging == 'true' }} - run: | - while [ -f "${HOME}/pause" ] ; do - echo "${HOME}/pause present, sleeping for 60 seconds..." - sleep 60 - done - echo "${HOME}/pause absent, continuing workflow." - - name: Convert one compiler to legacy - timeout-minutes: 120 - run: | - primary=$(yq '.groups[].targets[] | select(.vars.role == "primary") | .name' spec/fixtures/litmus_inventory.yaml) - compiler=$(yq '.groups[].targets[] | select(.vars.role == "compiler") | .name' spec/fixtures/litmus_inventory.yaml | head -n 1) - echo "primary: $primary" - echo "compiler: $compiler" - echo ::group::convert_compiler_to_legacy - bundle exec bolt plan run peadm::convert_compiler_to_legacy \ - --inventoryfile spec/fixtures/litmus_inventory.yaml \ - --modulepath spec/fixtures/modules \ - --no-host-key-check \ - primary_host=$primary \ - legacy_hosts=$compiler - echo ::endgroup:: - - name: Check if compiler is converted - timeout-minutes: 120 - run: | - echo ::group::inventory - sed -e 's/password: .*/password: "[redacted]"/' < spec/fixtures/litmus_inventory.yaml || true - echo ::endgroup:: - echo ::group::get_peadm_config - primary=$(yq '.groups[].targets[] | select(.vars.role == "primary") | .name' spec/fixtures/litmus_inventory.yaml) - compiler=$(yq '.groups[].targets[] | select(.vars.role == "compiler") | .name' spec/fixtures/litmus_inventory.yaml | head -n 1) - bundle exec bolt task run peadm::get_peadm_config \ - --targets $primary \ - --inventoryfile spec/fixtures/litmus_inventory.yaml \ - --modulepath spec/fixtures/modules \ - --no-host-key-check \ - --format json > peadm_config.json - cat peadm_config.json - echo ::endgroup:: - echo ::group::smoke_test - legacy_compiler=$(yq '.items[0].value.params.legacy_compilers[0]' peadm_config.json) - if [ "$compiler" != "$legacy_compiler" ]; then - echo "Compiler conversion failed, expected $compiler, got $legacy_compiler" - exit 1 - fi - echo ::endgroup:: - - name: Tear down test cluster - if: ${{ always() }} - continue-on-error: true - run: |- - if [ -f spec/fixtures/litmus_inventory.yaml ]; then - echo ::group::tear_down - bundle exec rake 'litmus:tear_down' - echo ::endgroup:: - echo ::group::info:request - cat request.json || true; echo - echo ::endgroup:: - fi diff --git a/.github/workflows/test-legacy-upgrade.yaml b/.github/workflows/test-legacy-upgrade.yaml deleted file mode 100644 index 23692fcaa..000000000 --- a/.github/workflows/test-legacy-upgrade.yaml +++ /dev/null @@ -1,205 +0,0 @@ ---- -name: Upgrade PE with legacy compilers -on: - pull_request: - paths: - - .github/workflows/**/* - - spec/**/* - - lib/**/* - - tasks/**/* - - functions/**/* - - types/**/* - - plans/**/* - - hiera/**/* - - manifests/**/* - - templates/**/* - - files/**/* - - metadata.json - - Rakefile - - Gemfile - - provision.yaml - - .rspec - - .rubocop.yml - - .puppet-lint.rc - - .fixtures.yml - branches: [main] - workflow_dispatch: - inputs: - ssh-debugging: - description: Boolean; whether or not to pause for ssh debugging - required: true - default: 'false' -jobs: - upgrade_with_legacy_compilers: - name: Upgrade PE with legacy compilers - runs-on: ubuntu-20.04 - env: - BOLT_GEM: true - BOLT_DISABLE_ANALYTICS: true - LANG: en_US.UTF-8 - steps: - - name: Start SSH session - if: ${{ github.event.inputs.ssh-debugging == 'true' }} - uses: luchihoratiu/debug-via-ssh@main - with: - NGROK_AUTH_TOKEN: ${{ secrets.NGROK_AUTH_TOKEN }} - SSH_PASS: ${{ secrets.SSH_PASS }} - - name: Checkout Source - uses: actions/checkout@v4 - - name: Activate Ruby 2.7 - uses: ruby/setup-ruby@v1 - with: - ruby-version: '2.7' - bundler-cache: true - - name: Print bundle environment - if: ${{ github.repository_owner == 'puppetlabs' }} - run: | - echo ::group::info:bundler - bundle env - echo ::endgroup:: - - name: Provision test cluster - timeout-minutes: 15 - run: | - echo ::group::prepare - mkdir -p $HOME/.ssh - echo 'Host *' > $HOME/.ssh/config - echo ' ServerAliveInterval 150' >> $HOME/.ssh/config - echo ' ServerAliveCountMax 2' >> $HOME/.ssh/config - bundle exec rake spec_prep - echo ::endgroup:: - echo ::group::provision - bundle exec bolt plan run peadm_spec::provision_test_cluster \ - --modulepath spec/fixtures/modules \ - provider=provision_service \ - image=almalinux-cloud/almalinux-8 \ - architecture=large-with-dr - echo ::endgroup:: - echo ::group::certnames - bundle exec bolt plan run peadm_spec::add_inventory_hostnames \ - --inventory spec/fixtures/litmus_inventory.yaml \ - --modulepath spec/fixtures/modules \ - --no-host-key-check \ - inventory_file=spec/fixtures/litmus_inventory.yaml - echo ::endgroup:: - echo ::group::info:request - cat request.json || true; echo - echo ::endgroup:: - echo ::group::info:inventory - sed -e 's/password: .*/password: "[redacted]"/' < spec/fixtures/litmus_inventory.yaml || true - echo ::endgroup:: - - name: Set up yq - uses: frenck/action-setup-yq@v1 - with: - version: v4.30.5 - - name: Create the params.json file - run: | - primary=$(yq '.groups[].targets[] | select(.vars.role == "primary") | .name' spec/fixtures/litmus_inventory.yaml) - compiler=$(yq '.groups[].targets[] | select(.vars.role == "compiler") | .name' spec/fixtures/litmus_inventory.yaml | head -n 1) - legacy_compiler=$(yq '.groups[].targets[] | select(.vars.role == "compiler") | .name' spec/fixtures/litmus_inventory.yaml | sed -n 2p) - replica=$(yq '.groups[].targets[] | select(.vars.role == "replica") | .name' spec/fixtures/litmus_inventory.yaml) - hash_random=$(LC_ALL=C tr -dc 'A-Za-z0-9!#$%&'\''()*+,-./:;<=>?@[\]^_`{|}~' params.json - - name: Install PE with legacy compilers - timeout-minutes: 120 - run: | - echo ::group::params.json - jq '.console_password = "[redacted]"' params.json || true - echo ::endgroup:: - echo ::group::install - bundle exec bolt plan run peadm::install \ - --inventoryfile spec/fixtures/litmus_inventory.yaml \ - --modulepath spec/fixtures/modules \ - --no-host-key-check \ - --params @params.json - echo ::endgroup:: - - name: Wait as long as the file ${HOME}/pause file is present - if: ${{ always() && github.event.inputs.ssh-debugging == 'true' }} - run: | - while [ -f "${HOME}/pause" ] ; do - echo "${HOME}/pause present, sleeping for 60 seconds..." - sleep 60 - done - echo "${HOME}/pause absent, continuing workflow." - - name: Check if compilers are configured - timeout-minutes: 120 - run: | - echo ::group::inventory - sed -e 's/password: .*/password: "[redacted]"/' < spec/fixtures/litmus_inventory.yaml || true - echo ::endgroup:: - echo ::group::get_peadm_config - primary=$(yq '.groups[].targets[] | select(.vars.role == "primary") | .name' spec/fixtures/litmus_inventory.yaml) - compiler=$(yq '.groups[].targets[] | select(.vars.role == "compiler") | .name' spec/fixtures/litmus_inventory.yaml | head -n 1) - legacy_compiler=$(yq '.groups[].targets[] | select(.vars.role == "compiler") | .name' spec/fixtures/litmus_inventory.yaml | sed -n 2p) - bundle exec bolt task run peadm::get_peadm_config \ - --targets $primary \ - --inventoryfile spec/fixtures/litmus_inventory.yaml \ - --modulepath spec/fixtures/modules \ - --no-host-key-check \ - --format json > peadm_config.json - cat peadm_config.json - echo ::endgroup:: - echo ::group::smoke_test - configured_legacy_compiler=$(yq '.items[0].value.params.legacy_compilers[0]' peadm_config.json) - configured_compiler=$(yq '.items[0].value.params.compiler_hosts[0]' peadm_config.json) - if [ "$configured_legacy_compiler" != "$legacy_compiler" ] && [ "$configured_compiler" != "$compiler" ]; then - echo "Compilers are not configured, expected $legacy_compiler and $compiler, got $configured_legacy_compiler and $configured_compiler" - exit 1 - fi - echo ::endgroup:: - - name: Create the upgrade params.json file - run: | - primary=$(yq '.groups[].targets[] | select(.vars.role == "primary") | .name' spec/fixtures/litmus_inventory.yaml) - compiler=$(yq '.groups[].targets[] | select(.vars.role == "compiler") | .name' spec/fixtures/litmus_inventory.yaml | head -n 1) - legacy_compiler=$(yq '.groups[].targets[] | select(.vars.role == "compiler") | .name' spec/fixtures/litmus_inventory.yaml | sed -n 2p) - replica=$(yq '.groups[].targets[] | select(.vars.role == "replica") | .name' spec/fixtures/litmus_inventory.yaml) - echo -n '{ "primary_host": "'$primary'", "replica_host": "'$replica'", "compiler_hosts": ["'$compiler'", "'$legacy_compiler'"], "version": "2025.0.0"}' > upgrade_params.json - - name: Upgrade PE with legacy compilers - run: | - echo ::group::upgrade_params.json - cat upgrade_params.json - echo ::endgroup:: - echo ::group::upgrade - bundle exec bolt plan run peadm::upgrade \ - --inventoryfile spec/fixtures/litmus_inventory.yaml \ - --modulepath spec/fixtures/modules \ - --no-host-key-check \ - --params @upgrade_params.json - echo ::endgroup:: - - name: Check if we still have legacy compilers configured - timeout-minutes: 120 - run: | - echo ::group::inventory - sed -e 's/password: .*/password: "[redacted]"/' < spec/fixtures/litmus_inventory.yaml || true - echo ::endgroup:: - echo ::group::get_peadm_config - primary=$(yq '.groups[].targets[] | select(.vars.role == "primary") | .name' spec/fixtures/litmus_inventory.yaml) - compiler=$(yq '.groups[].targets[] | select(.vars.role == "compiler") | .name' spec/fixtures/litmus_inventory.yaml | head -n 1) - legacy_compiler=$(yq '.groups[].targets[] | select(.vars.role == "compiler") | .name' spec/fixtures/litmus_inventory.yaml | sed -n 2p) - bundle exec bolt task run peadm::get_peadm_config \ - --targets $primary \ - --inventoryfile spec/fixtures/litmus_inventory.yaml \ - --modulepath spec/fixtures/modules \ - --no-host-key-check \ - --format json > peadm_config.json - cat peadm_config.json - echo ::endgroup:: - echo ::group::smoke_test - configured_legacy_compiler=$(yq '.items[0].value.params.legacy_compilers[0]' peadm_config.json) - configured_compiler=$(yq '.items[0].value.params.compiler_hosts[0]' peadm_config.json) - if [ "$configured_legacy_compiler" != "$legacy_compiler" ] && [ "$configured_compiler" != "$compiler" ]; then - echo "Compilers are not configured, expected $legacy_compiler and $compiler, got $configured_legacy_compiler and $configured_compiler" - exit 1 - fi - echo ::endgroup:: - - name: Tear down test cluster - if: ${{ always() }} - continue-on-error: true - run: |- - if [ -f spec/fixtures/litmus_inventory.yaml ]; then - echo ::group::tear_down - bundle exec rake 'litmus:tear_down' - echo ::endgroup:: - echo ::group::info:request - cat request.json || true; echo - echo ::endgroup:: - fi diff --git a/.github/workflows/test-upgrade-latest-dev.yaml b/.github/workflows/test-upgrade-latest-dev.yaml deleted file mode 100644 index 37ad90a78..000000000 --- a/.github/workflows/test-upgrade-latest-dev.yaml +++ /dev/null @@ -1,135 +0,0 @@ ---- -name: Upgrade to latest dev test -on: - workflow_dispatch: - inputs: - image: - description: GCP image for test cluster - required: true - default: almalinux-cloud/almalinux-8 - architecture: - type: choice - required: true - default: standard - description: PE architecture to test - options: - - standard - - standard-with-dr - - large - - large-with-dr - - extra-large - - extra-large-with-dr - version: - type: string - required: true - description: The initial version of PE to install before upgrade - default: 2023.8.1 - ssh-debugging: - description: Boolean; whether or not to pause for ssh debugging - required: true - default: 'false' -jobs: - test-upgrade: - name: PE ${{ matrix.version }} to latest dev using ${{ matrix.architecture }} - on ${{ matrix.image }} - runs-on: ubuntu-20.04 - env: - BOLT_GEM: true - BOLT_DISABLE_ANALYTICS: true - LANG: en_US.UTF-8 - strategy: - fail-fast: false - matrix: - architecture: ['${{ github.event.inputs.architecture }}'] - version: ['${{ github.event.inputs.version }}'] - image: ['${{ github.event.inputs.image }}'] - steps: - - name: Start SSH session - if: ${{ github.event.inputs.ssh-debugging == 'true' }} - uses: luchihoratiu/debug-via-ssh@main - with: - NGROK_AUTH_TOKEN: ${{ secrets.NGROK_AUTH_TOKEN }} - SSH_PASS: ${{ secrets.SSH_PASS }} - - name: Checkout Source - uses: actions/checkout@v4 - - name: Activate Ruby 2.7 - uses: ruby/setup-ruby@v1 - with: - ruby-version: '2.7' - bundler-cache: true - - name: Print bundle environment - if: ${{ github.repository_owner == 'puppetlabs' }} - run: | - echo ::group::info:bundler - bundle env - echo ::endgroup:: - - name: Provision test cluster - timeout-minutes: 15 - run: | - echo ::group::prepare - mkdir -p $HOME/.ssh - echo 'Host *' > $HOME/.ssh/config - echo ' ServerAliveInterval 150' >> $HOME/.ssh/config - echo ' ServerAliveCountMax 2' >> $HOME/.ssh/config - bundle exec rake spec_prep - echo ::endgroup:: - echo ::group::provision - bundle exec bolt plan run peadm_spec::provision_test_cluster \ - --modulepath spec/fixtures/modules \ - provider=provision_service \ - image=${{ matrix.image }} \ - architecture=${{ matrix.architecture }} - echo ::endgroup:: - echo ::group::info:request - cat request.json || true; echo - echo ::endgroup:: - echo ::group::info:inventory - sed -e 's/password: .*/password: "[redacted]"/' < spec/fixtures/litmus_inventory.yaml || true - echo ::endgroup:: - - name: Install PE on test cluster - timeout-minutes: 120 - run: | - bundle exec bolt plan run peadm_spec::install_test_cluster \ - --inventoryfile spec/fixtures/litmus_inventory.yaml \ - --modulepath spec/fixtures/modules \ - architecture=${{ matrix.architecture }} \ - version=${{ matrix.version }} \ - console_password=${{ secrets.CONSOLE_PASSWORD }} - - name: Wait as long as the file ${HOME}/pause file is present - if: ${{ always() && github.event.inputs.ssh-debugging == 'true' }} - run: | - while [ -f "${HOME}/pause" ] ; do - echo "${HOME}/pause present, sleeping for 60 seconds..." - sleep 60 - done - echo "${HOME}/pause absent, continuing workflow." - - name: Activate twingate to obtain unreleased build - uses: twingate/github-action@main - with: - service-key: ${{ secrets.TWINGATE_PUBLIC_REPO_KEY }} - - name: Get latest build name - id: latest - run: | - echo "::set-output name=ver::$(curl -q https://artifactory.delivery.puppetlabs.net/artifactory/generic_enterprise__local/main/ci-ready/LATEST)" - - name: Upgrade PE on test cluster - timeout-minutes: 120 - run: | - bundle exec bolt plan run peadm_spec::upgrade_test_cluster \ - --inventoryfile spec/fixtures/litmus_inventory.yaml \ - --modulepath spec/fixtures/modules \ - permit_unsafe_versions=true \ - download_mode="bolthost" \ - architecture=${{ matrix.architecture }} \ - pe_installer_source="https://artifactory.delivery.puppetlabs.net/artifactory/generic_enterprise__local/main/ci-ready/puppet-enterprise-${{ steps.latest.outputs.ver }}-el-8-x86_64.tar" - - name: Tear down test cluster - if: ${{ always() }} - continue-on-error: true - run: |- - if [ -f spec/fixtures/litmus_inventory.yaml ]; then - echo ::group::tear_down - bundle exec rake 'litmus:tear_down' - echo ::endgroup:: - echo ::group::info:request - cat request.json || true; echo - echo ::endgroup:: - fi diff --git a/.github/workflows/test-upgrade-latest-xlarge-dev-nightly.yaml b/.github/workflows/test-upgrade-latest-xlarge-dev-nightly.yaml deleted file mode 100644 index 0a5ee8651..000000000 --- a/.github/workflows/test-upgrade-latest-xlarge-dev-nightly.yaml +++ /dev/null @@ -1,96 +0,0 @@ ---- -name: Upgrade to latest dev test nightly -on: - schedule: - - cron: 0 3 * * * -jobs: - test-upgrade: - name: PE ${{ matrix.version }} to nightly dev using ${{ matrix.architecture }} - on ${{ matrix.image }} - runs-on: ubuntu-20.04 - env: - BOLT_GEM: true - BOLT_DISABLE_ANALYTICS: true - LANG: en_US.UTF-8 - strategy: - fail-fast: false - matrix: - architecture: [extra-large-with-dr] - version: [2023.8.1] - image: [almalinux-cloud/almalinux-8] - steps: - - name: Checkout Source - uses: actions/checkout@v4 - - name: Activate Ruby 2.7 - uses: ruby/setup-ruby@v1 - with: - ruby-version: '2.7' - bundler-cache: true - - name: Print bundle environment - if: ${{ github.repository_owner == 'puppetlabs' }} - run: | - echo ::group::info:bundler - bundle env - echo ::endgroup:: - - name: Provision test cluster - timeout-minutes: 15 - run: | - echo ::group::prepare - mkdir -p $HOME/.ssh - echo 'Host *' > $HOME/.ssh/config - echo ' ServerAliveInterval 150' >> $HOME/.ssh/config - echo ' ServerAliveCountMax 2' >> $HOME/.ssh/config - bundle exec rake spec_prep - echo ::endgroup:: - echo ::group::provision - bundle exec bolt plan run peadm_spec::provision_test_cluster \ - --modulepath spec/fixtures/modules \ - provider=provision_service \ - image=${{ matrix.image }} \ - architecture=${{ matrix.architecture }} - echo ::endgroup:: - echo ::group::info:request - cat request.json || true; echo - echo ::endgroup:: - echo ::group::info:inventory - sed -e 's/password: .*/password: "[redacted]"/' < spec/fixtures/litmus_inventory.yaml || true - echo ::endgroup:: - - name: Install PE on test cluster - timeout-minutes: 120 - run: | - bundle exec bolt plan run peadm_spec::install_test_cluster \ - --inventoryfile spec/fixtures/litmus_inventory.yaml \ - --modulepath spec/fixtures/modules \ - architecture=${{ matrix.architecture }} \ - version=${{ matrix.version }} \ - console_password=${{ secrets.CONSOLE_PASSWORD }} - - name: Activate twingate to obtain unreleased build - uses: twingate/github-action@main - with: - service-key: ${{ secrets.TWINGATE_PUBLIC_REPO_KEY }} - - name: Get latest build name - id: latest - run: | - echo "::set-output name=ver::$(curl -q https://artifactory.delivery.puppetlabs.net/artifactory/generic_enterprise__local/main/ci-ready/LATEST)" - - name: Upgrade PE on test cluster - timeout-minutes: 120 - run: | - bundle exec bolt plan run peadm_spec::upgrade_test_cluster \ - --inventoryfile spec/fixtures/litmus_inventory.yaml \ - --modulepath spec/fixtures/modules \ - permit_unsafe_versions=true \ - download_mode="bolthost" \ - architecture=${{ matrix.architecture }} \ - pe_installer_source="https://artifactory.delivery.puppetlabs.net/artifactory/generic_enterprise__local/main/ci-ready/puppet-enterprise-${{ steps.latest.outputs.ver }}-el-8-x86_64.tar" - - name: Tear down test cluster - if: ${{ always() }} - continue-on-error: true - run: |- - if [ -f spec/fixtures/litmus_inventory.yaml ]; then - echo ::group::tear_down - bundle exec rake 'litmus:tear_down' - echo ::endgroup:: - echo ::group::info:request - cat request.json || true; echo - echo ::endgroup:: - fi diff --git a/.github/workflows/test-upgrade-matrix.yaml b/.github/workflows/test-upgrade-matrix.yaml deleted file mode 100644 index e59b4cde0..000000000 --- a/.github/workflows/test-upgrade-matrix.yaml +++ /dev/null @@ -1,139 +0,0 @@ ---- -name: Upgrade test matrix -on: - pull_request: - paths: - - .github/workflows/**/* - - spec/**/* - - lib/**/* - - tasks/**/* - - functions/**/* - - types/**/* - - plans/**/* - - hiera/**/* - - manifests/**/* - - templates/**/* - - files/**/* - - metadata.json - - Rakefile - - Gemfile - - provision.yaml - - .rspec - - .rubocop.yml - - .puppet-lint.rc - - .fixtures.yml - branches: [main] - workflow_dispatch: {} -jobs: - test-upgrade: - name: PE ${{ matrix.version }} to ${{ matrix.version_to_upgrade }} ${{ matrix.architecture }} - on ${{ matrix.image }} - runs-on: ubuntu-20.04 - env: - BOLT_GEM: true - BOLT_DISABLE_ANALYTICS: true - LANG: en_US.UTF-8 - strategy: - fail-fast: false - matrix: - architecture: [standard, extra-large-with-dr] - version: [2019.8.12, 2021.7.9, 2023.8.1] - version_to_upgrade: [2021.7.9, 2023.8.1, 2025.0.0] - image: [almalinux-cloud/almalinux-8] - download_mode: [direct] - exclude: - - version: 2019.8.12 - version_to_upgrade: 2023.8.1 - - version: 2019.8.12 - version_to_upgrade: 2025.0.0 - - version: 2021.7.9 - version_to_upgrade: 2021.7.9 - - version: 2021.7.9 - version_to_upgrade: 2025.0.0 - - version: 2023.8.1 - version_to_upgrade: 2023.8.1 - - version: 2023.8.1 - version_to_upgrade: 2025.0.0 - - version: 2023.8.1 - version_to_upgrade: 2021.7.9 - steps: - - name: Start SSH session - if: ${{ github.event.inputs.ssh-debugging == 'true' }} - uses: luchihoratiu/debug-via-ssh@main - with: - NGROK_AUTH_TOKEN: ${{ secrets.NGROK_AUTH_TOKEN }} - SSH_PASS: ${{ secrets.SSH_PASS }} - - name: Checkout Source - uses: actions/checkout@v4 - - name: Activate Ruby 2.7 - uses: ruby/setup-ruby@v1 - with: - ruby-version: '2.7' - bundler-cache: true - - name: Print bundle environment - if: ${{ github.repository_owner == 'puppetlabs' }} - run: | - echo ::group::info:bundler - bundle env - echo ::endgroup:: - - name: Provision test cluster - timeout-minutes: 15 - run: | - echo ::group::prepare - mkdir -p $HOME/.ssh - echo 'Host *' > $HOME/.ssh/config - echo ' ServerAliveInterval 150' >> $HOME/.ssh/config - echo ' ServerAliveCountMax 2' >> $HOME/.ssh/config - bundle exec rake spec_prep - echo ::endgroup:: - echo ::group::provision - bundle exec bolt plan run peadm_spec::provision_test_cluster \ - --modulepath spec/fixtures/modules \ - provider=provision_service \ - image=${{ matrix.image }} \ - architecture=${{ matrix.architecture }} - echo ::endgroup:: - echo ::group::info:request - cat request.json || true; echo - echo ::endgroup:: - echo ::group::info:inventory - sed -e 's/password: .*/password: "[redacted]"/' < spec/fixtures/litmus_inventory.yaml || true - echo ::endgroup:: - - name: Install PE on test cluster - timeout-minutes: 120 - run: | - bundle exec bolt plan run peadm_spec::install_test_cluster \ - --inventoryfile spec/fixtures/litmus_inventory.yaml \ - --modulepath spec/fixtures/modules \ - architecture=${{ matrix.architecture }} \ - version=${{ matrix.version }} \ - console_password=${{ secrets.CONSOLE_PASSWORD }} - - name: Wait as long as the file ${HOME}/pause file is present - if: ${{ always() && github.event.inputs.ssh-debugging == 'true' }} - run: | - while [ -f "${HOME}/pause" ] ; do - echo "${HOME}/pause present, sleeping for 60 seconds..." - sleep 60 - done - echo "${HOME}/pause absent, continuing workflow." - - name: Upgrade PE on test cluster - timeout-minutes: 120 - run: | - bundle exec bolt plan run peadm_spec::upgrade_test_cluster \ - --inventoryfile spec/fixtures/litmus_inventory.yaml \ - --modulepath spec/fixtures/modules \ - architecture=${{ matrix.architecture }} \ - download_mode=${{ matrix.download_mode }} \ - version=${{ matrix.version_to_upgrade }} - - name: Tear down test cluster - if: ${{ always() }} - continue-on-error: true - run: |- - if [ -f spec/fixtures/litmus_inventory.yaml ]; then - echo ::group::tear_down - bundle exec rake 'litmus:tear_down' - echo ::endgroup:: - echo ::group::info:request - cat request.json || true; echo - echo ::endgroup:: - fi diff --git a/.github/workflows/test-upgrade.yaml b/.github/workflows/test-upgrade.yaml deleted file mode 100644 index aece32cdb..000000000 --- a/.github/workflows/test-upgrade.yaml +++ /dev/null @@ -1,130 +0,0 @@ ---- -name: Upgrade test -on: - workflow_dispatch: - inputs: - image: - description: GCP image for test cluster - required: true - default: almalinux-cloud/almalinux-8 - architecture: - type: choice - required: true - default: standard - description: PE architecture to test - options: - - standard - - standard-with-dr - - large - - large-with-dr - - extra-large - - extra-large-with-dr - version: - description: PE version to install initially - required: true - default: 2019.8.12 - upgrade_version: - description: PE version to upgrade to - required: true - default: 2021.7.9 - ssh-debugging: - description: Boolean; whether or not to pause for ssh debugging - required: true - default: 'false' -jobs: - test-upgrade: - name: PE ${{ matrix.version }} ${{ matrix.architecture }} on ${{ matrix.image }} - runs-on: ubuntu-20.04 - env: - BOLT_GEM: true - BOLT_DISABLE_ANALYTICS: true - LANG: en_US.UTF-8 - strategy: - fail-fast: false - matrix: - download_mode: [direct] - architecture: ['${{ github.event.inputs.architecture }}'] - version: ['${{ github.event.inputs.version }}'] - version_to_upgrade: ['${{ github.event.inputs.upgrade_version }}'] - image: ['${{ github.event.inputs.image }}'] - steps: - - name: Start SSH session - if: ${{ github.event.inputs.ssh-debugging == 'true' }} - uses: luchihoratiu/debug-via-ssh@main - with: - NGROK_AUTH_TOKEN: ${{ secrets.NGROK_AUTH_TOKEN }} - SSH_PASS: ${{ secrets.SSH_PASS }} - - name: Checkout Source - uses: actions/checkout@v4 - - name: Activate Ruby 2.7 - uses: ruby/setup-ruby@v1 - with: - ruby-version: '2.7' - bundler-cache: true - - name: Print bundle environment - if: ${{ github.repository_owner == 'puppetlabs' }} - run: | - echo ::group::info:bundler - bundle env - echo ::endgroup:: - - name: Provision test cluster - timeout-minutes: 15 - run: | - echo ::group::prepare - mkdir -p $HOME/.ssh - echo 'Host *' > $HOME/.ssh/config - echo ' ServerAliveInterval 150' >> $HOME/.ssh/config - echo ' ServerAliveCountMax 2' >> $HOME/.ssh/config - bundle exec rake spec_prep - echo ::endgroup:: - echo ::group::provision - bundle exec bolt plan run peadm_spec::provision_test_cluster \ - --modulepath spec/fixtures/modules \ - provider=provision_service \ - image=${{ matrix.image }} \ - architecture=${{ matrix.architecture }} - echo ::endgroup:: - echo ::group::info:request - cat request.json || true; echo - echo ::endgroup:: - echo ::group::info:inventory - sed -e 's/password: .*/password: "[redacted]"/' < spec/fixtures/litmus_inventory.yaml || true - echo ::endgroup:: - - name: Install PE on test cluster - timeout-minutes: 120 - run: | - bundle exec bolt plan run peadm_spec::install_test_cluster \ - --inventoryfile spec/fixtures/litmus_inventory.yaml \ - --modulepath spec/fixtures/modules \ - architecture=${{ matrix.architecture }} \ - version=${{ matrix.version }} \ - console_password=${{ secrets.CONSOLE_PASSWORD }} - - name: Wait as long as the file ${HOME}/pause file is present - if: ${{ always() && github.event.inputs.ssh-debugging == 'true' }} - run: | - while [ -f "${HOME}/pause" ] ; do - echo "${HOME}/pause present, sleeping for 60 seconds..." - sleep 60 - done - echo "${HOME}/pause absent, continuing workflow." - - name: Upgrade PE on test cluster - timeout-minutes: 120 - run: | - bundle exec bolt plan run peadm_spec::upgrade_test_cluster \ - --inventoryfile spec/fixtures/litmus_inventory.yaml \ - --modulepath spec/fixtures/modules \ - architecture=${{ matrix.architecture }} \ - download_mode=${{ matrix.download_mode }} \ - version=${{ matrix.version_to_upgrade }} - - name: Tear down test cluster - if: ${{ always() }} - continue-on-error: true - run: |- - if [ -f spec/fixtures/litmus_inventory.yaml ]; then - echo ::group::tear_down - bundle exec rake 'litmus:tear_down' - echo ::endgroup:: - echo ::group::info:request - cat request.json || true; echo - echo ::endgroup:: - fi diff --git a/.github/workflows/yamlformatter.yml b/.github/workflows/yamlformatter.yml deleted file mode 100644 index a96ee756f..000000000 --- a/.github/workflows/yamlformatter.yml +++ /dev/null @@ -1,40 +0,0 @@ ---- -name: Format yaml files -on: - pull_request: - branches: [main] - paths: ['**/*.yml', '**/*.yaml'] -permissions: - contents: write - pull-requests: write -jobs: - format-yaml-files: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4 - - name: Get file changes - id: get_file_changes - uses: trilom/file-changes-action@1.2.4 - with: - output: ' ' - - name: Select only the yaml files - id: changed_yaml_files - run: | - echo ${{ steps.get_file_changes.outputs.files }} | xargs -n 1 | grep -E "\.yml$|\.yaml$" > changed_files.txt - # Remove dependabot.yml if it exists in the list - sed -i '/.github\/dependabot.yml/d' changed_files.txt || true - yaml_files=$(cat changed_files.txt | tr '\n' ' ') - rm changed_files.txt - echo "files=${yaml_files}" >> $GITHUB_OUTPUT - - name: Yamlfix - id: yamlfix - uses: comfucios/yamlfix-action@v1.0.8 - with: - files: ${{ steps.changed_yaml_files.outputs.files }} - - name: commit-changes - if: ${{ steps.yamlfix.outputs.changed_files == 'true' }} - uses: stefanzweifel/git-auto-commit-action@v5 - with: - commit_message: Apply Yamlfix format changes. - status_options: --untracked-files=no From 9464f4a3c3d848cc88fe72a9ddf367726dd5b1e7 Mon Sep 17 00:00:00 2001 From: petergmurphy Date: Thu, 13 Feb 2025 10:57:09 +0000 Subject: [PATCH 02/30] Add CI test for replace_failed_postgresql plan --- .../test-replace-failed-postgresql.yaml | 120 ++++++++++++++++++ 1 file changed, 120 insertions(+) create mode 100644 .github/workflows/test-replace-failed-postgresql.yaml diff --git a/.github/workflows/test-replace-failed-postgresql.yaml b/.github/workflows/test-replace-failed-postgresql.yaml new file mode 100644 index 000000000..1a66570ea --- /dev/null +++ b/.github/workflows/test-replace-failed-postgresql.yaml @@ -0,0 +1,120 @@ +--- +name: Test replace failed PostgreSQL +on: + pull_request: + paths: + - .github/workflows/**/* + - spec/**/* + - lib/**/* + - tasks/**/* + - functions/**/* + - types/**/* + - plans/**/* + - hiera/**/* + - manifests/**/* + - templates/**/* + - files/**/* + - metadata.json + - Rakefile + - Gemfile + - provision.yaml + - .rspec + - .rubocop.yml + - .puppet-lint.rc + - .fixtures.yml + branches: [main] + workflow_dispatch: {} +jobs: + test-replace-failed-postgresql: + name: PE ${{ matrix.version }} ${{ matrix.architecture }} on ${{ matrix.image }} + runs-on: ubuntu-20.04 + env: + BOLT_GEM: true + BOLT_DISABLE_ANALYTICS: true + LANG: en_US.UTF-8 + strategy: + fail-fast: false + matrix: + architecture: [extra-large-with-dr-and-spare-replica] + install_architecture: [extra-large-with-dr] + version: [2023.8.0] # can change to test multiple versions once this one works + image: [almalinux-cloud/almalinux-8] + steps: + - name: Checkout Source + uses: actions/checkout@v4 + with: + ref: ${{ github.head_ref }} + - name: Activate Ruby 2.7 + uses: ruby/setup-ruby@v1 + with: + ruby-version: '2.7' + bundler-cache: true + - name: Print bundle environment + if: ${{ github.repository_owner == 'puppetlabs' }} + run: | + echo ::group::info:bundler + bundle env + echo ::endgroup:: + - name: Provision test cluster + timeout-minutes: 15 + run: | + echo ::group::prepare + mkdir -p $HOME/.ssh + echo 'Host *' > $HOME/.ssh/config + echo ' ServerAliveInterval 150' >> $HOME/.ssh/config + echo ' ServerAliveCountMax 2' >> $HOME/.ssh/config + bundle exec rake spec_prep + echo ::endgroup:: + echo ::group::provision + bundle exec bolt plan run peadm_spec::provision_test_cluster \ + --modulepath spec/fixtures/modules \ + provider=provision_service \ + image=${{ matrix.image }} \ + architecture=${{ matrix.architecture }} \ + --log-level trace + echo ::endgroup:: + echo ::group::info:request + cat request.json || true; echo + echo ::endgroup:: + echo ::group::info:inventory + sed -e 's/password: .*/password: "[redacted]"/' < spec/fixtures/litmus_inventory.yaml || true + echo ::endgroup:: + - name: Install PE on test cluster + timeout-minutes: 120 + run: | + bundle exec bolt plan run peadm_spec::install_test_cluster \ + --inventoryfile spec/fixtures/litmus_inventory.yaml \ + --modulepath spec/fixtures/modules \ + architecture=${{ matrix.install_architecture }} \ + version=${{ matrix.version }} \ + console_password=${{ secrets.CONSOLE_PASSWORD }} + - name: Replace failed PostgreSQL + run: | + echo ::group::prepare + mkdir -p $HOME/.ssh + echo 'Host *' > $HOME/.ssh/config + echo ' ServerAliveInterval 150' >> $HOME/.ssh/config + echo ' ServerAliveCountMax 2' >> $HOME/.ssh/config + bundle exec rake spec_prep + echo ::endgroup:: + bundle exec bolt plan run peadm::replace_failed_postgresql \ + --inventoryfile spec/fixtures/litmus_inventory.yaml \ + --modulepath spec/fixtures/modules \ + primary_host=$(yq '.groups[].targets[] | select(.vars.role == "primary") | .uri' spec/fixtures/litmus_inventory.yaml) \ + replica_host=$(yq '.groups[].targets[] | select(.vars.role == "replica") | .uri' spec/fixtures/litmus_inventory.yaml) \ + working_postgresql_host=$(yq '.groups[].targets[] | select(.vars.role == "replica-pdb-postgresql") | .uri' spec/fixtures/litmus_inventory.yaml) \ + failed_postgresql_host=$(yq '.groups[].targets[] | select(.vars.role == "primary-pdb-postgresql") | .uri' spec/fixtures/litmus_inventory.yaml) \ + replacement_postgresql_host=$(yq '.groups[].targets[] | select(.vars.role == "spare-replica") | .uri' spec/fixtures/litmus_inventory.yaml) \ + --no-host-key-check + - name: Tear down PE XL DR test cluster + if: ${{ always() }} + continue-on-error: true + run: |- + if [ -f spec/fixtures/litmus_inventory.yaml ]; then + echo ::group::tear_down + bundle exec rake 'litmus:tear_down' + echo ::endgroup:: + echo ::group::info:request + cat request.json || true; echo + echo ::endgroup:: + fi From f9c6515e47fdffab39044a4b6079ea7c609a0ce9 Mon Sep 17 00:00:00 2001 From: David Mallon Date: Mon, 17 Feb 2025 14:15:56 +0000 Subject: [PATCH 03/30] add debug --- .github/workflows/test-replace-failed-postgresql.yaml | 3 +++ plans/util/update_db_setting.pp | 1 + 2 files changed, 4 insertions(+) diff --git a/.github/workflows/test-replace-failed-postgresql.yaml b/.github/workflows/test-replace-failed-postgresql.yaml index 1a66570ea..e025d6d96 100644 --- a/.github/workflows/test-replace-failed-postgresql.yaml +++ b/.github/workflows/test-replace-failed-postgresql.yaml @@ -88,6 +88,9 @@ jobs: architecture=${{ matrix.install_architecture }} \ version=${{ matrix.version }} \ console_password=${{ secrets.CONSOLE_PASSWORD }} + - name: Output contents of litmus_inventory.yaml + run: | + cat spec/fixtures/litmus_inventory.yaml - name: Replace failed PostgreSQL run: | echo ::group::prepare diff --git a/plans/util/update_db_setting.pp b/plans/util/update_db_setting.pp index 9035d0fc7..6bb129829 100644 --- a/plans/util/update_db_setting.pp +++ b/plans/util/update_db_setting.pp @@ -35,6 +35,7 @@ $db_setting = "//${db}:5432/pe-puppetdb?ssl=true&sslfactory=org.postgresql.ssl.jdbc4.LibPQFactory&sslmode=verify-full&sslrootcert=/etc/puppetlabs/puppet/ssl/certs/ca.pem&sslkey=/etc/puppetlabs/puppetdb/ssl/${target.peadm::certname()}.private_key.pk8&sslcert=/etc/puppetlabs/puppetdb/ssl/${$target.peadm::certname()}.cert.pem" # lint:ignore:140chars + out::message("Updating PuppetDB database settings on ${target} to ${db_setting}") # Introduces dependency so PEADM can modify INI files apply($target) { ini_setting { 'database_setting': From 7b4a8ef378312b81a6c48eb79df291e2f61d67e5 Mon Sep 17 00:00:00 2001 From: David Mallon Date: Mon, 17 Feb 2025 15:00:24 +0000 Subject: [PATCH 04/30] more debug --- plans/replace_failed_postgresql.pp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/plans/replace_failed_postgresql.pp b/plans/replace_failed_postgresql.pp index f1a0dc823..53de83d49 100644 --- a/plans/replace_failed_postgresql.pp +++ b/plans/replace_failed_postgresql.pp @@ -19,6 +19,12 @@ $failed_postgresql_host, $replacement_postgresql_host, ]) + # output value of each parameter individually + out::message("Primary host: ${$primary_host}") + out::message("Replica host: ${$replica_host}") + out::message("Working PostgreSQL host: ${$working_postgresql_host}") + out::message("Failed PostgreSQL host: ${$failed_postgresql_host}") + out::message("Replacement PostgreSQL host: ${$replacement_postgresql_host}") # verify we can connect to targets proded before proceeding run_command('hostname', $all_hosts) @@ -41,6 +47,7 @@ run_task('service', $pe_hosts, 'action' => 'stop', 'name' => 'puppet.service') # Temporarily set both primary and replica server nodes so that they use the remaining healthy PE-PostgreSQL server + out::message("Updating database settings on ${$pe_hosts} to use ${$working_postgresql_host}") run_plan('peadm::util::update_db_setting', $pe_hosts, postgresql_host => $working_postgresql_host, override => true, From 4c4097ea2682c918f207bf638df3294ff23f009f Mon Sep 17 00:00:00 2001 From: David Mallon Date: Mon, 17 Feb 2025 16:36:05 +0000 Subject: [PATCH 05/30] check pe host status --- plans/replace_failed_postgresql.pp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/plans/replace_failed_postgresql.pp b/plans/replace_failed_postgresql.pp index 53de83d49..c5c57e85c 100644 --- a/plans/replace_failed_postgresql.pp +++ b/plans/replace_failed_postgresql.pp @@ -46,6 +46,21 @@ # Stop puppet.service on Puppet server primary and replica run_task('service', $pe_hosts, 'action' => 'stop', 'name' => 'puppet.service') + # loop over pe_hosts and output info + $pe_hosts.each |$host| { + $status = run_plan('peadm::status', $host, { 'format' => 'json' }) + out::message("Host ${host} status: ${status}") + + if empty($status['failed']) { + out::message("Cluster on ${host} is healthy, continuing") + } else { + out::message("Cluster on ${host} is not healthy, aborting") + } + + $result = run_task('peadm::get_peadm_config', $host, '_catch_errors' => true).first.to_data() + out::message("PE configuration on ${host}: ${result}") + } + # Temporarily set both primary and replica server nodes so that they use the remaining healthy PE-PostgreSQL server out::message("Updating database settings on ${$pe_hosts} to use ${$working_postgresql_host}") run_plan('peadm::util::update_db_setting', $pe_hosts, From 4211f2a524baf47ea31afd7b590e7eb6b18f0356 Mon Sep 17 00:00:00 2001 From: David Mallon Date: Tue, 18 Feb 2025 09:27:20 +0000 Subject: [PATCH 06/30] different pe version --- .github/workflows/test-replace-failed-postgresql.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-replace-failed-postgresql.yaml b/.github/workflows/test-replace-failed-postgresql.yaml index e025d6d96..4927f0c27 100644 --- a/.github/workflows/test-replace-failed-postgresql.yaml +++ b/.github/workflows/test-replace-failed-postgresql.yaml @@ -37,7 +37,7 @@ jobs: matrix: architecture: [extra-large-with-dr-and-spare-replica] install_architecture: [extra-large-with-dr] - version: [2023.8.0] # can change to test multiple versions once this one works + version: [2023.8.1] # can change to test multiple versions once this one works image: [almalinux-cloud/almalinux-8] steps: - name: Checkout Source From 52571e3b9c906ebfc5ec36489aaad6eaf93ce8a0 Mon Sep 17 00:00:00 2001 From: David Mallon Date: Tue, 18 Feb 2025 10:38:22 +0000 Subject: [PATCH 07/30] use code manager --- .github/workflows/test-replace-failed-postgresql.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test-replace-failed-postgresql.yaml b/.github/workflows/test-replace-failed-postgresql.yaml index 4927f0c27..d52f064c6 100644 --- a/.github/workflows/test-replace-failed-postgresql.yaml +++ b/.github/workflows/test-replace-failed-postgresql.yaml @@ -87,7 +87,8 @@ jobs: --modulepath spec/fixtures/modules \ architecture=${{ matrix.install_architecture }} \ version=${{ matrix.version }} \ - console_password=${{ secrets.CONSOLE_PASSWORD }} + console_password=${{ secrets.CONSOLE_PASSWORD }} \ + code_manager_auto_configure=true - name: Output contents of litmus_inventory.yaml run: | cat spec/fixtures/litmus_inventory.yaml From 1728c3c3cc2b1f63511bc2c207c0a06bdeeea4c5 Mon Sep 17 00:00:00 2001 From: David Mallon Date: Tue, 18 Feb 2025 10:52:11 +0000 Subject: [PATCH 08/30] correct typo? --- .github/workflows/test-replace-failed-postgresql.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-replace-failed-postgresql.yaml b/.github/workflows/test-replace-failed-postgresql.yaml index d52f064c6..af4603c3b 100644 --- a/.github/workflows/test-replace-failed-postgresql.yaml +++ b/.github/workflows/test-replace-failed-postgresql.yaml @@ -87,8 +87,8 @@ jobs: --modulepath spec/fixtures/modules \ architecture=${{ matrix.install_architecture }} \ version=${{ matrix.version }} \ - console_password=${{ secrets.CONSOLE_PASSWORD }} \ - code_manager_auto_configure=true + console_password=${{ secrets.CONSOLE_PASSWORD }} \ + code_manager_auto_configure=true - name: Output contents of litmus_inventory.yaml run: | cat spec/fixtures/litmus_inventory.yaml From 1329cacb5542c0a02b7d78f1d8d65ab37c266f7e Mon Sep 17 00:00:00 2001 From: David Mallon Date: Tue, 18 Feb 2025 12:04:54 +0000 Subject: [PATCH 09/30] try bumping versions to match module and adding in inifile --- .fixtures.yml | 1 + spec/docker/bolt-project.yaml | 8 +++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/.fixtures.yml b/.fixtures.yml index 9241a4faf..59805deb5 100644 --- a/.fixtures.yml +++ b/.fixtures.yml @@ -5,6 +5,7 @@ fixtures: service: "puppetlabs/service" package: "puppetlabs/package" reboot: "puppetlabs/reboot" + inifile: "puppetlabs/inifile" repositories: facts: "https://github.com/puppetlabs/puppetlabs-facts.git" puppet_agent: "https://github.com/puppetlabs/puppetlabs-puppet_agent.git" diff --git a/spec/docker/bolt-project.yaml b/spec/docker/bolt-project.yaml index 52acb2d2e..7f8bc49dc 100644 --- a/spec/docker/bolt-project.yaml +++ b/spec/docker/bolt-project.yaml @@ -4,10 +4,16 @@ modules: - name: nwops/container_inventory version_requirement: ">= 0.1.1" - name: puppetlabs/stdlib - version_requirement: ">= 6.5.0 < 8.0.0" + version_requirement: ">= 9.0.0 < 10.0.0" - puppetlabs/ruby_task_helper - name: puppetlabs/node_manager version_requirement: ">= 1.0.1 < 2.0.0" + - name: puppetlabs/service + version_requirement: ">= 1.3.0 <= 4.0.0" + - name: puppetlabs/package + version_requirement: ">= 2.1.0 <= 4.0.0" + - name: puppetlabs/inifile + version_requirement: ">= 6.1.0 < 7.0.0" - puppetlabs/apply_helpers - puppetlabs/bolt_shim - puppet/format From ac04a4849f30ce509d686145737fa7473da5455f Mon Sep 17 00:00:00 2001 From: David Mallon Date: Tue, 18 Feb 2025 15:10:03 +0000 Subject: [PATCH 10/30] push some more debug --- plans/replace_failed_postgresql.pp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/plans/replace_failed_postgresql.pp b/plans/replace_failed_postgresql.pp index c5c57e85c..b895995a0 100644 --- a/plans/replace_failed_postgresql.pp +++ b/plans/replace_failed_postgresql.pp @@ -68,6 +68,21 @@ override => true, ) + # loop over pe_hosts and output info + $pe_hosts.each |$host| { + $status = run_plan('peadm::status', $host, { 'format' => 'json' }) + out::message("2. Host ${host} status: ${status}") + + if empty($status['failed']) { + out::message("2. Cluster on ${host} is healthy, continuing") + } else { + out::message("2. Cluster on ${host} is not healthy, aborting") + } + + $result = run_task('peadm::get_peadm_config', $host, '_catch_errors' => true).first.to_data() + out::message("2. PE configuration on ${host}: ${result}") + } + # Restart pe-puppetdb.service on Puppet server primary and replica run_task('service', $pe_hosts, { action => 'restart', name => 'pe-puppetdb.service' }) From 85fdc82fbbcfac386087445725417e0e7d9f3dd7 Mon Sep 17 00:00:00 2001 From: David Mallon Date: Tue, 18 Feb 2025 16:44:57 +0000 Subject: [PATCH 11/30] bit more debug --- plans/add_database.pp | 3 +++ plans/replace_failed_postgresql.pp | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/plans/add_database.pp b/plans/add_database.pp index 72860bba9..11daa3359 100644 --- a/plans/add_database.pp +++ b/plans/add_database.pp @@ -67,6 +67,9 @@ # Assume PuppetDB backend hosted on Primary if in init mode $source_db_host = $primary_host } else { + out::message("PostgreSQL host: ${postgresql_host}") + out::message("postgresql_a_host: ${postgresql_a_host}") + out::message("postgresql_b_host: ${postgresql_b_host}") # The letter which doesn't yet have a server assigned or in the event this # is a replacement operation, the letter this node was assigned to previously $avail_group_letter = peadm::flatten_compact($roles['postgresql'].map |$k,$v| { diff --git a/plans/replace_failed_postgresql.pp b/plans/replace_failed_postgresql.pp index b895995a0..8fff3cd15 100644 --- a/plans/replace_failed_postgresql.pp +++ b/plans/replace_failed_postgresql.pp @@ -80,7 +80,8 @@ } $result = run_task('peadm::get_peadm_config', $host, '_catch_errors' => true).first.to_data() - out::message("2. PE configuration on ${host}: ${result}") + $result_formatted = stdlib::to_json_pretty(parsejson($result)) + out::message("2. PE configuration on ${host}: ${result_formatted}") } # Restart pe-puppetdb.service on Puppet server primary and replica From ea7932ea2adee2525d6f2c26c5318f9709cab184 Mon Sep 17 00:00:00 2001 From: David Mallon Date: Wed, 19 Feb 2025 09:36:59 +0000 Subject: [PATCH 12/30] fix thing --- plans/replace_failed_postgresql.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plans/replace_failed_postgresql.pp b/plans/replace_failed_postgresql.pp index 8fff3cd15..3c60a96b9 100644 --- a/plans/replace_failed_postgresql.pp +++ b/plans/replace_failed_postgresql.pp @@ -80,7 +80,7 @@ } $result = run_task('peadm::get_peadm_config', $host, '_catch_errors' => true).first.to_data() - $result_formatted = stdlib::to_json_pretty(parsejson($result)) + $result_formatted = stdlib::to_json_pretty($result) out::message("2. PE configuration on ${host}: ${result_formatted}") } From 7835e8cbe33c12731270a3c3002747c4bff491a9 Mon Sep 17 00:00:00 2001 From: David Mallon Date: Wed, 19 Feb 2025 10:54:10 +0000 Subject: [PATCH 13/30] extra --- plans/replace_failed_postgresql.pp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plans/replace_failed_postgresql.pp b/plans/replace_failed_postgresql.pp index 3c60a96b9..5855d0565 100644 --- a/plans/replace_failed_postgresql.pp +++ b/plans/replace_failed_postgresql.pp @@ -58,7 +58,8 @@ } $result = run_task('peadm::get_peadm_config', $host, '_catch_errors' => true).first.to_data() - out::message("PE configuration on ${host}: ${result}") + $result_formatted = stdlib::to_json_pretty($result) + out::message("PE configuration on ${host}: ${result_formatted}") } # Temporarily set both primary and replica server nodes so that they use the remaining healthy PE-PostgreSQL server From 3134b420b9a27355bc114ef8ab39ccf19fa6ba9a Mon Sep 17 00:00:00 2001 From: David Mallon Date: Wed, 19 Feb 2025 14:40:39 +0000 Subject: [PATCH 14/30] see diff of target and host --- plans/add_database.pp | 1 + 1 file changed, 1 insertion(+) diff --git a/plans/add_database.pp b/plans/add_database.pp index 11daa3359..5f275bfe7 100644 --- a/plans/add_database.pp +++ b/plans/add_database.pp @@ -68,6 +68,7 @@ $source_db_host = $primary_host } else { out::message("PostgreSQL host: ${postgresql_host}") + out::message("postgresql_target: ${postgresql_target}") out::message("postgresql_a_host: ${postgresql_a_host}") out::message("postgresql_b_host: ${postgresql_b_host}") # The letter which doesn't yet have a server assigned or in the event this From d165f0c0e4ef8ce021f4ed15c4130d18dd2b193b Mon Sep 17 00:00:00 2001 From: David Mallon Date: Wed, 19 Feb 2025 16:17:50 +0000 Subject: [PATCH 15/30] try fqdn too --- plans/add_database.pp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/plans/add_database.pp b/plans/add_database.pp index 5f275bfe7..e60fd8552 100644 --- a/plans/add_database.pp +++ b/plans/add_database.pp @@ -69,12 +69,16 @@ } else { out::message("PostgreSQL host: ${postgresql_host}") out::message("postgresql_target: ${postgresql_target}") + out::message("Primary host: ${primary_host}") + out::message("Primary target: ${primary_target}") out::message("postgresql_a_host: ${postgresql_a_host}") out::message("postgresql_b_host: ${postgresql_b_host}") + $fqdn = run_command('hostname -f', $postgresql_host) + out::message("FQDN: ${fqdn}") # The letter which doesn't yet have a server assigned or in the event this # is a replacement operation, the letter this node was assigned to previously $avail_group_letter = peadm::flatten_compact($roles['postgresql'].map |$k,$v| { - if (! $v) or ($v == $postgresql_host) { + if (! $v) or ($v == $postgresql_host) or ($v == $fqdn) { $k } })[0] From 9f92132538256424e709de836799bcf0d51e74df Mon Sep 17 00:00:00 2001 From: David Mallon Date: Thu, 20 Feb 2025 09:31:59 +0000 Subject: [PATCH 16/30] try a wrapper plan to pass in hostnames instead of ip address --- .../test-replace-failed-postgresql.yaml | 28 ++++++++-------- .../plans/test_replace_failed_postgres.pp | 33 +++++++++++++++++++ 2 files changed, 47 insertions(+), 14 deletions(-) create mode 100644 spec/acceptance/peadm_spec/plans/test_replace_failed_postgres.pp diff --git a/.github/workflows/test-replace-failed-postgresql.yaml b/.github/workflows/test-replace-failed-postgresql.yaml index af4603c3b..c3d2bb980 100644 --- a/.github/workflows/test-replace-failed-postgresql.yaml +++ b/.github/workflows/test-replace-failed-postgresql.yaml @@ -79,19 +79,6 @@ jobs: echo ::group::info:inventory sed -e 's/password: .*/password: "[redacted]"/' < spec/fixtures/litmus_inventory.yaml || true echo ::endgroup:: - - name: Install PE on test cluster - timeout-minutes: 120 - run: | - bundle exec bolt plan run peadm_spec::install_test_cluster \ - --inventoryfile spec/fixtures/litmus_inventory.yaml \ - --modulepath spec/fixtures/modules \ - architecture=${{ matrix.install_architecture }} \ - version=${{ matrix.version }} \ - console_password=${{ secrets.CONSOLE_PASSWORD }} \ - code_manager_auto_configure=true - - name: Output contents of litmus_inventory.yaml - run: | - cat spec/fixtures/litmus_inventory.yaml - name: Replace failed PostgreSQL run: | echo ::group::prepare @@ -101,7 +88,7 @@ jobs: echo ' ServerAliveCountMax 2' >> $HOME/.ssh/config bundle exec rake spec_prep echo ::endgroup:: - bundle exec bolt plan run peadm::replace_failed_postgresql \ + bundle exec bolt plan run peadm_spec::test_replace_failed_postgres \ --inventoryfile spec/fixtures/litmus_inventory.yaml \ --modulepath spec/fixtures/modules \ primary_host=$(yq '.groups[].targets[] | select(.vars.role == "primary") | .uri' spec/fixtures/litmus_inventory.yaml) \ @@ -110,6 +97,19 @@ jobs: failed_postgresql_host=$(yq '.groups[].targets[] | select(.vars.role == "primary-pdb-postgresql") | .uri' spec/fixtures/litmus_inventory.yaml) \ replacement_postgresql_host=$(yq '.groups[].targets[] | select(.vars.role == "spare-replica") | .uri' spec/fixtures/litmus_inventory.yaml) \ --no-host-key-check + - name: Install PE on test cluster + timeout-minutes: 120 + run: | + bundle exec bolt plan run peadm_spec::install_test_cluster \ + --inventoryfile spec/fixtures/litmus_inventory.yaml \ + --modulepath spec/fixtures/modules \ + architecture=${{ matrix.install_architecture }} \ + version=${{ matrix.version }} \ + console_password=${{ secrets.CONSOLE_PASSWORD }} \ + code_manager_auto_configure=true + - name: Output contents of litmus_inventory.yaml + run: | + cat spec/fixtures/litmus_inventory.yaml - name: Tear down PE XL DR test cluster if: ${{ always() }} continue-on-error: true diff --git a/spec/acceptance/peadm_spec/plans/test_replace_failed_postgres.pp b/spec/acceptance/peadm_spec/plans/test_replace_failed_postgres.pp new file mode 100644 index 000000000..1f1fd15af --- /dev/null +++ b/spec/acceptance/peadm_spec/plans/test_replace_failed_postgres.pp @@ -0,0 +1,33 @@ +plan peadm_spec::test_replace_failed_postgres( + Peadm::SingleTargetSpec $primary_host, + Peadm::SingleTargetSpec $replica_host, + Peadm::SingleTargetSpec $working_postgresql_host, + Peadm::SingleTargetSpec $failed_postgresql_host, + Peadm::SingleTargetSpec $replacement_postgresql_host, +) { + $primary_fqdn = run_command('hostname -f', $primary_host).first['stdout'].chomp + $replica_fqdn = run_command('hostname -f', $replica_host).first['stdout'].chomp + $working_postgres_fqdn = run_command('hostname -f', $working_postgresql_host).first['stdout'].chomp + $failed_postgres_fqdn = run_command('hostname -f', $failed_postgresql_host).first['stdout'].chomp + $replacement_postgres_fqdn = run_command('hostname -f', $replacement_postgresql_host).first['stdout'].chomp + + # run infra status on the primary + $primary_host = $t.filter |$n| { $n.vars['role'] == 'primary' }[0] + out::message("Running peadm::status on primary host ${primary_host}") + $result = run_plan('peadm::status', $primary_host, { 'format' => 'json' }) + + out::message($result) + + if empty($result['failed']) { + out::message('Cluster is healthy, continuing') + } else { + fail_plan('Cluster is not healthy, aborting') + } + run_plan('peadm::replace_failed_postgresql', + primary_host => $primary_fqdn, + replica_host => $replica_fqdn, + working_postgresql_host => $working_postgresql_fqdn, + failed_postgresql_host => $failed_postgresql_fqdn, + replacement_postgresql_host => $replacement_postgresql_fqdn, + ) +} From bd38a905174a41c2fd3dccfd229f96d2d35c8aa7 Mon Sep 17 00:00:00 2001 From: David Mallon Date: Thu, 20 Feb 2025 09:41:44 +0000 Subject: [PATCH 17/30] alter --- .../plans/test_replace_failed_postgres.pp | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/spec/acceptance/peadm_spec/plans/test_replace_failed_postgres.pp b/spec/acceptance/peadm_spec/plans/test_replace_failed_postgres.pp index 1f1fd15af..908fc8203 100644 --- a/spec/acceptance/peadm_spec/plans/test_replace_failed_postgres.pp +++ b/spec/acceptance/peadm_spec/plans/test_replace_failed_postgres.pp @@ -11,18 +11,12 @@ $failed_postgres_fqdn = run_command('hostname -f', $failed_postgresql_host).first['stdout'].chomp $replacement_postgres_fqdn = run_command('hostname -f', $replacement_postgresql_host).first['stdout'].chomp - # run infra status on the primary - $primary_host = $t.filter |$n| { $n.vars['role'] == 'primary' }[0] - out::message("Running peadm::status on primary host ${primary_host}") - $result = run_plan('peadm::status', $primary_host, { 'format' => 'json' }) + out::message("Primary host: ${primary_host}, fqdn: ${primary_fqdn}") + out::message("Replica host: ${replica_host}, fqdn: ${replica_fqdn}") + out::message("Working PostgreSQL host: ${working_postgresql_host}, fqdn: ${working_postgres_fqdn}") + out::message("Failed PostgreSQL host: ${failed_postgresql_host}, fqdn: ${failed_postgres_fqdn}") + out::message("Replacement PostgreSQL host: ${replacement_postgresql_host}, fqdn: ${replacement_postgres_fqdn}") - out::message($result) - - if empty($result['failed']) { - out::message('Cluster is healthy, continuing') - } else { - fail_plan('Cluster is not healthy, aborting') - } run_plan('peadm::replace_failed_postgresql', primary_host => $primary_fqdn, replica_host => $replica_fqdn, From 29cd812068e0e479e701f74ec9ea07bd22cf198d Mon Sep 17 00:00:00 2001 From: David Mallon Date: Thu, 20 Feb 2025 09:51:48 +0000 Subject: [PATCH 18/30] why failing --- .../peadm_spec/plans/test_replace_failed_postgres.pp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/spec/acceptance/peadm_spec/plans/test_replace_failed_postgres.pp b/spec/acceptance/peadm_spec/plans/test_replace_failed_postgres.pp index 908fc8203..74d21a85f 100644 --- a/spec/acceptance/peadm_spec/plans/test_replace_failed_postgres.pp +++ b/spec/acceptance/peadm_spec/plans/test_replace_failed_postgres.pp @@ -5,6 +5,18 @@ Peadm::SingleTargetSpec $failed_postgresql_host, Peadm::SingleTargetSpec $replacement_postgresql_host, ) { + wait_until_available($primary_host) + wait_until_available($replica_host) + wait_until_available($working_postgresql_host) + wait_until_available($failed_postgresql_host) + wait_until_available($replacement_postgresql_host) + + out::message("Primary host: ${primary_host}") + out::message("Replica host: ${replica_host}") + out::message("Working PostgreSQL host: ${working_postgresql_host}") + out::message("Failed PostgreSQL host: ${failed_postgresql_host}") + out::message("Replacement PostgreSQL host: ${replacement_postgresql_host}") + $primary_fqdn = run_command('hostname -f', $primary_host).first['stdout'].chomp $replica_fqdn = run_command('hostname -f', $replica_host).first['stdout'].chomp $working_postgres_fqdn = run_command('hostname -f', $working_postgresql_host).first['stdout'].chomp From 49fe46c34df3afa2511c395521b41f049b40e118 Mon Sep 17 00:00:00 2001 From: David Mallon Date: Thu, 20 Feb 2025 10:01:29 +0000 Subject: [PATCH 19/30] try it --- .../test-replace-failed-postgresql.yaml | 26 +++++++++---------- .../plans/test_replace_failed_postgres.pp | 6 ++--- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/.github/workflows/test-replace-failed-postgresql.yaml b/.github/workflows/test-replace-failed-postgresql.yaml index c3d2bb980..0eab35a1a 100644 --- a/.github/workflows/test-replace-failed-postgresql.yaml +++ b/.github/workflows/test-replace-failed-postgresql.yaml @@ -79,6 +79,19 @@ jobs: echo ::group::info:inventory sed -e 's/password: .*/password: "[redacted]"/' < spec/fixtures/litmus_inventory.yaml || true echo ::endgroup:: + - name: Install PE on test cluster + timeout-minutes: 120 + run: | + bundle exec bolt plan run peadm_spec::install_test_cluster \ + --inventoryfile spec/fixtures/litmus_inventory.yaml \ + --modulepath spec/fixtures/modules \ + architecture=${{ matrix.install_architecture }} \ + version=${{ matrix.version }} \ + console_password=${{ secrets.CONSOLE_PASSWORD }} \ + code_manager_auto_configure=true + - name: Output contents of litmus_inventory.yaml + run: | + cat spec/fixtures/litmus_inventory.yaml - name: Replace failed PostgreSQL run: | echo ::group::prepare @@ -97,19 +110,6 @@ jobs: failed_postgresql_host=$(yq '.groups[].targets[] | select(.vars.role == "primary-pdb-postgresql") | .uri' spec/fixtures/litmus_inventory.yaml) \ replacement_postgresql_host=$(yq '.groups[].targets[] | select(.vars.role == "spare-replica") | .uri' spec/fixtures/litmus_inventory.yaml) \ --no-host-key-check - - name: Install PE on test cluster - timeout-minutes: 120 - run: | - bundle exec bolt plan run peadm_spec::install_test_cluster \ - --inventoryfile spec/fixtures/litmus_inventory.yaml \ - --modulepath spec/fixtures/modules \ - architecture=${{ matrix.install_architecture }} \ - version=${{ matrix.version }} \ - console_password=${{ secrets.CONSOLE_PASSWORD }} \ - code_manager_auto_configure=true - - name: Output contents of litmus_inventory.yaml - run: | - cat spec/fixtures/litmus_inventory.yaml - name: Tear down PE XL DR test cluster if: ${{ always() }} continue-on-error: true diff --git a/spec/acceptance/peadm_spec/plans/test_replace_failed_postgres.pp b/spec/acceptance/peadm_spec/plans/test_replace_failed_postgres.pp index 74d21a85f..9eb91f26c 100644 --- a/spec/acceptance/peadm_spec/plans/test_replace_failed_postgres.pp +++ b/spec/acceptance/peadm_spec/plans/test_replace_failed_postgres.pp @@ -32,8 +32,8 @@ run_plan('peadm::replace_failed_postgresql', primary_host => $primary_fqdn, replica_host => $replica_fqdn, - working_postgresql_host => $working_postgresql_fqdn, - failed_postgresql_host => $failed_postgresql_fqdn, - replacement_postgresql_host => $replacement_postgresql_fqdn, + working_postgresql_host => $working_postgres_fqdn, + failed_postgresql_host => $failed_postgres_fqdn, + replacement_postgresql_host => $replacement_postgres_fqdn, ) } From bde1def450bda97a258ae348183f6070b189af1d Mon Sep 17 00:00:00 2001 From: David Mallon Date: Thu, 20 Feb 2025 11:12:10 +0000 Subject: [PATCH 20/30] ughh --- plans/add_database.pp | 2 +- .../peadm_spec/plans/test_replace_failed_postgres.pp | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/plans/add_database.pp b/plans/add_database.pp index e60fd8552..93110efab 100644 --- a/plans/add_database.pp +++ b/plans/add_database.pp @@ -73,7 +73,7 @@ out::message("Primary target: ${primary_target}") out::message("postgresql_a_host: ${postgresql_a_host}") out::message("postgresql_b_host: ${postgresql_b_host}") - $fqdn = run_command('hostname -f', $postgresql_host) + $fqdn = run_command('hostname -f', $postgresql_host).first['stdout'].chomp out::message("FQDN: ${fqdn}") # The letter which doesn't yet have a server assigned or in the event this # is a replacement operation, the letter this node was assigned to previously diff --git a/spec/acceptance/peadm_spec/plans/test_replace_failed_postgres.pp b/spec/acceptance/peadm_spec/plans/test_replace_failed_postgres.pp index 9eb91f26c..4511219b8 100644 --- a/spec/acceptance/peadm_spec/plans/test_replace_failed_postgres.pp +++ b/spec/acceptance/peadm_spec/plans/test_replace_failed_postgres.pp @@ -30,10 +30,10 @@ out::message("Replacement PostgreSQL host: ${replacement_postgresql_host}, fqdn: ${replacement_postgres_fqdn}") run_plan('peadm::replace_failed_postgresql', - primary_host => $primary_fqdn, - replica_host => $replica_fqdn, - working_postgresql_host => $working_postgres_fqdn, - failed_postgresql_host => $failed_postgres_fqdn, - replacement_postgresql_host => $replacement_postgres_fqdn, + primary_host => $primary_host, + replica_host => $replica_host, + working_postgresql_host => $working_postgresql_host, + failed_postgresql_host => $failed_postgresql_host, + replacement_postgresql_host => $replacement_postgresql_host, ) } From f2a7f72373bd582a28de96d23c74109968e9410b Mon Sep 17 00:00:00 2001 From: David Mallon Date: Thu, 20 Feb 2025 12:23:08 +0000 Subject: [PATCH 21/30] try to add fqdns to inv file --- .../test-replace-failed-postgresql.yaml | 25 ++++++++++++------- .../plans/test_replace_failed_postgres.pp | 10 ++++---- 2 files changed, 21 insertions(+), 14 deletions(-) diff --git a/.github/workflows/test-replace-failed-postgresql.yaml b/.github/workflows/test-replace-failed-postgresql.yaml index 0eab35a1a..f3d19ee2e 100644 --- a/.github/workflows/test-replace-failed-postgresql.yaml +++ b/.github/workflows/test-replace-failed-postgresql.yaml @@ -79,16 +79,13 @@ jobs: echo ::group::info:inventory sed -e 's/password: .*/password: "[redacted]"/' < spec/fixtures/litmus_inventory.yaml || true echo ::endgroup:: - - name: Install PE on test cluster - timeout-minutes: 120 - run: | - bundle exec bolt plan run peadm_spec::install_test_cluster \ - --inventoryfile spec/fixtures/litmus_inventory.yaml \ + echo ::group::certnames + bundle exec bolt plan run peadm_spec::add_inventory_hostnames \ + --inventory spec/fixtures/litmus_inventory.yaml \ --modulepath spec/fixtures/modules \ - architecture=${{ matrix.install_architecture }} \ - version=${{ matrix.version }} \ - console_password=${{ secrets.CONSOLE_PASSWORD }} \ - code_manager_auto_configure=true + --no-host-key-check \ + inventory_file=spec/fixtures/litmus_inventory.yaml + echo ::endgroup:: - name: Output contents of litmus_inventory.yaml run: | cat spec/fixtures/litmus_inventory.yaml @@ -110,6 +107,16 @@ jobs: failed_postgresql_host=$(yq '.groups[].targets[] | select(.vars.role == "primary-pdb-postgresql") | .uri' spec/fixtures/litmus_inventory.yaml) \ replacement_postgresql_host=$(yq '.groups[].targets[] | select(.vars.role == "spare-replica") | .uri' spec/fixtures/litmus_inventory.yaml) \ --no-host-key-check + - name: Install PE on test cluster + timeout-minutes: 120 + run: | + bundle exec bolt plan run peadm_spec::install_test_cluster \ + --inventoryfile spec/fixtures/litmus_inventory.yaml \ + --modulepath spec/fixtures/modules \ + architecture=${{ matrix.install_architecture }} \ + version=${{ matrix.version }} \ + console_password=${{ secrets.CONSOLE_PASSWORD }} \ + code_manager_auto_configure=true - name: Tear down PE XL DR test cluster if: ${{ always() }} continue-on-error: true diff --git a/spec/acceptance/peadm_spec/plans/test_replace_failed_postgres.pp b/spec/acceptance/peadm_spec/plans/test_replace_failed_postgres.pp index 4511219b8..9eb91f26c 100644 --- a/spec/acceptance/peadm_spec/plans/test_replace_failed_postgres.pp +++ b/spec/acceptance/peadm_spec/plans/test_replace_failed_postgres.pp @@ -30,10 +30,10 @@ out::message("Replacement PostgreSQL host: ${replacement_postgresql_host}, fqdn: ${replacement_postgres_fqdn}") run_plan('peadm::replace_failed_postgresql', - primary_host => $primary_host, - replica_host => $replica_host, - working_postgresql_host => $working_postgresql_host, - failed_postgresql_host => $failed_postgresql_host, - replacement_postgresql_host => $replacement_postgresql_host, + primary_host => $primary_fqdn, + replica_host => $replica_fqdn, + working_postgresql_host => $working_postgres_fqdn, + failed_postgresql_host => $failed_postgres_fqdn, + replacement_postgresql_host => $replacement_postgres_fqdn, ) } From 7c063af79208027ef2c3590d544acc69052a6555 Mon Sep 17 00:00:00 2001 From: David Mallon Date: Thu, 20 Feb 2025 13:20:27 +0000 Subject: [PATCH 22/30] try that --- .../peadm_spec/plans/test_replace_failed_postgres.pp | 6 ------ 1 file changed, 6 deletions(-) diff --git a/spec/acceptance/peadm_spec/plans/test_replace_failed_postgres.pp b/spec/acceptance/peadm_spec/plans/test_replace_failed_postgres.pp index 9eb91f26c..619effc17 100644 --- a/spec/acceptance/peadm_spec/plans/test_replace_failed_postgres.pp +++ b/spec/acceptance/peadm_spec/plans/test_replace_failed_postgres.pp @@ -5,12 +5,6 @@ Peadm::SingleTargetSpec $failed_postgresql_host, Peadm::SingleTargetSpec $replacement_postgresql_host, ) { - wait_until_available($primary_host) - wait_until_available($replica_host) - wait_until_available($working_postgresql_host) - wait_until_available($failed_postgresql_host) - wait_until_available($replacement_postgresql_host) - out::message("Primary host: ${primary_host}") out::message("Replica host: ${replica_host}") out::message("Working PostgreSQL host: ${working_postgresql_host}") From 956c3d9fbfdebf610d9f858710540cf96b46136a Mon Sep 17 00:00:00 2001 From: David Mallon Date: Thu, 20 Feb 2025 13:44:09 +0000 Subject: [PATCH 23/30] well --- .../peadm_spec/plans/test_replace_failed_postgres.pp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/spec/acceptance/peadm_spec/plans/test_replace_failed_postgres.pp b/spec/acceptance/peadm_spec/plans/test_replace_failed_postgres.pp index 619effc17..20edf0b47 100644 --- a/spec/acceptance/peadm_spec/plans/test_replace_failed_postgres.pp +++ b/spec/acceptance/peadm_spec/plans/test_replace_failed_postgres.pp @@ -11,6 +11,12 @@ out::message("Failed PostgreSQL host: ${failed_postgresql_host}") out::message("Replacement PostgreSQL host: ${replacement_postgresql_host}") + wait_until_available($primary_host) + wait_until_available($replica_host) + wait_until_available($working_postgresql_host) + wait_until_available($failed_postgresql_host) + wait_until_available($replacement_postgresql_host) + $primary_fqdn = run_command('hostname -f', $primary_host).first['stdout'].chomp $replica_fqdn = run_command('hostname -f', $replica_host).first['stdout'].chomp $working_postgres_fqdn = run_command('hostname -f', $working_postgresql_host).first['stdout'].chomp From 643a7c7951dfeb127f07c7d33f82c86aad3f7492 Mon Sep 17 00:00:00 2001 From: David Mallon Date: Thu, 20 Feb 2025 14:12:05 +0000 Subject: [PATCH 24/30] move step --- .../test-replace-failed-postgresql.yaml | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/test-replace-failed-postgresql.yaml b/.github/workflows/test-replace-failed-postgresql.yaml index f3d19ee2e..eca7b9139 100644 --- a/.github/workflows/test-replace-failed-postgresql.yaml +++ b/.github/workflows/test-replace-failed-postgresql.yaml @@ -89,6 +89,16 @@ jobs: - name: Output contents of litmus_inventory.yaml run: | cat spec/fixtures/litmus_inventory.yaml + - name: Install PE on test cluster + timeout-minutes: 120 + run: | + bundle exec bolt plan run peadm_spec::install_test_cluster \ + --inventoryfile spec/fixtures/litmus_inventory.yaml \ + --modulepath spec/fixtures/modules \ + architecture=${{ matrix.install_architecture }} \ + version=${{ matrix.version }} \ + console_password=${{ secrets.CONSOLE_PASSWORD }} \ + code_manager_auto_configure=true - name: Replace failed PostgreSQL run: | echo ::group::prepare @@ -107,16 +117,6 @@ jobs: failed_postgresql_host=$(yq '.groups[].targets[] | select(.vars.role == "primary-pdb-postgresql") | .uri' spec/fixtures/litmus_inventory.yaml) \ replacement_postgresql_host=$(yq '.groups[].targets[] | select(.vars.role == "spare-replica") | .uri' spec/fixtures/litmus_inventory.yaml) \ --no-host-key-check - - name: Install PE on test cluster - timeout-minutes: 120 - run: | - bundle exec bolt plan run peadm_spec::install_test_cluster \ - --inventoryfile spec/fixtures/litmus_inventory.yaml \ - --modulepath spec/fixtures/modules \ - architecture=${{ matrix.install_architecture }} \ - version=${{ matrix.version }} \ - console_password=${{ secrets.CONSOLE_PASSWORD }} \ - code_manager_auto_configure=true - name: Tear down PE XL DR test cluster if: ${{ always() }} continue-on-error: true From 5fd14b1c8cd4e87034c0ddf7e52ccdf213442fab Mon Sep 17 00:00:00 2001 From: David Mallon Date: Thu, 20 Feb 2025 15:17:37 +0000 Subject: [PATCH 25/30] simplify --- .../test-replace-failed-postgresql.yaml | 12 +++--- .../plans/test_replace_failed_postgres.pp | 39 ------------------- 2 files changed, 6 insertions(+), 45 deletions(-) delete mode 100644 spec/acceptance/peadm_spec/plans/test_replace_failed_postgres.pp diff --git a/.github/workflows/test-replace-failed-postgresql.yaml b/.github/workflows/test-replace-failed-postgresql.yaml index eca7b9139..38c2bf623 100644 --- a/.github/workflows/test-replace-failed-postgresql.yaml +++ b/.github/workflows/test-replace-failed-postgresql.yaml @@ -108,14 +108,14 @@ jobs: echo ' ServerAliveCountMax 2' >> $HOME/.ssh/config bundle exec rake spec_prep echo ::endgroup:: - bundle exec bolt plan run peadm_spec::test_replace_failed_postgres \ + bundle exec bolt plan run peadm::replace_failed_postgresql \ --inventoryfile spec/fixtures/litmus_inventory.yaml \ --modulepath spec/fixtures/modules \ - primary_host=$(yq '.groups[].targets[] | select(.vars.role == "primary") | .uri' spec/fixtures/litmus_inventory.yaml) \ - replica_host=$(yq '.groups[].targets[] | select(.vars.role == "replica") | .uri' spec/fixtures/litmus_inventory.yaml) \ - working_postgresql_host=$(yq '.groups[].targets[] | select(.vars.role == "replica-pdb-postgresql") | .uri' spec/fixtures/litmus_inventory.yaml) \ - failed_postgresql_host=$(yq '.groups[].targets[] | select(.vars.role == "primary-pdb-postgresql") | .uri' spec/fixtures/litmus_inventory.yaml) \ - replacement_postgresql_host=$(yq '.groups[].targets[] | select(.vars.role == "spare-replica") | .uri' spec/fixtures/litmus_inventory.yaml) \ + primary_host=$(yq '.groups[].targets[] | select(.vars.role == "primary") | .name' spec/fixtures/litmus_inventory.yaml) \ + replica_host=$(yq '.groups[].targets[] | select(.vars.role == "replica") | .name' spec/fixtures/litmus_inventory.yaml) \ + working_postgresql_host=$(yq '.groups[].targets[] | select(.vars.role == "replica-pdb-postgresql") | .name' spec/fixtures/litmus_inventory.yaml) \ + failed_postgresql_host=$(yq '.groups[].targets[] | select(.vars.role == "primary-pdb-postgresql") | .name' spec/fixtures/litmus_inventory.yaml) \ + replacement_postgresql_host=$(yq '.groups[].targets[] | select(.vars.role == "spare-replica") | .name' spec/fixtures/litmus_inventory.yaml) \ --no-host-key-check - name: Tear down PE XL DR test cluster if: ${{ always() }} diff --git a/spec/acceptance/peadm_spec/plans/test_replace_failed_postgres.pp b/spec/acceptance/peadm_spec/plans/test_replace_failed_postgres.pp deleted file mode 100644 index 20edf0b47..000000000 --- a/spec/acceptance/peadm_spec/plans/test_replace_failed_postgres.pp +++ /dev/null @@ -1,39 +0,0 @@ -plan peadm_spec::test_replace_failed_postgres( - Peadm::SingleTargetSpec $primary_host, - Peadm::SingleTargetSpec $replica_host, - Peadm::SingleTargetSpec $working_postgresql_host, - Peadm::SingleTargetSpec $failed_postgresql_host, - Peadm::SingleTargetSpec $replacement_postgresql_host, -) { - out::message("Primary host: ${primary_host}") - out::message("Replica host: ${replica_host}") - out::message("Working PostgreSQL host: ${working_postgresql_host}") - out::message("Failed PostgreSQL host: ${failed_postgresql_host}") - out::message("Replacement PostgreSQL host: ${replacement_postgresql_host}") - - wait_until_available($primary_host) - wait_until_available($replica_host) - wait_until_available($working_postgresql_host) - wait_until_available($failed_postgresql_host) - wait_until_available($replacement_postgresql_host) - - $primary_fqdn = run_command('hostname -f', $primary_host).first['stdout'].chomp - $replica_fqdn = run_command('hostname -f', $replica_host).first['stdout'].chomp - $working_postgres_fqdn = run_command('hostname -f', $working_postgresql_host).first['stdout'].chomp - $failed_postgres_fqdn = run_command('hostname -f', $failed_postgresql_host).first['stdout'].chomp - $replacement_postgres_fqdn = run_command('hostname -f', $replacement_postgresql_host).first['stdout'].chomp - - out::message("Primary host: ${primary_host}, fqdn: ${primary_fqdn}") - out::message("Replica host: ${replica_host}, fqdn: ${replica_fqdn}") - out::message("Working PostgreSQL host: ${working_postgresql_host}, fqdn: ${working_postgres_fqdn}") - out::message("Failed PostgreSQL host: ${failed_postgresql_host}, fqdn: ${failed_postgres_fqdn}") - out::message("Replacement PostgreSQL host: ${replacement_postgresql_host}, fqdn: ${replacement_postgres_fqdn}") - - run_plan('peadm::replace_failed_postgresql', - primary_host => $primary_fqdn, - replica_host => $replica_fqdn, - working_postgresql_host => $working_postgres_fqdn, - failed_postgresql_host => $failed_postgres_fqdn, - replacement_postgresql_host => $replacement_postgres_fqdn, - ) -} From 0fd4dd9bf8c64f6b3c73a7656f6eeaf4d2c395ce Mon Sep 17 00:00:00 2001 From: David Mallon Date: Thu, 20 Feb 2025 16:35:34 +0000 Subject: [PATCH 26/30] test without the fqdn check --- plans/add_database.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plans/add_database.pp b/plans/add_database.pp index 93110efab..0dcb98ce9 100644 --- a/plans/add_database.pp +++ b/plans/add_database.pp @@ -78,7 +78,7 @@ # The letter which doesn't yet have a server assigned or in the event this # is a replacement operation, the letter this node was assigned to previously $avail_group_letter = peadm::flatten_compact($roles['postgresql'].map |$k,$v| { - if (! $v) or ($v == $postgresql_host) or ($v == $fqdn) { + if (! $v) or ($v == $postgresql_host) { $k } })[0] From acaa28a65ddbc8f3290854ebb2ce5282a8748d74 Mon Sep 17 00:00:00 2001 From: David Mallon Date: Thu, 20 Feb 2025 17:06:53 +0000 Subject: [PATCH 27/30] add check at end --- .../test-replace-failed-postgresql.yaml | 2 +- .../plans/test_replace_failed_postgres.pp | 46 +++++++++++++++++++ 2 files changed, 47 insertions(+), 1 deletion(-) create mode 100644 spec/acceptance/peadm_spec/plans/test_replace_failed_postgres.pp diff --git a/.github/workflows/test-replace-failed-postgresql.yaml b/.github/workflows/test-replace-failed-postgresql.yaml index 38c2bf623..e5bb187ee 100644 --- a/.github/workflows/test-replace-failed-postgresql.yaml +++ b/.github/workflows/test-replace-failed-postgresql.yaml @@ -108,7 +108,7 @@ jobs: echo ' ServerAliveCountMax 2' >> $HOME/.ssh/config bundle exec rake spec_prep echo ::endgroup:: - bundle exec bolt plan run peadm::replace_failed_postgresql \ + bundle exec bolt plan run peadm_spec::test_replace_failed_postgres \ --inventoryfile spec/fixtures/litmus_inventory.yaml \ --modulepath spec/fixtures/modules \ primary_host=$(yq '.groups[].targets[] | select(.vars.role == "primary") | .name' spec/fixtures/litmus_inventory.yaml) \ diff --git a/spec/acceptance/peadm_spec/plans/test_replace_failed_postgres.pp b/spec/acceptance/peadm_spec/plans/test_replace_failed_postgres.pp new file mode 100644 index 000000000..5de0788b6 --- /dev/null +++ b/spec/acceptance/peadm_spec/plans/test_replace_failed_postgres.pp @@ -0,0 +1,46 @@ +plan peadm_spec::test_replace_failed_postgres( + Peadm::SingleTargetSpec $primary_host, + Peadm::SingleTargetSpec $replica_host, + Peadm::SingleTargetSpec $working_postgresql_host, + Peadm::SingleTargetSpec $failed_postgresql_host, + Peadm::SingleTargetSpec $replacement_postgresql_host, +) { + # run infra status on the primary + $primary_host = $t.filter |$n| { $n.vars['role'] == 'primary' }[0] + out::message("Running peadm::status on primary host ${primary_host}") + $result = run_plan('peadm::status', $primary_host, { 'format' => 'json' }) + out::message($result) + + if empty($result['failed']) { + out::message('Cluster is healthy, continuing') + } else { + fail_plan('Cluster is not healthy, aborting') + } + + run_plan('peadm::replace_failed_postgresql', + primary_host => $primary_host, + replica_host => $replica_host, + working_postgresql_host => $working_postgresql_host, + failed_postgresql_host => $failed_postgresql_host, + replacement_postgresql_host => $replacement_postgresql_host, + ) + + # get the config from primary_host and verify failed_postgresql_host is removed and replacement was added + $result = run_task('peadm::get_peadm_config', $primary_host, '_catch_errors' => true).first.to_data() + out::message("PE configuration: ${result}") + $primary_postgres_host = $result['value']['params']['primary_postgresql_host'] + $replica_postgres_host = $result['value']['params']['replica_postgresql_host'] + + out::message("Primary PostgreSQL host: ${primary_postgres_host}") + out::message("Replica PostgreSQL host: ${replica_postgres_host}") + if $primary_postgres_host == $failed_postgresql_host or $replica_postgres_host == $failed_postgresql_host { + fail_plan("Failed PostgreSQL host ${failed_postgresql_host} was not removed from the PE configuration") + } else { + out::message("Failed PostgreSQL host ${failed_postgresql_host} was removed from the PE configuration") + } + if $primary_postgres_host == $replacement_postgresql_host or $replica_postgres_host == $replacement_postgresql_host { + fail_plan("Replacement PostgreSQL host ${replacement_postgresql_host} was not added the PE configuration") + } else { + out::message("Replacement PostgreSQL host ${replacement_postgresql_host} was added to the PE configuration") + } +} From 9c8bb3c00d1dc7da20089692739501f6cb0197fb Mon Sep 17 00:00:00 2001 From: David Mallon Date: Thu, 20 Feb 2025 19:08:23 +0000 Subject: [PATCH 28/30] fix issue --- spec/acceptance/peadm_spec/plans/test_replace_failed_postgres.pp | 1 - 1 file changed, 1 deletion(-) diff --git a/spec/acceptance/peadm_spec/plans/test_replace_failed_postgres.pp b/spec/acceptance/peadm_spec/plans/test_replace_failed_postgres.pp index 5de0788b6..e08dfc030 100644 --- a/spec/acceptance/peadm_spec/plans/test_replace_failed_postgres.pp +++ b/spec/acceptance/peadm_spec/plans/test_replace_failed_postgres.pp @@ -6,7 +6,6 @@ Peadm::SingleTargetSpec $replacement_postgresql_host, ) { # run infra status on the primary - $primary_host = $t.filter |$n| { $n.vars['role'] == 'primary' }[0] out::message("Running peadm::status on primary host ${primary_host}") $result = run_plan('peadm::status', $primary_host, { 'format' => 'json' }) out::message($result) From b63c57bbe0f6fc97f886508cb47a2dd93d316dba Mon Sep 17 00:00:00 2001 From: David Mallon Date: Thu, 20 Feb 2025 20:25:49 +0000 Subject: [PATCH 29/30] fix result --- .../peadm_spec/plans/test_replace_failed_postgres.pp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/spec/acceptance/peadm_spec/plans/test_replace_failed_postgres.pp b/spec/acceptance/peadm_spec/plans/test_replace_failed_postgres.pp index e08dfc030..934164955 100644 --- a/spec/acceptance/peadm_spec/plans/test_replace_failed_postgres.pp +++ b/spec/acceptance/peadm_spec/plans/test_replace_failed_postgres.pp @@ -7,10 +7,10 @@ ) { # run infra status on the primary out::message("Running peadm::status on primary host ${primary_host}") - $result = run_plan('peadm::status', $primary_host, { 'format' => 'json' }) - out::message($result) + $primary_status = run_plan('peadm::status', $primary_host, { 'format' => 'json' }) + out::message($primary_status) - if empty($result['failed']) { + if empty($primary_status['failed']) { out::message('Cluster is healthy, continuing') } else { fail_plan('Cluster is not healthy, aborting') From c8375358d39dbd4ee603ebad4b40db0900e7d7c1 Mon Sep 17 00:00:00 2001 From: David Mallon Date: Fri, 21 Feb 2025 09:17:24 +0000 Subject: [PATCH 30/30] fix logic --- .../peadm_spec/plans/test_replace_failed_postgres.pp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/spec/acceptance/peadm_spec/plans/test_replace_failed_postgres.pp b/spec/acceptance/peadm_spec/plans/test_replace_failed_postgres.pp index 934164955..73f7e537d 100644 --- a/spec/acceptance/peadm_spec/plans/test_replace_failed_postgres.pp +++ b/spec/acceptance/peadm_spec/plans/test_replace_failed_postgres.pp @@ -32,14 +32,17 @@ out::message("Primary PostgreSQL host: ${primary_postgres_host}") out::message("Replica PostgreSQL host: ${replica_postgres_host}") + out::message("working_postgresql_host: ${working_postgresql_host}") + out::message("failed_postgresql_host: ${failed_postgresql_host}") + out::message("replacement_postgresql_host: ${replacement_postgresql_host}") if $primary_postgres_host == $failed_postgresql_host or $replica_postgres_host == $failed_postgresql_host { fail_plan("Failed PostgreSQL host ${failed_postgresql_host} was not removed from the PE configuration") } else { out::message("Failed PostgreSQL host ${failed_postgresql_host} was removed from the PE configuration") } if $primary_postgres_host == $replacement_postgresql_host or $replica_postgres_host == $replacement_postgresql_host { - fail_plan("Replacement PostgreSQL host ${replacement_postgresql_host} was not added the PE configuration") - } else { out::message("Replacement PostgreSQL host ${replacement_postgresql_host} was added to the PE configuration") + } else { + fail_plan("Replacement PostgreSQL host ${replacement_postgresql_host} was not added the PE configuration") } }