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 5c22aedf1..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-latest - 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 a816d11d4..000000000 --- a/.github/workflows/ci.yml +++ /dev/null @@ -1,16 +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 - secrets: inherit diff --git a/.github/workflows/mend.yml b/.github/workflows/mend.yml deleted file mode 100644 index 9fe1bcbd0..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: Puppet Enterprise diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml deleted file mode 100644 index cd5a5d3aa..000000000 --- a/.github/workflows/nightly.yml +++ /dev/null @@ -1,16 +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 - 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 08f5283d0..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-latest - 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 3.1 - uses: ruby/setup-ruby@v1 - if: ${{ github.repository_owner == 'puppetlabs' }} - with: - ruby-version: '3.1' - 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-latest - 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 213124a52..000000000 --- a/.github/workflows/test-add-compiler-matrix.yml +++ /dev/null @@ -1,107 +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-latest - env: - BOLT_GEM: true - BOLT_DISABLE_ANALYTICS: true - LANG: en_US.UTF-8 - PUPPET_FORGE_TOKEN: ${{ secrets.PUPPET_FORGE_API_TOKEN }} - BUNDLE_RUBYGEMS___PUPPETCORE__PUPPET__COM: forge-key:${{ secrets.PUPPET_FORGE_API_TOKEN }} - strategy: - fail-fast: false - matrix: - architecture: [standard, large, extra-large] - version: [2021.7.9, 2023.8.6, 2025.6.0] - image: [almalinux-cloud/almalinux-8] - steps: - - name: Checkout Source - uses: actions/checkout@v4 - - name: Activate Ruby 3.1 - uses: ruby/setup-ruby@v1 - with: - ruby-version: '3.1' - 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 d63955e02..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.6 - 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-latest - 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 3.1 - uses: ruby/setup-ruby@v1 - with: - ruby-version: '3.1' - 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 27674e219..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-latest - 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.6, 2025.6.0] - image: [almalinux-cloud/almalinux-8] - steps: - - name: Checkout Source - uses: actions/checkout@v4 - - name: Activate Ruby 3.1 - uses: ruby/setup-ruby@v1 - with: - ruby-version: '3.1' - 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 72b42a583..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.6 - 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-latest - 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 3.1 - uses: ruby/setup-ruby@v1 - with: - ruby-version: '3.1' - 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 e0c774977..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-latest - 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 3.1 - uses: ruby/setup-ruby@v1 - with: - ruby-version: '3.1' - 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-latest - env: - BOLT_GEM: true - BOLT_DISABLE_ANALYTICS: true - LANG: en_US.UTF-8 - steps: - - name: Checkout Source - uses: actions/checkout@v4 - - name: Activate Ruby 3.1 - uses: ruby/setup-ruby@v1 - with: - ruby-version: '3.1' - 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 1f7ed479a..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.6.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.6.0' }}\ - \ ${{ github.event.inputs.architecture || 'extra-large' }} on ${{ github.event.inputs.image || 'almalinux-cloud/almalinux-8' }}" - runs-on: ubuntu-latest - 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 3.1 - uses: ruby/setup-ruby@v1 - with: - ruby-version: '3.1' - 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 546389172..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: 2021.7.9 - version_to_upgrade: - description: PE version to upgrade to - required: false - default: 2023.8.6 - 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-latest - 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 3.1 - uses: ruby/setup-ruby@v1 - with: - ruby-version: '3.1' - 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 4171b7570..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-latest - 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.6, 2025.6.0] - image: [rhel-8] - fips: [enable] - steps: - - name: Checkout Source - uses: actions/checkout@v4 - - name: Activate Ruby 3.1 - uses: ruby/setup-ruby@v1 - with: - ruby-version: '3.1' - 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 994356196..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-latest - 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 3.1 - uses: ruby/setup-ruby@v1 - with: - ruby-version: '3.1' - 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 180e67d3a..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-latest - 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 3.1 - uses: ruby/setup-ruby@v1 - with: - ruby-version: '3.1' - 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 335fbd5d6..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-latest - 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.6, 2025.6.0] - image: [almalinux-cloud/almalinux-8] - steps: - - name: Checkout Source - uses: actions/checkout@v4 - - name: Activate Ruby 3.1 - uses: ruby/setup-ruby@v1 - with: - ruby-version: '3.1' - 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 4350ee7e7..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-latest - 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.6, 2025.6.0] - image: [rhel-9] - steps: - - name: Checkout Source - uses: actions/checkout@v4 - - name: Activate Ruby 3.1 - uses: ruby/setup-ruby@v1 - with: - ruby-version: '3.1' - 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 32e8bffde..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.6 - 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-latest - 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 3.1 - uses: ruby/setup-ruby@v1 - with: - ruby-version: '3.1' - 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 bce9fd484..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-latest - 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 3.1 - uses: ruby/setup-ruby@v1 - with: - ruby-version: '3.1' - 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.6.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 8a0e0c755..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-latest - 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 3.1 - uses: ruby/setup-ruby@v1 - with: - ruby-version: '3.1' - 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.6.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-migration.yaml b/.github/workflows/test-migration.yaml deleted file mode 100644 index 48d6bc8e1..000000000 --- a/.github/workflows/test-migration.yaml +++ /dev/null @@ -1,161 +0,0 @@ ---- -name: Test Migration -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-migration: - name: PE ${{ matrix.version }} ${{ matrix.architecture }} on ${{ matrix.image }} - PE upgrade? ${{ matrix.new_pe_version }} - runs-on: ubuntu-latest - 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 - - large-with-dr - - extra-large-with-dr - version: [2021.7.9, 2023.8.6, 2025.6.0] - image: [almalinux-cloud/almalinux-8] - include: - - architecture: standard - version: 2023.8.6 - image: almalinux-cloud/almalinux-8 - new_pe_version: 2025.6.0 - - architecture: large - version: 2023.8.6 - image: almalinux-cloud/almalinux-8 - new_pe_version: 2025.6.0 - - architecture: extra-large - version: 2023.8.6 - image: almalinux-cloud/almalinux-8 - new_pe_version: 2025.6.0 - # excluding the following combinations as due to their long running nature they always fail due to - # the test nodes in GCP that litmus provisions becoming unreachable after a time. If we address PE-40902 - # to change how we provision test nodes in CI then we will hopefully be able to include these - exclude: - - architecture: extra-large-with-dr - version: 2023.8.6 - image: almalinux-cloud/almalinux-8 - - architecture: extra-large-with-dr - version: 2025.6.0 - image: almalinux-cloud/almalinux-8 - steps: - - name: Checkout Source - uses: actions/checkout@v4 - with: - ref: ${{ github.head_ref }} - - name: Activate Ruby 3.1 - uses: ruby/setup-ruby@v1 - with: - ruby-version: '3.1' - 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 }}-migration \ - --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:: - 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:: - - 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.architecture }} \ - version=${{ matrix.version }} \ - console_password=${{ secrets.CONSOLE_PASSWORD }} \ - code_manager_auto_configure=true - - name: Perform migration - 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_spec::test_migration \ - --inventoryfile spec/fixtures/litmus_inventory.yaml \ - --modulepath spec/fixtures/modules \ - primary_host=$(yq -r '.groups[].targets[] | select(.vars.role == "primary") | .name // ""' spec/fixtures/litmus_inventory.yaml) \ - new_primary_host=$(yq -r '.groups[].targets[] | select(.vars.role == "new-primary") | .name // ""' spec/fixtures/litmus_inventory.yaml) \ - new_replica_host=$(yq -r '.groups[].targets[] | select(.vars.role == "new-replica") | .name // ""' spec/fixtures/litmus_inventory.yaml) \ - new_primary_postgresql_host=$(yq -r '.groups[].targets[] | select(.vars.role == "new-primary-pdb-postgresql") | .name // ""' spec/fixtures/litmus_inventory.yaml) \ - new_replica_postgresql_host=$(yq -r '.groups[].targets[] | select(.vars.role == "new-replica-pdb-postgresql") | .name // ""' spec/fixtures/litmus_inventory.yaml) \ - upgrade_version=${{ matrix.new_pe_version }} \ - --no-host-key-check - - name: Tear down PE ${{ matrix.architecture }} 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-replace-failed-postgresql.yaml b/.github/workflows/test-replace-failed-postgresql.yaml deleted file mode 100644 index 18acf92ba..000000000 --- a/.github/workflows/test-replace-failed-postgresql.yaml +++ /dev/null @@ -1,139 +0,0 @@ ---- -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-latest - 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: [2021.7.9, 2023.8.6, 2025.6.0] - image: [almalinux-cloud/almalinux-8] - steps: - - name: Checkout Source - uses: actions/checkout@v4 - with: - ref: ${{ github.head_ref }} - - name: Activate Ruby 3.1 - uses: ruby/setup-ruby@v1 - with: - ruby-version: '3.1' - 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:: - 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:: - - 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: Uninstall on primary-pdb-postgresql to emulate it failing - run: | - primary_pdb_postgresql_host=$(yq '.groups[].targets[] | select(.vars.role == "primary-pdb-postgresql") | .name' spec/fixtures/litmus_inventory.yaml) - bundle exec bolt plan run peadm::uninstall \ - --inventoryfile spec/fixtures/litmus_inventory.yaml \ - --modulepath spec/fixtures/modules \ - -t $primary_pdb_postgresql_host \ - --no-host-key-check - - 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_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) \ - 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() }} - 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 63dc2dd4a..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.6 - 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-latest - 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 3.1 - uses: ruby/setup-ruby@v1 - with: - ruby-version: '3.1' - 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 6126dd3db..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-latest - 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.6] - image: [almalinux-cloud/almalinux-8] - steps: - - name: Checkout Source - uses: actions/checkout@v4 - - name: Activate Ruby 3.1 - uses: ruby/setup-ruby@v1 - with: - ruby-version: '3.1' - 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 index 4f4192688..6a010f3f9 100644 --- a/.github/workflows/test-upgrade-matrix.yaml +++ b/.github/workflows/test-upgrade-matrix.yaml @@ -36,16 +36,12 @@ jobs: strategy: fail-fast: false matrix: - architecture: [standard, extra-large] # removing xl-with dr until PE-40902 is addressed - version: [2021.7.9, 2023.8.6] - version_to_upgrade: [2021.7.9, 2023.8.6, 2025.6.0] + architecture: [extra-large-with-dr] # removing xl-with dr until PE-40902 is addressed + version: [2023.8.6] + version_to_upgrade: [2025.6.0] image: [almalinux-cloud/almalinux-8] download_mode: [direct] exclude: - - version: 2021.7.9 - version_to_upgrade: 2021.7.9 - - version: 2023.8.6 - version_to_upgrade: 2021.7.9 - version: 2023.8.6 version_to_upgrade: 2023.8.6 steps: @@ -117,15 +113,3 @@ jobs: 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 769565e28..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: 2021.7.9 - upgrade_version: - description: PE version to upgrade to - required: true - default: 2023.8.6 - 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-latest - 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 3.1 - uses: ruby/setup-ruby@v1 - with: - ruby-version: '3.1' - 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/plans/subplans/install.pp b/plans/subplans/install.pp index 96af47f0d..43b697ae8 100644 --- a/plans/subplans/install.pp +++ b/plans/subplans/install.pp @@ -101,6 +101,14 @@ $legacy_compiler_targets, ]) + out::message('HOSTNAME CHECK BEFORE ANYTHING') + parallelize($all_targets) |$target| { + $fqdn = run_command('hostname -f', $target) + $target.set_var('certname', $fqdn.first['stdout'].chomp) + out::message("Target: ${target}, certname: ${target.peadm::certname()}") + } + out::message('=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-') + $primary_targets = peadm::flatten_compact([ $primary_target, $replica_target, @@ -372,22 +380,60 @@ content => $autosign_conf, ) + out::message('HOSTNAME CHECK BEFORE INSTALL') + parallelize($all_targets) |$target| { + $fqdn = run_command('hostname -f', $target) + $target.set_var('certname', $fqdn.first['stdout'].chomp) + out::message("Target: ${target}, certname: ${target.peadm::certname()}") + } + out::message('=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-') + # Run the PE installer on the puppetdb database hosts run_task('peadm::pe_install', $database_targets, tarball => $upload_tarball_path, peconf => '/tmp/pe.conf', puppet_service_ensure => 'stopped', + _catch_errors => true, ) + out::message('HOSTNAME CHECK AFTER INSTALL') + parallelize($all_targets) |$target| { + $fqdn = run_command('hostname -f', $target) + $target.set_var('certname', $fqdn.first['stdout'].chomp) + out::message("Target: ${target}, certname: ${target.peadm::certname()}") + } + out::message('=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-') + # Now that the main PuppetDB database node is ready, finish priming the # master. Explicitly stop puppetdb first to avoid any systemd interference. - run_command('systemctl stop pe-puppetdb', $primary_target) - run_command('systemctl start pe-puppetdb', $primary_target) + run_command('systemctl stop pe-puppetdb', $primary_target, _catch_errors => true) + out::message('HOSTNAME CHECK AFTER STOP PUPPETDB') + parallelize($all_targets) |$target| { + $fqdn = run_command('hostname -f', $target) + $target.set_var('certname', $fqdn.first['stdout'].chomp) + out::message("Target: ${target}, certname: ${target.peadm::certname()}") + } + out::message('=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-') + run_command('systemctl start pe-puppetdb', $primary_target, _catch_errors => true) + out::message('HOSTNAME CHECK AFTER START PUPPETDB') + parallelize($all_targets) |$target| { + $fqdn = run_command('hostname -f', $target) + $target.set_var('certname', $fqdn.first['stdout'].chomp) + out::message("Target: ${target}, certname: ${target.peadm::certname()}") + } + out::message('=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-') run_task('peadm::rbac_token', $primary_target, password => $console_password, token_lifetime => $token_lifetime, + _catch_errors => true, ) - + out::message('HOSTNAME CHECK BEFORE MKDIR P FILE') + parallelize($all_targets) |$target| { + $fqdn = run_command('hostname -f', $target) + $target.set_var('certname', $fqdn.first['stdout'].chomp) + out::message("Target: ${target}, certname: ${target.peadm::certname()}") + } + out::message('=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-') # Stub a production environment and commit it to file-sync. At least one # commit (content irrelevant) is necessary to be able to configure # replication. A production environment must exist when committed to avoid @@ -400,45 +446,116 @@ group => 'pe-puppet', mode => '0644', content => "# Empty manifest\n", + _catch_errors => true, ) - + out::message('HOSTNAME CHECK BEFORE CODE MANAGER') + parallelize($all_targets) |$target| { + $fqdn = run_command('hostname -f', $target) + $target.set_var('certname', $fqdn.first['stdout'].chomp) + out::message("Target: ${target}, certname: ${target.peadm::certname()}") + } + out::message('=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-') run_task('peadm::code_manager', $primary_target, - action => 'file-sync commit', + action => 'file-sync commit', _catch_errors => true, ) - + out::message('HOSTNAME CHECK BEFORE DB RUNONCE') + parallelize($all_targets) |$target| { + $fqdn = run_command('hostname -f', $target) + $target.set_var('certname', $fqdn.first['stdout'].chomp) + out::message("Target: ${target}, certname: ${target.peadm::certname()}") + } + out::message('=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-') $bg_db_run = background('database-targets') || { - run_task('peadm::puppet_runonce', $database_targets) + run_task('peadm::puppet_runonce', $database_targets, _catch_errors => true) } - + out::message('HOSTNAME CHECK AFTER DB RUNONCE') + parallelize($all_targets) |$target| { + $fqdn = run_command('hostname -f', $target) + $target.set_var('certname', $fqdn.first['stdout'].chomp) + out::message("Target: ${target}, certname: ${target.peadm::certname()}") + } + out::message('=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-') parallelize($agent_installer_targets) |$target| { $common_install_flags = [ '--puppet-service-ensure', 'stopped', "main:dns_alt_names=${dns_alt_names_csv}", "main:certname=${target.peadm::certname()}", ] + out::message(' HOSTNAME CHECK BEFORE AGENT INSTALL') + $fqdn = run_command('hostname -f', $target) + $target.set_var('certname', $fqdn.first['stdout'].chomp) + out::message(" Target: ${target}, certname: ${target.peadm::certname()}") # Get an agent installed and cert signed run_task('peadm::agent_install', $target, server => $primary_target.peadm::certname(), install_flags => $common_install_flags, + _catch_errors => true, ) - + out::message(' HOSTNAME CHECK AFTER AGENT INSTALL') + $fqdn = run_command('hostname -f', $target) + $target.set_var('certname', $fqdn.first['stdout'].chomp) + out::message(" Target: ${target}, certname: ${target.peadm::certname()}") # Ensure certificate requests have been submitted, then run Puppet - run_task('peadm::submit_csr', $target) - run_task('peadm::sign_csr', $primary_target, { 'certnames' => [$target.peadm::certname] }) - run_task('peadm::puppet_runonce', $target) + run_task('peadm::submit_csr', $target, _catch_errors => true) + out::message(' HOSTNAME CHECK AFTER SUBMIT_CSR') + $fqdn = run_command('hostname -f', $target) + $target.set_var('certname', $fqdn.first['stdout'].chomp) + out::message(" Target: ${target}, certname: ${target.peadm::certname()}") + run_task('peadm::sign_csr', $primary_target, { 'certnames' => [$target.peadm::certname] }, _catch_errors => true) + out::message(' HOSTNAME CHECK AFTER SIGN_CSR') + $fqdn = run_command('hostname -f', $target) + $target.set_var('certname', $fqdn.first['stdout'].chomp) + out::message(" Target: ${target}, certname: ${target.peadm::certname()}") + run_task('peadm::puppet_runonce', $target, _catch_errors => true) + out::message(' HOSTNAME CHECK AFTER TARGET RUNONCE') + $fqdn = run_command('hostname -f', $target) + $target.set_var('certname', $fqdn.first['stdout'].chomp) + out::message(" Target: ${target}, certname: ${target.peadm::certname()}") } - + out::message('HOSTNAME CHECK BEFORE WAIT') + parallelize($all_targets) |$target| { + $fqdn = run_command('hostname -f', $target) + $target.set_var('certname', $fqdn.first['stdout'].chomp) + out::message("Target: ${target}, certname: ${target.peadm::certname()}") + } + out::message('=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-') wait([$bg_db_run]) - + out::message('HOSTNAME CHECK AFTER WAIT') + parallelize($all_targets) |$target| { + $fqdn = run_command('hostname -f', $target) + $target.set_var('certname', $fqdn.first['stdout'].chomp) + out::message("Target: ${target}, certname: ${target.peadm::certname()}") + } + out::message('=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-') # The puppetserver might be in the middle of a restart after the Puppet run, # so we check the status by calling the api and ensuring the puppetserver is # taking requests before proceeding. It takes two runs to fully finish # configuration. - run_task('peadm::puppet_runonce', $primary_target) + run_task('peadm::puppet_runonce', $primary_target, _catch_errors => true) + out::message('HOSTNAME CHECK AFTER PRIMARY RUNONCE') + parallelize($all_targets) |$target| { + $fqdn = run_command('hostname -f', $target) + $target.set_var('certname', $fqdn.first['stdout'].chomp) + out::message("Target: ${target}, certname: ${target.peadm::certname()}") + } + out::message('=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-') peadm::wait_until_service_ready('pe-master', $primary_target) - run_task('peadm::puppet_runonce', $primary_target) - + out::message('HOSTNAME CHECK AFTER WAIT ON PE-MASTER') + parallelize($all_targets) |$target| { + $fqdn = run_command('hostname -f', $target) + $target.set_var('certname', $fqdn.first['stdout'].chomp) + out::message("Target: ${target}, certname: ${target.peadm::certname()}") + } + out::message('=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-') + run_task('peadm::puppet_runonce', $primary_target, _catch_errors => true) + out::message('HOSTNAME CHECK AFTER SECOND PRIMARY RUNONCE') + parallelize($all_targets) |$target| { + $fqdn = run_command('hostname -f', $target) + $target.set_var('certname', $fqdn.first['stdout'].chomp) + out::message("Target: ${target}, certname: ${target.peadm::certname()}") + } + out::message('=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-') # Cleanup temp bootstrapping config parallelize(['primary', 'primary_postgresql', 'replica_postgresql']) |$var| { $target = getvar("${var}_target", []) @@ -447,8 +564,15 @@ run_task('peadm::mkdir_p_file', $target, path => '/etc/puppetlabs/enterprise/conf.d/pe.conf', content => stdlib::to_json_pretty($pe_conf.parsejson() - $puppetdb_database_temp_config), + _catch_errors => true, ) } - + out::message('HOSTNAME CHECK AFTER CLEAN UP CONF') + parallelize($all_targets) |$target| { + $fqdn = run_command('hostname -f', $target) + $target.set_var('certname', $fqdn.first['stdout'].chomp) + out::message("Target: ${target}, certname: ${target.peadm::certname()}") + } + out::message('=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-') return("Installation of Puppet Enterprise ${arch['architecture']} succeeded.") }