diff --git a/.github/workflows/README.md b/.github/workflows/README.md deleted file mode 100644 index d2269b66..00000000 --- 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 af10e834..00000000 --- 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 b80e8641..00000000 --- a/.github/workflows/auto_release.yml +++ /dev/null @@ -1,62 +0,0 @@ ---- -name: Auto release -on: - workflow_dispatch: -env: - CHANGELOG_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} -jobs: - auto_release: - name: Automatic release prep - runs-on: ubuntu-20.04 - steps: - - name: Checkout Source - if: ${{ github.repository_owner == 'puppetlabs' }} - uses: actions/checkout@v4 - with: - fetch-depth: 0 - persist-credentials: false - - name: PDK Release prep - uses: docker://puppet/puppet-dev-tools:4.x - with: - args: pdk release prep --force --debug - env: - CHANGELOG_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: Get Version - if: ${{ github.repository_owner == 'puppetlabs' }} - id: gv - run: | - echo "::set-output name=ver::$(jq --raw-output .version metadata.json)" - - name: Check if a release is necessary - if: ${{ github.repository_owner == 'puppetlabs' }} - id: check - run: | - git diff --quiet CHANGELOG.md && echo "::set-output name=release::false" || echo "::set-output name=release::true" - - name: Commit changes - if: ${{ github.repository_owner == 'puppetlabs' && steps.check.outputs.release == 'true' }} - run: | - git config --local user.email "${{ github.repository_owner }}@users.noreply.github.com" - git config --local user.name "GitHub Action" - git add . - git commit -m "Release prep v${{ steps.gv.outputs.ver }}" - - name: Create Pull Request - id: cpr - uses: puppetlabs/peter-evans-create-pull-request@v3 - if: ${{ github.repository_owner == 'puppetlabs' && steps.check.outputs.release == 'true' }} - with: - token: ${{ secrets.GITHUB_TOKEN }} - commit-message: Release prep v${{ steps.gv.outputs.ver }} - branch: release-prep - delete-branch: true - title: Release prep v${{ steps.gv.outputs.ver }} - body: | - Automated release-prep through [pdk-templates](https://github.com/puppetlabs/pdk-templates/blob/main/moduleroot/.github/workflows/auto_release.yml.erb) from commit ${{ github.sha }}. - Please verify before merging: - - [ ] last [nightly](https://github.com/${{ github.repository }}/actions/workflows/nightly.yml) run is green - - [ ] [Changelog](https://github.com/${{ github.repository }}/blob/release-prep/CHANGELOG.md) is readable and has no unlabeled pull requests - - [ ] Ensure the [changelog](https://github.com/${{ github.repository }}/blob/release-prep/CHANGELOG.md) version and [metadata](https://github.com/${{ github.repository }}/blob/release-prep/metadata.json) version match - labels: maintenance - - name: PR outputs - if: ${{ github.repository_owner == 'puppetlabs' && steps.check.outputs.release == 'true' }} - run: |- - echo "Pull Request Number - ${{ steps.cpr.outputs.pull-request-number }}" - echo "Pull Request URL - ${{ steps.cpr.outputs.pull-request-url }}" diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml deleted file mode 100644 index 5b71bfcf..00000000 --- a/.github/workflows/ci.yml +++ /dev/null @@ -1,18 +0,0 @@ ---- -name: ci -on: - pull_request: - branches: [main] - workflow_dispatch: -jobs: - Spec: - if: ${{ github.repository_owner == 'puppetlabs' }} - uses: puppetlabs/cat-github-actions/.github/workflows/module_ci.yml@main - secrets: inherit - Acceptance: - if: ${{ github.repository_owner == 'puppetlabs' }} - needs: Spec - uses: puppetlabs/cat-github-actions/.github/workflows/module_acceptance.yml@main - with: - flags: --provision-service - secrets: inherit diff --git a/.github/workflows/mend.yml b/.github/workflows/mend.yml deleted file mode 100644 index 356894f3..00000000 --- a/.github/workflows/mend.yml +++ /dev/null @@ -1,17 +0,0 @@ ---- -name: mend -on: - pull_request: - types: [closed] - branches: [main] - schedule: - - cron: 0 0 * * * - workflow_dispatch: -jobs: - mend: - if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' - || (github.event.pull_request.merged == true && github.ref == 'refs/heads/main') - uses: puppetlabs/cat-github-actions/.github/workflows/tooling_mend_ruby.yml@main - secrets: inherit - with: - product_name: InsTalleR diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml deleted file mode 100644 index d1d53a21..00000000 --- a/.github/workflows/nightly.yml +++ /dev/null @@ -1,18 +0,0 @@ ---- -name: nightly -on: - schedule: - - cron: 0 0 * * * - workflow_dispatch: -jobs: - Spec: - if: ${{ github.repository_owner == 'puppetlabs' }} - uses: puppetlabs/cat-github-actions/.github/workflows/module_ci.yml@main - secrets: inherit - Acceptance: - if: ${{ github.repository_owner == 'puppetlabs' }} - needs: Spec - uses: puppetlabs/cat-github-actions/.github/workflows/module_acceptance.yml@main - with: - flags: --provision-service - secrets: inherit diff --git a/.github/workflows/release-prep.yml b/.github/workflows/release-prep.yml deleted file mode 100644 index 0511ff7d..00000000 --- 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 f856ef68..00000000 --- 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 0880d1c6..00000000 --- a/.github/workflows/spec.yml +++ /dev/null @@ -1,90 +0,0 @@ ---- -name: Spec Tests -on: - schedule: - - cron: 0 0 * * * - workflow_dispatch: - pull_request: - paths: - - .github/workflows/**/* - - spec/**/* - - lib/**/* - - tasks/**/* - - functions/**/* - - types/**/* - - plans/**/* - - hiera/**/* - - manifests/**/* - - templates/**/* - - files/**/* - - metadata.json - - Rakefile - - Gemfile - - provision.yaml - - .rspec - - .rubocop.yml - - .puppet-lint.rc - - .fixtures.yml -jobs: - setup_matrix: - name: Setup Test Matrix - runs-on: ubuntu-20.04 - outputs: - spec_matrix: ${{ steps.get-matrix.outputs.spec_matrix }} - steps: - - name: Checkout Source - uses: actions/checkout@v4 - if: ${{ github.repository_owner == 'puppetlabs' }} - - name: Activate Ruby 2.7 - uses: ruby/setup-ruby@v1 - if: ${{ github.repository_owner == 'puppetlabs' }} - with: - ruby-version: '2.7' - bundler-cache: true - - name: Print bundle environment - if: ${{ github.repository_owner == 'puppetlabs' }} - run: | - echo ::group::bundler environment - bundle env - echo ::endgroup:: - - name: Run Static & Syntax Tests - if: ${{ github.repository_owner == 'puppetlabs' }} - run: | - bundle exec rake validate lint check rubocop - - name: Setup Spec Test Matrix - id: get-matrix - run: | - if [ '${{ github.repository_owner }}' == 'puppetlabs' ]; then - bundle exec matrix_from_metadata_v2 - else - echo "::set-output name=spec_matrix::{}" - fi - Spec: - name: 'Spec Tests (Puppet: ${{matrix.puppet_version}}, Ruby Ver: ${{matrix.ruby_version}})' - needs: [setup_matrix] - if: ${{ needs.setup_matrix.outputs.spec_matrix != '{}' }} - runs-on: ubuntu-20.04 - strategy: - fail-fast: false - matrix: ${{fromJson(needs.setup_matrix.outputs.spec_matrix)}} - env: - PUPPET_GEM_VERSION: ${{ matrix.puppet_version }} - FACTER_GEM_VERSION: https://github.com/puppetlabs/facter#main - steps: - - run: | - echo "SANITIZED_PUPPET_VERSION=$(echo '${{ matrix.puppet_version }}' | sed 's/~> //g')" >> $GITHUB_ENV - - name: Checkout Source - uses: actions/checkout@v4 - - name: Activate Ruby ${{ matrix.ruby_version }} - uses: ruby/setup-ruby@v1 - with: - ruby-version: ${{matrix.ruby_version}} - bundler-cache: true - - name: Print bundle environment - run: | - echo ::group::bundler environment - bundle env - echo ::endgroup:: - - name: Run parallel_spec tests - run: |- - bundle exec rake parallel_spec diff --git a/.github/workflows/test-add-compiler-matrix.yml b/.github/workflows/test-add-compiler-matrix.yml deleted file mode 100644 index 6da1fddc..00000000 --- a/.github/workflows/test-add-compiler-matrix.yml +++ /dev/null @@ -1,105 +0,0 @@ ---- -name: Add compiler matrix -on: - pull_request: - paths: - - .github/workflows/**/* - - spec/**/* - - lib/**/* - - tasks/**/* - - functions/**/* - - types/**/* - - plans/**/* - - hiera/**/* - - manifests/**/* - - templates/**/* - - files/**/* - - metadata.json - - Rakefile - - Gemfile - - provision.yaml - - .rspec - - .rubocop.yml - - .puppet-lint.rc - - .fixtures.yml - branches: [main] - workflow_dispatch: {} -jobs: - test-add-compiler: - name: PE ${{ matrix.version }} ${{ matrix.architecture }} on ${{ matrix.image }} - runs-on: ubuntu-20.04 - env: - BOLT_GEM: true - BOLT_DISABLE_ANALYTICS: true - LANG: en_US.UTF-8 - strategy: - fail-fast: false - matrix: - architecture: [standard, large, extra-large] - version: [2021.7.9, 2023.8.1, 2025.0.0] - image: [almalinux-cloud/almalinux-8] - steps: - - name: Checkout Source - uses: actions/checkout@v4 - - name: Activate Ruby 2.7 - uses: ruby/setup-ruby@v1 - with: - ruby-version: '2.7' - bundler-cache: true - - name: Print bundle environment - if: ${{ github.repository_owner == 'puppetlabs' }} - run: | - echo ::group::info:bundler - bundle env - echo ::endgroup:: - - name: Provision test cluster - timeout-minutes: 15 - run: | - echo ::group::prepare - mkdir -p $HOME/.ssh - echo 'Host *' > $HOME/.ssh/config - echo ' ServerAliveInterval 150' >> $HOME/.ssh/config - echo ' ServerAliveCountMax 2' >> $HOME/.ssh/config - bundle exec rake spec_prep - echo ::endgroup:: - echo ::group::provision - bundle exec bolt plan run peadm_spec::provision_test_cluster \ - --modulepath spec/fixtures/modules \ - provider=provision_service \ - image=${{ matrix.image }} \ - architecture=${{ matrix.architecture }}-with-extra-compiler - echo ::endgroup:: - echo ::group::info:request - cat request.json || true; echo - echo ::endgroup:: - echo ::group::info:inventory - sed -e 's/password: .*/password: "[redacted]"/' < spec/fixtures/litmus_inventory.yaml || true - echo ::endgroup:: - - name: Install PE on test cluster - timeout-minutes: 120 - run: | - bundle exec bolt plan run peadm_spec::install_test_cluster \ - --inventoryfile spec/fixtures/litmus_inventory.yaml \ - --modulepath spec/fixtures/modules \ - architecture=${{ matrix.architecture }} \ - console_password=${{ secrets.CONSOLE_PASSWORD }} \ - version=${{ matrix.version }} - - name: Run add_compilers plan - timeout-minutes: 50 - run: | - bundle exec bolt plan run peadm_spec::add_compilers -v \ - --inventoryfile spec/fixtures/litmus_inventory.yaml \ - --modulepath spec/fixtures/modules \ - architecture=${{ matrix.architecture }} - - name: Tear down test cluster - if: ${{ always() }} - continue-on-error: true - run: |- - if [ -f spec/fixtures/litmus_inventory.yaml ]; then - echo ::group::tear_down - bundle exec rake 'litmus:tear_down' - echo ::endgroup:: - echo ::group::info:request - cat request.json || true; echo - echo ::endgroup:: - fi diff --git a/.github/workflows/test-add-compiler.yaml b/.github/workflows/test-add-compiler.yaml deleted file mode 100644 index 46eeedc4..00000000 --- a/.github/workflows/test-add-compiler.yaml +++ /dev/null @@ -1,115 +0,0 @@ ---- -name: Add Compiler test -on: - workflow_dispatch: - inputs: - image: - description: GCP image for test cluster - required: true - default: almalinux-cloud/almalinux-8 - architecture: - description: PE architecture to test - required: true - default: large - version: - description: PE version to install - required: true - default: 2023.8.1 - ssh-debugging: - description: Boolean; whether or not to pause for ssh debugging - required: true - default: 'false' -jobs: - test-add-compiler: - name: PE ${{ matrix.version }} ${{ matrix.architecture }} on ${{ matrix.image }} - runs-on: ubuntu-20.04 - env: - BOLT_GEM: true - BOLT_DISABLE_ANALYTICS: true - LANG: en_US.UTF-8 - strategy: - fail-fast: false - matrix: - architecture: ['${{ github.event.inputs.architecture }}'] - version: ['${{ github.event.inputs.version }}'] - image: ['${{ github.event.inputs.image }}'] - steps: - - name: Start SSH session - if: ${{ github.event.inputs.ssh-debugging == 'true' }} - uses: luchihoratiu/debug-via-ssh@main - with: - NGROK_AUTH_TOKEN: ${{ secrets.NGROK_AUTH_TOKEN }} - SSH_PASS: ${{ secrets.SSH_PASS }} - - name: Checkout Source - uses: actions/checkout@v4 - - name: Activate Ruby 2.7 - uses: ruby/setup-ruby@v1 - with: - ruby-version: '2.7' - bundler-cache: true - - name: Print bundle environment - if: ${{ github.repository_owner == 'puppetlabs' }} - run: | - echo ::group::info:bundler - bundle env - echo ::endgroup:: - - name: Provision test cluster (specified architecture with added compiler) - timeout-minutes: 15 - run: | - echo ::group::prepare - mkdir -p $HOME/.ssh - echo 'Host *' > $HOME/.ssh/config - echo ' ServerAliveInterval 150' >> $HOME/.ssh/config - echo ' ServerAliveCountMax 2' >> $HOME/.ssh/config - bundle exec rake spec_prep - echo ::endgroup:: - echo ::group::provision - bundle exec bolt plan run peadm_spec::provision_test_cluster \ - --modulepath spec/fixtures/modules \ - provider=provision_service \ - image=${{ matrix.image }} \ - architecture=${{ matrix.architecture }}-with-extra-compiler - echo ::endgroup:: - echo ::group::info:request - cat request.json || true; echo - echo ::endgroup:: - echo ::group::info:inventory - sed -e 's/password: .*/password: "[redacted]"/' < spec/fixtures/litmus_inventory.yaml || true - echo ::endgroup:: - - name: Install PE on test cluster - timeout-minutes: 120 - run: | - bundle exec bolt plan run peadm_spec::install_test_cluster \ - --inventoryfile spec/fixtures/litmus_inventory.yaml \ - --modulepath spec/fixtures/modules \ - architecture=${{ matrix.architecture }} \ - version=${{ matrix.version }} \ - console_password=${{ secrets.CONSOLE_PASSWORD }} - - name: Run add_compilers plan - timeout-minutes: 50 - run: | - bundle exec bolt plan run peadm_spec::add_compilers -v \ - --inventoryfile spec/fixtures/litmus_inventory.yaml \ - --modulepath spec/fixtures/modules \ - architecture=${{ matrix.architecture }} \ - --stream - - name: Wait as long as the file ${HOME}/pause file is present - if: ${{ always() && github.event.inputs.ssh-debugging == 'true' }} - run: | - while [ -f "${HOME}/pause" ] ; do - echo "${HOME}/pause present, sleeping for 60 seconds..." - sleep 60 - done - echo "${HOME}/pause absent, continuing workflow." - - name: Tear down test cluster - if: ${{ always() }} - continue-on-error: true - run: |- - if [ -f spec/fixtures/litmus_inventory.yaml ]; then - echo ::group::tear_down - bundle exec rake 'litmus:tear_down' - echo ::endgroup:: - echo ::group::info:request - cat request.json || true; echo - echo ::endgroup:: - fi diff --git a/.github/workflows/test-add-replica-matrix.yaml b/.github/workflows/test-add-replica-matrix.yaml deleted file mode 100644 index a4cb89f6..00000000 --- a/.github/workflows/test-add-replica-matrix.yaml +++ /dev/null @@ -1,112 +0,0 @@ ---- -name: Add replica matrix -on: - pull_request: - paths: - - .github/workflows/**/* - - spec/**/* - - lib/**/* - - tasks/**/* - - functions/**/* - - types/**/* - - plans/**/* - - hiera/**/* - - manifests/**/* - - templates/**/* - - files/**/* - - metadata.json - - Rakefile - - Gemfile - - provision.yaml - - .rspec - - .rubocop.yml - - .puppet-lint.rc - - .fixtures.yml - branches: [main] - workflow_dispatch: {} -jobs: - test-add-replica: - name: PE ${{ matrix.version }} ${{ matrix.architecture }} on ${{ matrix.image }} - runs-on: ubuntu-20.04 - env: - BOLT_GEM: true - BOLT_DISABLE_ANALYTICS: true - LANG: en_US.UTF-8 - strategy: - fail-fast: false - matrix: - architecture: [standard, standard-with-dr, large, extra-large] - version: [2023.8.1, 2025.0.0] - image: [almalinux-cloud/almalinux-8] - steps: - - name: Checkout Source - uses: actions/checkout@v4 - - name: Activate Ruby 2.7 - uses: ruby/setup-ruby@v1 - with: - ruby-version: '2.7' - bundler-cache: true - - name: Print bundle environment - if: ${{ github.repository_owner == 'puppetlabs' }} - run: | - echo ::group::info:bundler - bundle env - echo ::endgroup:: - - name: Provision test cluster (specified architecture and a spare replica) - timeout-minutes: 15 - run: | - echo ::group::prepare - mkdir -p $HOME/.ssh - echo 'Host *' > $HOME/.ssh/config - echo ' ServerAliveInterval 150' >> $HOME/.ssh/config - echo ' ServerAliveCountMax 2' >> $HOME/.ssh/config - bundle exec rake spec_prep - echo ::endgroup:: - echo ::group::provision - bundle exec bolt plan run peadm_spec::provision_test_cluster \ - --modulepath spec/fixtures/modules \ - provider=provision_service \ - image=${{ matrix.image }} \ - architecture=${{ matrix.architecture }}-and-spare-replica - echo ::endgroup:: - echo ::group::info:request - cat request.json || true; echo - echo ::endgroup:: - echo ::group::info:inventory - sed -e 's/password: .*/password: "[redacted]"/' < spec/fixtures/litmus_inventory.yaml || true - echo ::endgroup:: - - name: Install PE on test cluster - timeout-minutes: 120 - run: | - bundle exec bolt plan run peadm_spec::install_test_cluster \ - --inventoryfile spec/fixtures/litmus_inventory.yaml \ - --modulepath spec/fixtures/modules \ - architecture=${{ matrix.architecture }} \ - version=${{ matrix.version }} \ - console_password=${{ secrets.CONSOLE_PASSWORD }} \ - code_manager_auto_configure=true - - name: Run add_replica plan - timeout-minutes: 60 - run: | - bundle exec bolt plan run peadm_spec::add_replica -v \ - --inventoryfile spec/fixtures/litmus_inventory.yaml \ - --modulepath spec/fixtures/modules \ - --stream - - name: Verify that replica was added - timeout-minutes: 10 - run: | - bundle exec bolt plan run peadm_spec::verify_replica -v \ - --inventoryfile spec/fixtures/litmus_inventory.yaml \ - --modulepath spec/fixtures/modules - - name: Tear down test cluster - if: ${{ always() }} - continue-on-error: true - run: |- - if [ -f spec/fixtures/litmus_inventory.yaml ]; then - echo ::group::tear_down - bundle exec rake 'litmus:tear_down' - echo ::endgroup:: - echo ::group::info:request - cat request.json || true; echo - echo ::endgroup:: - fi diff --git a/.github/workflows/test-add-replica.yaml b/.github/workflows/test-add-replica.yaml deleted file mode 100644 index 4ce32630..00000000 --- a/.github/workflows/test-add-replica.yaml +++ /dev/null @@ -1,121 +0,0 @@ ---- -name: Add Replica test -on: - workflow_dispatch: - inputs: - image: - description: GCP image for test cluster - required: true - default: almalinux-cloud/almalinux-8 - architecture: - description: PE architecture to test - required: true - default: standard - version: - description: PE version to install - required: true - default: 2023.8.1 - ssh-debugging: - description: Boolean; whether or not to pause for ssh debugging - required: true - default: 'false' -jobs: - test-add-replica: - name: PE ${{ matrix.version }} ${{ matrix.architecture }} on ${{ matrix.image }} - runs-on: ubuntu-20.04 - env: - BOLT_GEM: true - BOLT_DISABLE_ANALYTICS: true - LANG: en_US.UTF-8 - strategy: - fail-fast: false - matrix: - architecture: ['${{ github.event.inputs.architecture }}'] - version: ['${{ github.event.inputs.version }}'] - image: ['${{ github.event.inputs.image }}'] - steps: - - name: Start SSH session - if: ${{ github.event.inputs.ssh-debugging == 'true' }} - uses: luchihoratiu/debug-via-ssh@main - with: - NGROK_AUTH_TOKEN: ${{ secrets.NGROK_AUTH_TOKEN }} - SSH_PASS: ${{ secrets.SSH_PASS }} - - name: Checkout Source - uses: actions/checkout@v4 - - name: Activate Ruby 2.7 - uses: ruby/setup-ruby@v1 - with: - ruby-version: '2.7' - bundler-cache: true - - name: Print bundle environment - if: ${{ github.repository_owner == 'puppetlabs' }} - run: | - echo ::group::info:bundler - bundle env - echo ::endgroup:: - - name: Provision test cluster (specified architecture with spare replica) - timeout-minutes: 15 - run: | - echo ::group::prepare - mkdir -p $HOME/.ssh - echo 'Host *' > $HOME/.ssh/config - echo ' ServerAliveInterval 150' >> $HOME/.ssh/config - echo ' ServerAliveCountMax 2' >> $HOME/.ssh/config - bundle exec rake spec_prep - echo ::endgroup:: - echo ::group::provision - bundle exec bolt plan run peadm_spec::provision_test_cluster \ - --modulepath spec/fixtures/modules \ - provider=provision_service \ - image=${{ matrix.image }} \ - architecture=${{ matrix.architecture }}-and-spare-replica - echo ::endgroup:: - echo ::group::info:request - cat request.json || true; echo - echo ::endgroup:: - echo ::group::info:inventory - sed -e 's/password: .*/password: "[redacted]"/' < spec/fixtures/litmus_inventory.yaml || true - echo ::endgroup:: - - name: Install PE on test cluster - timeout-minutes: 120 - run: | - bundle exec bolt plan run peadm_spec::install_test_cluster \ - --inventoryfile spec/fixtures/litmus_inventory.yaml \ - --modulepath spec/fixtures/modules \ - architecture=${{ matrix.architecture }} \ - version=${{ matrix.version }} \ - console_password=${{ secrets.CONSOLE_PASSWORD }} \ - code_manager_auto_configure=true - - name: Run add_replica plan - timeout-minutes: 60 - run: | - bundle exec bolt plan run peadm_spec::add_replica -v \ - --inventoryfile spec/fixtures/litmus_inventory.yaml \ - --modulepath spec/fixtures/modules \ - --stream - - name: Verify that replica was added - timeout-minutes: 10 - run: | - bundle exec bolt plan run peadm_spec::verify_replica -v \ - --inventoryfile spec/fixtures/litmus_inventory.yaml \ - --modulepath spec/fixtures/modules - - name: Wait as long as the file ${HOME}/pause file is present - if: ${{ always() && github.event.inputs.ssh-debugging == 'true' }} - run: | - while [ -f "${HOME}/pause" ] ; do - echo "${HOME}/pause present, sleeping for 60 seconds..." - sleep 60 - done - echo "${HOME}/pause absent, continuing workflow." - - name: Tear down test cluster - if: ${{ always() }} - continue-on-error: true - run: |- - if [ -f spec/fixtures/litmus_inventory.yaml ]; then - echo ::group::tear_down - bundle exec rake 'litmus:tear_down' - echo ::endgroup:: - echo ::group::info:request - cat request.json || true; echo - echo ::endgroup:: - fi diff --git a/.github/workflows/test-backup-restore-migration.yaml b/.github/workflows/test-backup-restore-migration.yaml index c8f6e393..9f1072f6 100644 --- a/.github/workflows/test-backup-restore-migration.yaml +++ b/.github/workflows/test-backup-restore-migration.yaml @@ -1,6 +1,28 @@ --- name: Backup and restore test 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: image: @@ -21,8 +43,8 @@ on: default: 'false' jobs: backup: - name: 'Backup: Cluster A: PE ${{ inputs.version }} ${{ inputs.architecture }} - on ${{ inputs.image }}' + name: 'Backup: Cluster A: PE 2021.7.4 extra-large-with-dr + on almalinux-cloud/almalinux-8' runs-on: ubuntu-20.04 env: BOLT_GEM: true @@ -62,8 +84,8 @@ jobs: bundle exec bolt plan run peadm_spec::provision_test_cluster \ --modulepath spec/fixtures/modules \ provider=provision_service \ - image=${{ inputs.image }} \ - architecture=${{ inputs.architecture }} + image=almalinux-cloud/almalinux-8 \ + architecture=extra-large-with-dr-migration echo ::endgroup:: echo ::group::info:request cat request.json || true; echo @@ -71,20 +93,22 @@ jobs: 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: Output value of A spec/fixtures/litmus_inventory.yaml + run: | + cat spec/fixtures/litmus_inventory.yaml + - name: Save inventory file A to an artifact + uses: actions/upload-artifact@v4 + 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 }} \ + architecture=extra-large-with-dr \ + version=2021.7.4 \ console_password=${{ secrets.CONSOLE_PASSWORD }} - name: Start SSH session if: github.event.inputs.ssh-debugging == 'true' @@ -114,6 +138,11 @@ jobs: --inventoryfile spec/fixtures/litmus_inventory.yaml \ --modulepath spec/fixtures/modules echo ::endgroup:: + - name: output useful info on config by running peadm::verify_config + run: | + bundle exec bolt plan run peadm_spec::verify_config \ + --inventoryfile spec/fixtures/litmus_inventory.yaml + primary_host=$(yq '.groups[].targets[] | select(.vars.role == "primary") | .uri' spec/fixtures/litmus_inventory.yaml) - name: Wait as long as the file ${HOME}/pause file is present continue-on-error: true # if: ${{ always() && github.event.inputs.ssh-debugging == 'true' }} @@ -136,8 +165,9 @@ jobs: echo ::endgroup:: fi restore: - name: 'Restore: Cluster B: PE ${{ inputs.version }} ${{ inputs.architecture }} - on ${{ inputs.image }}' + needs: backup + name: 'Restore: Cluster B: PE 2021.7.4 standard + on almalinux-cloud/almalinux-8' runs-on: ubuntu-20.04 env: BOLT_GEM: true @@ -171,8 +201,8 @@ jobs: bundle exec bolt plan run peadm_spec::provision_test_cluster \ --modulepath spec/fixtures/modules \ provider=provision_service \ - image=${{ inputs.image }} \ - architecture=${{ inputs.architecture }} + image=almalinux-cloud/almalinux-8 \ + architecture=standard echo ::endgroup:: echo ::group::info:request cat request.json || true; echo @@ -180,9 +210,11 @@ jobs: echo ::group::info:inventory sed -e 's/password: .*/password: "[redacted]"/' < spec/fixtures/litmus_inventory.yaml || true echo ::endgroup:: - + - name: Output value B of spec/fixtures/litmus_inventory.yaml + run: | + cat spec/fixtures/litmus_inventory.yaml # - name: Save inventory file B to an artifact - # uses: actions/upload-artifact@v3 + # uses: actions/upload-artifact@v4 # with: # name: inventory_B # path: spec/fixtures/litmus_inventory.yaml @@ -192,17 +224,17 @@ jobs: 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 }} \ + architecture=standard \ + version=2021.7.4 \ 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: Wait for restore to finish + # uses: lewagon/wait-on-check-action@v1.3.4 + # with: + # ref: ${{ github.ref }} + # check-name: 'Backup: Cluster A: PE 2021.7.4 extra-large-with-dr + # on almalinux-cloud/almalinux-8' + # repo-token: ${{ secrets.GITHUB_TOKEN }} + # wait-interval: 10 - name: Tear down cluster B if: always() run: |- diff --git a/.github/workflows/test-backup-restore.yaml b/.github/workflows/test-backup-restore.yaml deleted file mode 100644 index 2f951632..00000000 --- a/.github/workflows/test-backup-restore.yaml +++ /dev/null @@ -1,231 +0,0 @@ ---- -name: Backup and restore test -on: - pull_request: - types: [ready_for_review] - workflow_dispatch: - inputs: - image: - description: GCP image for test cluster - required: true - default: almalinux-cloud/almalinux-8 - architecture: - description: PE architecture to test - required: true - default: standard - type: choice - options: - - standard - - standard-with-dr - - large - - large-with-dr - - extra-large - - extra-large-with-dr - version: - description: PE version to install - required: true - default: 2025.0.0 - ssh-debugging: - description: Boolean; whether or not to pause for ssh debugging - required: true - default: 'false' -jobs: - backup-restore-test: - name: "Backup, break and restore cluster: PE ${{ github.event.inputs.version || '2025.0.0' }}\ - \ ${{ github.event.inputs.architecture || 'extra-large' }} on ${{ github.event.inputs.image || 'almalinux-cloud/almalinux-8' }}" - runs-on: ubuntu-20.04 - env: - BOLT_GEM: true - BOLT_DISABLE_ANALYTICS: true - LANG: en_US.UTF-8 - steps: - - name: Start SSH session - if: ${{ github.event.inputs.ssh-debugging == 'true' }} - uses: luchihoratiu/debug-via-ssh@main - with: - NGROK_AUTH_TOKEN: ${{ secrets.NGROK_AUTH_TOKEN }} - SSH_PASS: ${{ secrets.SSH_PASS }} - - name: Checkout Source - uses: actions/checkout@v4 - - name: Activate Ruby 2.7 - uses: ruby/setup-ruby@v1 - with: - ruby-version: '2.7' - bundler-cache: true - - name: Print bundle environment - if: ${{ github.repository_owner == 'puppetlabs' }} - run: | - echo ::group::info:bundler - bundle env - echo ::endgroup:: - - name: Provision test cluster - timeout-minutes: 15 - run: | - echo ::group::prepare - mkdir -p $HOME/.ssh - echo 'Host *' > $HOME/.ssh/config - echo ' ServerAliveInterval 150' >> $HOME/.ssh/config - echo ' ServerAliveCountMax 2' >> $HOME/.ssh/config - bundle exec rake spec_prep - echo ::endgroup:: - echo ::group::provision - bundle exec bolt plan run peadm_spec::provision_test_cluster \ - --modulepath spec/fixtures/modules \ - provider=provision_service \ - image=${{ github.event.inputs.image || 'almalinux-cloud/almalinux-8' }} \ - architecture=${{ github.event.inputs.architecture || 'extra-large' }} - echo ::endgroup:: - echo ::group::info:request - cat request.json || true; echo - echo ::endgroup:: - echo ::group::info:inventory - sed -e 's/password: .*/password: "[redacted]"/' < spec/fixtures/litmus_inventory.yaml || true - echo ::endgroup:: - - name: Install PE on test cluster - timeout-minutes: 120 - run: | - bundle exec bolt plan run peadm_spec::install_test_cluster \ - --inventoryfile spec/fixtures/litmus_inventory.yaml \ - --modulepath spec/fixtures/modules \ - architecture=${{ github.event.inputs.architecture || 'extra-large' }} \ - version=${{ github.event.inputs.version || '2023.5.0' }} \ - console_password=${{ secrets.CONSOLE_PASSWORD }} \ - --stream - - name: Perform peadm backup of cluster - timeout-minutes: 10 - continue-on-error: true - run: | - echo ::group::prepare - mkdir -p $HOME/.ssh - echo 'Host *' > $HOME/.ssh/config - echo ' ServerAliveInterval 150' >> $HOME/.ssh/config - echo ' ServerAliveCountMax 2' >> $HOME/.ssh/config - bundle exec rake spec_prep - echo ::endgroup:: - echo ::group::backup - bundle exec bolt plan run peadm_spec::test_backup \ - --inventoryfile spec/fixtures/litmus_inventory.yaml \ - --modulepath spec/fixtures/modules \ - --stream - echo ::endgroup:: - - name: Set up yq - uses: frenck/action-setup-yq@v1 - with: - version: v4.30.5 - - name: Break the primary host - run: | - primary=$(yq '.groups[].targets[] | select(.vars.role == "primary") | .uri' spec/fixtures/litmus_inventory.yaml) - echo "Removing ssl directories" - bundle exec bolt command run "rm -rf /etc/puppetlabs/puppetserver/ca /etc/puppetlabs/puppet/ssl" -t $primary --inventoryfile spec/fixtures/litmus_inventory.yaml - echo "Removing classifier database" - bundle exec bolt command run "rm -rf /opt/puppetlabs/server/data/postgresql/classifier" -t $primary --inventoryfile spec/fixtures/litmus_inventory.yaml - # TODO if arch is XL, run pe-uninstaller on the primary database - - name: Output PE cluster status - run: | - primary=$(yq '.groups[].targets[] | select(.vars.role == "primary") | .uri' spec/fixtures/litmus_inventory.yaml) - bundle exec bolt command run "puppet infrastructure status" -t $primary --inventoryfile spec/fixtures/litmus_inventory.yaml - - name: Reinstall PE on the primary host - continue-on-error: true - run: | - primary=$(yq '.groups[].targets[] | select(.vars.role == "primary") | .uri' spec/fixtures/litmus_inventory.yaml) - bundle exec bolt task run peadm::reinstall_pe uninstall=true version=${{ github.event.inputs.version || '2023.5.0' }} -t $primary \ - --inventoryfile spec/fixtures/litmus_inventory.yaml \ - --modulepath spec/fixtures/modules \ - --verbose \ - --stream - - name: Perform peadm recovery restore of primary server - timeout-minutes: 30 - continue-on-error: true - run: | - echo ::group::prepare - mkdir -p $HOME/.ssh - echo 'Host *' > $HOME/.ssh/config - echo ' ServerAliveInterval 150' >> $HOME/.ssh/config - echo ' ServerAliveCountMax 2' >> $HOME/.ssh/config - bundle exec rake spec_prep - echo ::endgroup:: - primary=$(yq '.groups[].targets[] | select(.vars.role == "primary") | .uri' spec/fixtures/litmus_inventory.yaml) - - # TODO update the restore to: - # - restore the puppetdb in the standard cases - # - not restore the puppetdb if there is a broken external db - echo ::group::restore - bundle exec bolt plan run peadm_spec::test_restore \ - --inventoryfile spec/fixtures/litmus_inventory.yaml \ - --modulepath spec/fixtures/modules \ - --stream \ - || true # ignore errors - echo ::endgroup:: - - name: Output PE cluster status - run: | - primary=$(yq '.groups[].targets[] | select(.vars.role == "primary") | .uri' spec/fixtures/litmus_inventory.yaml) - bundle exec bolt command run "puppet infrastructure status" -t $primary --inventoryfile spec/fixtures/litmus_inventory.yaml - - name: Smoke test - run: | - bundle exec bolt plan run peadm_spec::puppet_run_test \ - --inventoryfile spec/fixtures/litmus_inventory.yaml \ - --modulepath spec/fixtures/modules \ - --stream - - name: Break external DB - if: ${{ github.event.inputs.architecture || 'extra-large' }} == 'extra-large' - run: | - echo "Uninstalling PE from primary database" - primary_db=$(yq '.groups[].targets[] | select(.vars.role == "primary-pdb-postgresql") | .uri' spec/fixtures/litmus_inventory.yaml) - bundle exec bolt command run "/opt/puppetlabs/bin/puppet-enterprise-uninstaller -p -d -y || true" -t $primary_db \ - --inventoryfile spec/fixtures/litmus_inventory.yaml \ - --modulepath spec/fixtures/modules \ - --verbose \ - --stream - - name: Output PE cluster status - if: ${{ github.event.inputs.architecture || 'extra-large' }} == 'extra-large' - run: | - primary=$(yq '.groups[].targets[] | select(.vars.role == "primary") | .uri' spec/fixtures/litmus_inventory.yaml) - bundle exec bolt command run "puppet infrastructure status" -t $primary --inventoryfile spec/fixtures/litmus_inventory.yaml - - name: Setup Primary DB in XL - if: ${{ github.event.inputs.architecture || 'extra-large' }} == 'extra-large' - run: | - primary_db=$(yq '.groups[].targets[] | select(.vars.role == "primary-pdb-postgresql") | .uri' spec/fixtures/litmus_inventory.yaml) - bundle exec bolt plan run peadm::util::init_db_server db_host=$primary_db \ - install_pe=true \ - --inventoryfile spec/fixtures/litmus_inventory.yaml \ - --modulepath spec/fixtures/modules \ - --stream \ - || true # ignore errors - - # restore the puppetdb database - bundle exec bolt plan run peadm_spec::test_restore restore_type="recovery-db" \ - --inventoryfile spec/fixtures/litmus_inventory.yaml \ - --modulepath spec/fixtures/modules \ - --stream - - name: Output PE cluster status - if: ${{ github.event.inputs.architecture || 'extra-large' }} == 'extra-large' - run: | - primary=$(yq '.groups[].targets[] | select(.vars.role == "primary") | .uri' spec/fixtures/litmus_inventory.yaml) - bundle exec bolt command run "puppet infrastructure status" -t $primary --inventoryfile spec/fixtures/litmus_inventory.yaml - - name: Smoke test - if: ${{ github.event.inputs.architecture || 'extra-large' }} == 'extra-large' - run: | - bundle exec bolt plan run peadm_spec::puppet_run_test \ - --inventoryfile spec/fixtures/litmus_inventory.yaml \ - --modulepath spec/fixtures/modules \ - --stream - - name: Wait as long as the file ${HOME}/pause file is present - continue-on-error: true - if: ${{ always() && github.event.inputs.ssh-debugging == 'true' }} - run: | - while [ -f "${HOME}/pause" ] ; do - echo "${HOME}/pause present, sleeping for 60 seconds..." - sleep 10 - done - echo "${HOME}/pause absent, continuing workflow." - - name: Tear down cluster - if: always() - run: |- - if [ -f spec/fixtures/litmus_inventory.yaml ]; then - echo ::group::tear_down - bundle exec rake 'litmus:tear_down' - echo ::endgroup:: - echo ::group::info:request - cat request.json || true; echo - echo ::endgroup:: - fi diff --git a/.github/workflows/test-failover.yaml b/.github/workflows/test-failover.yaml deleted file mode 100644 index 139b47ae..00000000 --- a/.github/workflows/test-failover.yaml +++ /dev/null @@ -1,140 +0,0 @@ ---- -name: Failover test -on: - workflow_dispatch: - inputs: - image: - description: GCP image for test cluster - required: true - default: almalinux-cloud/almalinux-8 - version: - description: PE version to install - required: true - default: 2019.8.12 - version_to_upgrade: - description: PE version to upgrade to - required: false - default: 2023.8.1 - ssh-debugging: - description: Boolean; whether or not to pause for ssh debugging - required: true - default: 'false' - log_level: - description: Bolt log level - required: false - default: debug -jobs: - test-failover: - name: PE ${{ matrix.version }} ${{ matrix.architecture }} on ${{ matrix.image }} - runs-on: ubuntu-20.04 - env: - BOLT_GEM: true - BOLT_DISABLE_ANALYTICS: true - LANG: en_US.UTF-8 - strategy: - fail-fast: false - matrix: - version: ['${{ github.event.inputs.version }}'] - image: ['${{ github.event.inputs.image }}'] - architecture: [extra-large-with-dr] - steps: - - name: Start SSH session - if: ${{ github.event.inputs.ssh-debugging == 'true' }} - uses: luchihoratiu/debug-via-ssh@main - with: - NGROK_AUTH_TOKEN: ${{ secrets.NGROK_AUTH_TOKEN }} - SSH_PASS: ${{ secrets.SSH_PASS }} - - name: Checkout Source - uses: actions/checkout@v4 - - name: Activate Ruby 2.7 - uses: ruby/setup-ruby@v1 - with: - ruby-version: '2.7' - bundler-cache: true - - name: Print bundle environment - if: ${{ github.repository_owner == 'puppetlabs' }} - run: | - echo ::group::info:bundler - bundle env - echo ::endgroup:: - - name: Provision test cluster (XL with spare replica) - timeout-minutes: 15 - run: | - echo ::group::prepare - mkdir -p $HOME/.ssh - echo 'Host *' > $HOME/.ssh/config - echo ' ServerAliveInterval 150' >> $HOME/.ssh/config - echo ' ServerAliveCountMax 2' >> $HOME/.ssh/config - bundle exec rake spec_prep - echo ::endgroup:: - echo ::group::provision - bundle exec bolt plan run peadm_spec::provision_test_cluster \ - --modulepath spec/fixtures/modules \ - provider=provision_service \ - image=${{ matrix.image }} \ - architecture=${{ matrix.architecture }}-and-spare-replica - echo ::endgroup:: - echo ::group::info:request - cat request.json || true; echo - echo ::endgroup:: - echo ::group::info:inventory - sed -e 's/password: .*/password: "[redacted]"/' < spec/fixtures/litmus_inventory.yaml || true - echo ::endgroup:: - - name: Install PE on test cluster - timeout-minutes: 120 - run: | - bundle exec bolt plan run peadm_spec::install_test_cluster --log_level ${{ github.event.inputs.log_level }} \ - --inventoryfile spec/fixtures/litmus_inventory.yaml \ - --modulepath spec/fixtures/modules \ - architecture=${{ matrix.architecture }} \ - version=${{ matrix.version }} \ - console_password=${{ secrets.CONSOLE_PASSWORD }} - - name: Perform failover - run: | - bundle exec bolt plan run peadm_spec::perform_failover --log_level ${{ github.event.inputs.log_level }} \ - --inventoryfile spec/fixtures/litmus_inventory.yaml \ - --modulepath spec/fixtures/modules - - name: Wait as long as the file ${HOME}/pause file is present - if: ${{ always() && github.event.inputs.ssh-debugging == 'true' }} - run: | - while [ -f "${HOME}/pause" ] ; do - echo "${HOME}/pause present, sleeping for 60 seconds..." - sleep 60 - done - echo "${HOME}/pause absent, continuing workflow." - - name: Set up yq - uses: frenck/action-setup-yq@v1 - with: - version: v4.30.5 - - name: Update inventory - run: | - # Remove failed primary - yq -i 'del(.groups[].targets[] | select(.vars.role == "primary"))' spec/fixtures/litmus_inventory.yaml - # Swap primary and replica nodes - sed -i.sedbak 's/primary/__tmp__/;s/spare-replica/__tmp2__/;s/replica/primary/;s/__tmp__/replica/;s/__tmp2__/replica/' \ - spec/fixtures/litmus_inventory.yaml - echo ::group::info:inventory - sed -e 's/password: .*/password: "[redacted]"/' < spec/fixtures/litmus_inventory.yaml || true - echo ::endgroup:: - - name: Upgrade PE on test cluster - if: ${{ success() && github.event.inputs.version_to_upgrade != '' }} - timeout-minutes: 120 - run: | - bundle exec bolt plan run peadm_spec::upgrade_test_cluster --log_level ${{ github.event.inputs.log_level }} \ - --inventoryfile spec/fixtures/litmus_inventory.yaml \ - --modulepath spec/fixtures/modules \ - architecture=${{ matrix.architecture }} \ - download_mode='direct' \ - version=${{ github.event.inputs.version_to_upgrade }} - - name: Tear down test cluster - if: ${{ always() }} - continue-on-error: true - run: |- - if [ -f spec/fixtures/litmus_inventory.yaml ]; then - echo ::group::tear_down - bundle exec rake 'litmus:tear_down' - echo ::endgroup:: - echo ::group::info:request - cat request.json || true; echo - echo ::endgroup:: - fi diff --git a/.github/workflows/test-fips-install-matrix.yaml b/.github/workflows/test-fips-install-matrix.yaml deleted file mode 100644 index 494459ce..00000000 --- a/.github/workflows/test-fips-install-matrix.yaml +++ /dev/null @@ -1,101 +0,0 @@ ---- -name: Install fips test matrix -on: - pull_request: - paths: - - .github/workflows/**/* - - spec/**/* - - lib/**/* - - tasks/**/* - - functions/**/* - - types/**/* - - plans/**/* - - hiera/**/* - - manifests/**/* - - templates/**/* - - files/**/* - - metadata.json - - Rakefile - - Gemfile - - provision.yaml - - .rspec - - .rubocop.yml - - .puppet-lint.rc - - .fixtures.yml - branches: [main] - workflow_dispatch: {} -jobs: - test-install: - name: PE ${{ matrix.version }} ${{ matrix.architecture }} on ${{ matrix.image }} - with fips ${{ matrix.fips }} - runs-on: ubuntu-20.04 - env: - BOLT_GEM: true - BOLT_DISABLE_ANALYTICS: true - LANG: en_US.UTF-8 - strategy: - fail-fast: false - matrix: - architecture: [standard-with-dr, large, extra-large-with-dr] - version: [2019.8.12, 2021.7.9, 2023.8.1, 2025.0.0] - image: [rhel-8] - fips: [enable] - steps: - - name: Checkout Source - uses: actions/checkout@v4 - - name: Activate Ruby 2.7 - uses: ruby/setup-ruby@v1 - with: - ruby-version: '2.7' - bundler-cache: true - - name: Print bundle environment - if: ${{ github.repository_owner == 'puppetlabs' }} - run: | - echo ::group::info:bundler - bundle env - echo ::endgroup:: - - name: Provision test cluster - timeout-minutes: 15 - run: | - echo ::group::prepare - mkdir -p $HOME/.ssh - echo 'Host *' > $HOME/.ssh/config - echo ' ServerAliveInterval 150' >> $HOME/.ssh/config - echo ' ServerAliveCountMax 2' >> $HOME/.ssh/config - bundle exec rake spec_prep - echo ::endgroup:: - echo ::group::provision - bundle exec bolt plan run peadm_spec::provision_test_cluster \ - --modulepath spec/fixtures/modules \ - provider=provision_service \ - image=${{ matrix.image }} \ - architecture=${{ matrix.architecture }} - echo ::endgroup:: - echo ::group::info:request - cat request.json || true; echo - echo ::endgroup:: - echo ::group::info:inventory - sed -e 's/password: .*/password: "[redacted]"/' < spec/fixtures/litmus_inventory.yaml || true - echo ::endgroup:: - - name: Install PE on test cluster - timeout-minutes: 120 - run: | - bundle exec bolt plan run peadm_spec::install_test_cluster \ - --inventoryfile spec/fixtures/litmus_inventory.yaml \ - --modulepath spec/fixtures/modules \ - architecture=${{ matrix.architecture }} \ - version=${{ matrix.version }} \ - fips=${{ matrix.fips }} \ - console_password=${{ secrets.CONSOLE_PASSWORD }} - - name: Tear down test cluster - if: ${{ always() }} - continue-on-error: true - run: |- - if [ -f spec/fixtures/litmus_inventory.yaml ]; then - echo ::group::tear_down - bundle exec rake 'litmus:tear_down' - echo ::endgroup:: - echo ::group::info:request - cat request.json || true; echo - echo ::endgroup:: - fi diff --git a/.github/workflows/test-install-latest-dev.yaml b/.github/workflows/test-install-latest-dev.yaml deleted file mode 100644 index 9f1d08f2..00000000 --- a/.github/workflows/test-install-latest-dev.yaml +++ /dev/null @@ -1,120 +0,0 @@ ---- -name: Install latest dev test -on: - workflow_dispatch: - inputs: - image: - description: GCP image for test cluster - required: true - default: almalinux-cloud/almalinux-8 - architecture: - type: choice - required: true - default: standard - description: PE architecture to test - options: - - standard - - standard-with-dr - - large - - large-with-dr - - extra-large - - extra-large-with-dr - ssh-debugging: - description: Boolean; whether or not to pause for ssh debugging - required: true - default: 'false' -jobs: - test-install: - name: PE ${{ matrix.version }} ${{ matrix.architecture }} on ${{ matrix.image }} - runs-on: ubuntu-20.04 - env: - BOLT_GEM: true - BOLT_DISABLE_ANALYTICS: true - LANG: en_US.UTF-8 - strategy: - fail-fast: false - matrix: - architecture: ['${{ github.event.inputs.architecture }}'] - image: ['${{ github.event.inputs.image }}'] - steps: - - name: Start SSH session - if: ${{ github.event.inputs.ssh-debugging == 'true' }} - uses: luchihoratiu/debug-via-ssh@main - with: - NGROK_AUTH_TOKEN: ${{ secrets.NGROK_AUTH_TOKEN }} - SSH_PASS: ${{ secrets.SSH_PASS }} - - name: Checkout Source - uses: actions/checkout@v4 - - name: Activate Ruby 2.7 - uses: ruby/setup-ruby@v1 - with: - ruby-version: '2.7' - bundler-cache: true - - name: Print bundle environment - if: ${{ github.repository_owner == 'puppetlabs' }} - run: | - echo ::group::info:bundler - bundle env - echo ::endgroup:: - - name: Provision test cluster - timeout-minutes: 15 - run: | - echo ::group::prepare - mkdir -p $HOME/.ssh - echo 'Host *' > $HOME/.ssh/config - echo ' ServerAliveInterval 150' >> $HOME/.ssh/config - echo ' ServerAliveCountMax 2' >> $HOME/.ssh/config - bundle exec rake spec_prep - echo ::endgroup:: - echo ::group::provision - bundle exec bolt plan run peadm_spec::provision_test_cluster \ - --modulepath spec/fixtures/modules \ - provider=provision_service \ - image=${{ matrix.image }} \ - architecture=${{ matrix.architecture }} - echo ::endgroup:: - echo ::group::info:request - cat request.json || true; echo - echo ::endgroup:: - echo ::group::info:inventory - sed -e 's/password: .*/password: "[redacted]"/' < spec/fixtures/litmus_inventory.yaml || true - echo ::endgroup:: - - name: Activate twingate to obtain unreleased build - uses: twingate/github-action@main - with: - service-key: ${{ secrets.TWINGATE_PUBLIC_REPO_KEY }} - - name: Get latest build name - id: latest - run: | - echo "::set-output name=ver::$(curl -q https://artifactory.delivery.puppetlabs.net/artifactory/generic_enterprise__local/main/ci-ready/LATEST)" - - name: Install PE on test cluster - timeout-minutes: 120 - run: | - bundle exec bolt plan run peadm_spec::install_test_cluster \ - --inventoryfile spec/fixtures/litmus_inventory.yaml \ - --modulepath spec/fixtures/modules \ - permit_unsafe_versions=true \ - download_mode="bolthost" \ - architecture=${{ matrix.architecture }} \ - pe_installer_source="https://artifactory.delivery.puppetlabs.net/artifactory/generic_enterprise__local/main/ci-ready/puppet-enterprise-${{ steps.latest.outputs.ver }}-el-8-x86_64.tar" \ - console_password=${{ secrets.CONSOLE_PASSWORD }} - - name: Wait as long as the file ${HOME}/pause file is present - if: ${{ always() && github.event.inputs.ssh-debugging == 'true' }} - run: | - while [ -f "${HOME}/pause" ] ; do - echo "${HOME}/pause present, sleeping for 60 seconds..." - sleep 60 - done - echo "${HOME}/pause absent, continuing workflow." - - name: Tear down test cluster - if: ${{ always() }} - continue-on-error: true - run: |- - if [ -f spec/fixtures/litmus_inventory.yaml ]; then - echo ::group::tear_down - bundle exec rake 'litmus:tear_down' - echo ::endgroup:: - echo ::group::info:request - cat request.json || true; echo - echo ::endgroup:: - fi diff --git a/.github/workflows/test-install-latest-xlarge-dev-nightly.yaml b/.github/workflows/test-install-latest-xlarge-dev-nightly.yaml deleted file mode 100644 index e39073a3..00000000 --- a/.github/workflows/test-install-latest-xlarge-dev-nightly.yaml +++ /dev/null @@ -1,106 +0,0 @@ ---- -name: Install latest dev test nightly -on: - schedule: - - cron: 0 3 * * * - workflow_dispatch: - inputs: - ssh-debugging: - description: Boolean; whether or not to pause for ssh debugging - required: true - default: 'false' -jobs: - test-install: - name: PE nightly using ${{ matrix.architecture }} on ${{ matrix.image }} - runs-on: ubuntu-20.04 - env: - BOLT_GEM: true - BOLT_DISABLE_ANALYTICS: true - LANG: en_US.UTF-8 - strategy: - fail-fast: false - matrix: - architecture: [extra-large-with-dr] - image: [almalinux-cloud/almalinux-8] - steps: - - name: Start SSH session - if: ${{ github.event.inputs.ssh-debugging == 'true' }} - uses: luchihoratiu/debug-via-ssh@main - with: - NGROK_AUTH_TOKEN: ${{ secrets.NGROK_AUTH_TOKEN }} - SSH_PASS: ${{ secrets.SSH_PASS }} - - name: Checkout Source - uses: actions/checkout@v4 - - name: Activate Ruby 2.7 - uses: ruby/setup-ruby@v1 - with: - ruby-version: '2.7' - bundler-cache: true - - name: Print bundle environment - if: ${{ github.repository_owner == 'puppetlabs' }} - run: | - echo ::group::info:bundler - bundle env - echo ::endgroup:: - - name: Provision test cluster - timeout-minutes: 15 - run: | - echo ::group::prepare - mkdir -p $HOME/.ssh - echo 'Host *' > $HOME/.ssh/config - echo ' ServerAliveInterval 150' >> $HOME/.ssh/config - echo ' ServerAliveCountMax 2' >> $HOME/.ssh/config - bundle exec rake spec_prep - echo ::endgroup:: - echo ::group::provision - bundle exec bolt plan run peadm_spec::provision_test_cluster \ - --modulepath spec/fixtures/modules \ - provider=provision_service \ - image=${{ matrix.image }} \ - architecture=${{ matrix.architecture }} - echo ::endgroup:: - echo ::group::info:request - cat request.json || true; echo - echo ::endgroup:: - echo ::group::info:inventory - sed -e 's/password: .*/password: "[redacted]"/' < spec/fixtures/litmus_inventory.yaml || true - echo ::endgroup:: - - name: Activate twingate to obtain unreleased build - uses: twingate/github-action@main - with: - service-key: ${{ secrets.TWINGATE_PUBLIC_REPO_KEY }} - - name: Get latest build name - id: latest - run: | - echo "::set-output name=ver::$(curl -q https://artifactory.delivery.puppetlabs.net/artifactory/generic_enterprise__local/main/ci-ready/LATEST)" - - name: Install PE on test cluster - timeout-minutes: 120 - run: | - bundle exec bolt plan run peadm_spec::install_test_cluster \ - --inventoryfile spec/fixtures/litmus_inventory.yaml \ - --modulepath spec/fixtures/modules \ - permit_unsafe_versions=true \ - download_mode="bolthost" \ - architecture=${{ matrix.architecture }} \ - pe_installer_source="https://artifactory.delivery.puppetlabs.net/artifactory/generic_enterprise__local/main/ci-ready/puppet-enterprise-${{ steps.latest.outputs.ver }}-el-8-x86_64.tar" \ - console_password=${{ secrets.CONSOLE_PASSWORD }} - - name: Wait as long as the file ${HOME}/pause file is present - if: ${{ always() && github.event.inputs.ssh-debugging == 'true' }} - run: | - while [ -f "${HOME}/pause" ] ; do - echo "${HOME}/pause present, sleeping for 60 seconds..." - sleep 60 - done - echo "${HOME}/pause absent, continuing workflow." - - name: Tear down test cluster - if: ${{ always() }} - continue-on-error: true - run: |- - if [ -f spec/fixtures/litmus_inventory.yaml ]; then - echo ::group::tear_down - bundle exec rake 'litmus:tear_down' - echo ::endgroup:: - echo ::group::info:request - cat request.json || true; echo - echo ::endgroup:: - fi diff --git a/.github/workflows/test-install-matrix.yaml b/.github/workflows/test-install-matrix.yaml deleted file mode 100644 index 41d20583..00000000 --- a/.github/workflows/test-install-matrix.yaml +++ /dev/null @@ -1,99 +0,0 @@ ---- -name: Install test matrix -on: - pull_request: - paths: - - .github/workflows/**/* - - spec/**/* - - lib/**/* - - tasks/**/* - - functions/**/* - - types/**/* - - plans/**/* - - hiera/**/* - - manifests/**/* - - templates/**/* - - files/**/* - - metadata.json - - Rakefile - - Gemfile - - provision.yaml - - .rspec - - .rubocop.yml - - .puppet-lint.rc - - .fixtures.yml - branches: [main] - workflow_dispatch: {} -jobs: - test-install: - name: PE ${{ matrix.version }} ${{ matrix.architecture }} on ${{ matrix.image }} - runs-on: ubuntu-20.04 - env: - BOLT_GEM: true - BOLT_DISABLE_ANALYTICS: true - LANG: en_US.UTF-8 - strategy: - fail-fast: false - matrix: - architecture: [standard-with-dr, large, extra-large-with-dr] - version: [2019.8.12, 2021.7.9, 2023.8.1, 2025.0.0] - image: [almalinux-cloud/almalinux-8] - steps: - - name: Checkout Source - uses: actions/checkout@v4 - - name: Activate Ruby 2.7 - uses: ruby/setup-ruby@v1 - with: - ruby-version: '2.7' - bundler-cache: true - - name: Print bundle environment - if: ${{ github.repository_owner == 'puppetlabs' }} - run: | - echo ::group::info:bundler - bundle env - echo ::endgroup:: - - name: Provision test cluster - timeout-minutes: 15 - run: | - echo ::group::prepare - mkdir -p $HOME/.ssh - echo 'Host *' > $HOME/.ssh/config - echo ' ServerAliveInterval 150' >> $HOME/.ssh/config - echo ' ServerAliveCountMax 2' >> $HOME/.ssh/config - bundle exec rake spec_prep - echo ::endgroup:: - echo ::group::provision - bundle exec bolt plan run peadm_spec::provision_test_cluster \ - --modulepath spec/fixtures/modules \ - provider=provision_service \ - image=${{ matrix.image }} \ - architecture=${{ matrix.architecture }} \ - --log-level trace - echo ::endgroup:: - echo ::group::info:request - cat request.json || true; echo - echo ::endgroup:: - echo ::group::info:inventory - sed -e 's/password: .*/password: "[redacted]"/' < spec/fixtures/litmus_inventory.yaml || true - echo ::endgroup:: - - name: Install PE on test cluster - timeout-minutes: 120 - run: | - bundle exec bolt plan run peadm_spec::install_test_cluster \ - --inventoryfile spec/fixtures/litmus_inventory.yaml \ - --modulepath spec/fixtures/modules \ - architecture=${{ matrix.architecture }} \ - version=${{ matrix.version }} \ - console_password=${{ secrets.CONSOLE_PASSWORD }} - - name: Tear down test cluster - if: ${{ always() }} - continue-on-error: true - run: |- - if [ -f spec/fixtures/litmus_inventory.yaml ]; then - echo ::group::tear_down - bundle exec rake 'litmus:tear_down' - echo ::endgroup:: - echo ::group::info:request - cat request.json || true; echo - echo ::endgroup:: - fi diff --git a/.github/workflows/test-install-rhel-9.yaml b/.github/workflows/test-install-rhel-9.yaml deleted file mode 100644 index 793eebd1..00000000 --- a/.github/workflows/test-install-rhel-9.yaml +++ /dev/null @@ -1,99 +0,0 @@ ---- -name: Install test rhel-9 -on: - pull_request: - paths: - - .github/workflows/**/* - - spec/**/* - - lib/**/* - - tasks/**/* - - functions/**/* - - types/**/* - - plans/**/* - - hiera/**/* - - manifests/**/* - - templates/**/* - - files/**/* - - metadata.json - - Rakefile - - Gemfile - - provision.yaml - - .rspec - - .rubocop.yml - - .puppet-lint.rc - - .fixtures.yml - branches: [main] - workflow_dispatch: {} -jobs: - test-install: - name: PE ${{ matrix.version }} ${{ matrix.architecture }} on ${{ matrix.image }} - runs-on: ubuntu-20.04 - env: - BOLT_GEM: true - BOLT_DISABLE_ANALYTICS: true - LANG: en_US.UTF-8 - strategy: - fail-fast: false - matrix: - architecture: [standard-with-dr, large, extra-large-with-dr] - version: [2021.7.9, 2023.8.1, 2025.0.0] - image: [rhel-9] - steps: - - name: Checkout Source - uses: actions/checkout@v4 - - name: Activate Ruby 2.7 - uses: ruby/setup-ruby@v1 - with: - ruby-version: '2.7' - bundler-cache: true - - name: Print bundle environment - if: ${{ github.repository_owner == 'puppetlabs' }} - run: | - echo ::group::info:bundler - bundle env - echo ::endgroup:: - - name: Provision test cluster - timeout-minutes: 15 - run: | - echo ::group::prepare - mkdir -p $HOME/.ssh - echo 'Host *' > $HOME/.ssh/config - echo ' ServerAliveInterval 150' >> $HOME/.ssh/config - echo ' ServerAliveCountMax 2' >> $HOME/.ssh/config - bundle exec rake spec_prep - echo ::endgroup:: - echo ::group::provision - bundle exec bolt plan run peadm_spec::provision_test_cluster \ - --modulepath spec/fixtures/modules \ - provider=provision_service \ - image=${{ matrix.image }} \ - architecture=${{ matrix.architecture }} \ - --log-level trace - echo ::endgroup:: - echo ::group::info:request - cat request.json || true; echo - echo ::endgroup:: - echo ::group::info:inventory - sed -e 's/password: .*/password: "[redacted]"/' < spec/fixtures/litmus_inventory.yaml || true - echo ::endgroup:: - - name: Install PE on test cluster - timeout-minutes: 120 - run: | - bundle exec bolt plan run peadm_spec::install_test_cluster \ - --inventoryfile spec/fixtures/litmus_inventory.yaml \ - --modulepath spec/fixtures/modules \ - architecture=${{ matrix.architecture }} \ - version=${{ matrix.version }} \ - console_password=${{ secrets.CONSOLE_PASSWORD }} - - name: Tear down test cluster - if: ${{ always() }} - continue-on-error: true - run: |- - if [ -f spec/fixtures/litmus_inventory.yaml ]; then - echo ::group::tear_down - bundle exec rake 'litmus:tear_down' - echo ::endgroup:: - echo ::group::info:request - cat request.json || true; echo - echo ::endgroup:: - fi diff --git a/.github/workflows/test-install.yaml b/.github/workflows/test-install.yaml deleted file mode 100644 index 8fd9df7b..00000000 --- a/.github/workflows/test-install.yaml +++ /dev/null @@ -1,107 +0,0 @@ ---- -name: Install test -on: - workflow_dispatch: - inputs: - image: - description: GCP image for test cluster - required: true - default: almalinux-cloud/almalinux-8 - architecture: - description: PE architecture to test - required: true - default: standard - version: - description: PE version to install - required: true - default: 2023.8.1 - ssh-debugging: - description: Boolean; whether or not to pause for ssh debugging - required: true - default: 'false' -jobs: - test-install: - name: PE ${{ matrix.version }} ${{ matrix.architecture }} on ${{ matrix.image }} - runs-on: ubuntu-20.04 - env: - BOLT_GEM: true - BOLT_DISABLE_ANALYTICS: true - LANG: en_US.UTF-8 - strategy: - fail-fast: false - matrix: - architecture: ['${{ github.event.inputs.architecture }}'] - version: ['${{ github.event.inputs.version }}'] - image: ['${{ github.event.inputs.image }}'] - steps: - - name: Start SSH session - if: ${{ github.event.inputs.ssh-debugging == 'true' }} - uses: luchihoratiu/debug-via-ssh@main - with: - NGROK_AUTH_TOKEN: ${{ secrets.NGROK_AUTH_TOKEN }} - SSH_PASS: ${{ secrets.SSH_PASS }} - - name: Checkout Source - uses: actions/checkout@v4 - - name: Activate Ruby 2.7 - uses: ruby/setup-ruby@v1 - with: - ruby-version: '2.7' - bundler-cache: true - - name: Print bundle environment - if: ${{ github.repository_owner == 'puppetlabs' }} - run: | - echo ::group::info:bundler - bundle env - echo ::endgroup:: - - name: Provision test cluster - timeout-minutes: 15 - run: | - echo ::group::prepare - mkdir -p $HOME/.ssh - echo 'Host *' > $HOME/.ssh/config - echo ' ServerAliveInterval 150' >> $HOME/.ssh/config - echo ' ServerAliveCountMax 2' >> $HOME/.ssh/config - bundle exec rake spec_prep - echo ::endgroup:: - echo ::group::provision - bundle exec bolt plan run peadm_spec::provision_test_cluster \ - --modulepath spec/fixtures/modules \ - provider=provision_service \ - image=${{ matrix.image }} \ - architecture=${{ matrix.architecture }} - echo ::endgroup:: - echo ::group::info:request - cat request.json || true; echo - echo ::endgroup:: - echo ::group::info:inventory - sed -e 's/password: .*/password: "[redacted]"/' < spec/fixtures/litmus_inventory.yaml || true - echo ::endgroup:: - - name: Install PE on test cluster - timeout-minutes: 120 - run: | - bundle exec bolt plan run peadm_spec::install_test_cluster \ - --inventoryfile spec/fixtures/litmus_inventory.yaml \ - --modulepath spec/fixtures/modules \ - architecture=${{ matrix.architecture }} \ - version=${{ matrix.version }} \ - console_password=${{ secrets.CONSOLE_PASSWORD }} - - name: Wait as long as the file ${HOME}/pause file is present - if: ${{ always() && github.event.inputs.ssh-debugging == 'true' }} - run: | - while [ -f "${HOME}/pause" ] ; do - echo "${HOME}/pause present, sleeping for 60 seconds..." - sleep 60 - done - echo "${HOME}/pause absent, continuing workflow." - - name: Tear down test cluster - if: ${{ always() }} - continue-on-error: true - run: |- - if [ -f spec/fixtures/litmus_inventory.yaml ]; then - echo ::group::tear_down - bundle exec rake 'litmus:tear_down' - echo ::endgroup:: - echo ::group::info:request - cat request.json || true; echo - echo ::endgroup:: - fi diff --git a/.github/workflows/test-legacy-compilers.yaml b/.github/workflows/test-legacy-compilers.yaml deleted file mode 100644 index 254a8b99..00000000 --- a/.github/workflows/test-legacy-compilers.yaml +++ /dev/null @@ -1,161 +0,0 @@ ---- -name: Convert compiler to legacy -on: - pull_request: - paths: - - .github/workflows/**/* - - spec/**/* - - lib/**/* - - tasks/**/* - - functions/**/* - - types/**/* - - plans/**/* - - hiera/**/* - - manifests/**/* - - templates/**/* - - files/**/* - - metadata.json - - Rakefile - - Gemfile - - provision.yaml - - .rspec - - .rubocop.yml - - .puppet-lint.rc - - .fixtures.yml - branches: [main] - workflow_dispatch: - inputs: - ssh-debugging: - description: Boolean; whether or not to pause for ssh debugging - required: true - default: 'false' -jobs: - convert_compiler: - name: Convert compilers to legacy - runs-on: ubuntu-20.04 - env: - BOLT_GEM: true - BOLT_DISABLE_ANALYTICS: true - LANG: en_US.UTF-8 - steps: - - name: Start SSH session - if: ${{ github.event.inputs.ssh-debugging == 'true' }} - uses: luchihoratiu/debug-via-ssh@main - with: - NGROK_AUTH_TOKEN: ${{ secrets.NGROK_AUTH_TOKEN }} - SSH_PASS: ${{ secrets.SSH_PASS }} - - name: Checkout Source - uses: actions/checkout@v4 - - name: Activate Ruby 2.7 - uses: ruby/setup-ruby@v1 - with: - ruby-version: '2.7' - bundler-cache: true - - name: Print bundle environment - if: ${{ github.repository_owner == 'puppetlabs' }} - run: | - echo ::group::info:bundler - bundle env - echo ::endgroup:: - - name: Provision test cluster - timeout-minutes: 15 - run: | - echo ::group::prepare - mkdir -p $HOME/.ssh - echo 'Host *' > $HOME/.ssh/config - echo ' ServerAliveInterval 150' >> $HOME/.ssh/config - echo ' ServerAliveCountMax 2' >> $HOME/.ssh/config - bundle exec rake spec_prep - echo ::endgroup:: - echo ::group::provision - bundle exec bolt plan run peadm_spec::provision_test_cluster \ - --modulepath spec/fixtures/modules \ - provider=provision_service \ - image=almalinux-cloud/almalinux-8 \ - architecture=large-with-dr - echo ::endgroup:: - echo ::group::certnames - bundle exec bolt plan run peadm_spec::add_inventory_hostnames \ - --inventory spec/fixtures/litmus_inventory.yaml \ - --modulepath spec/fixtures/modules \ - --no-host-key-check \ - inventory_file=spec/fixtures/litmus_inventory.yaml - echo ::endgroup:: - echo ::group::info:request - cat request.json || true; echo - echo ::endgroup:: - echo ::group::info:inventory - sed -e 's/password: .*/password: "[redacted]"/' < spec/fixtures/litmus_inventory.yaml || true - echo ::endgroup:: - - name: Set up yq - uses: frenck/action-setup-yq@v1 - with: - version: v4.30.5 - - name: Install PE on test cluster - timeout-minutes: 120 - run: | - bundle exec bolt plan run peadm_spec::install_test_cluster \ - --inventoryfile spec/fixtures/litmus_inventory.yaml \ - --modulepath spec/fixtures/modules \ - architecture=large-with-dr \ - console_password=${{ secrets.CONSOLE_PASSWORD }} \ - version=2025.0.0 - - name: Wait as long as the file ${HOME}/pause file is present - if: ${{ always() && github.event.inputs.ssh-debugging == 'true' }} - run: | - while [ -f "${HOME}/pause" ] ; do - echo "${HOME}/pause present, sleeping for 60 seconds..." - sleep 60 - done - echo "${HOME}/pause absent, continuing workflow." - - name: Convert one compiler to legacy - timeout-minutes: 120 - run: | - primary=$(yq '.groups[].targets[] | select(.vars.role == "primary") | .name' spec/fixtures/litmus_inventory.yaml) - compiler=$(yq '.groups[].targets[] | select(.vars.role == "compiler") | .name' spec/fixtures/litmus_inventory.yaml | head -n 1) - echo "primary: $primary" - echo "compiler: $compiler" - echo ::group::convert_compiler_to_legacy - bundle exec bolt plan run peadm::convert_compiler_to_legacy \ - --inventoryfile spec/fixtures/litmus_inventory.yaml \ - --modulepath spec/fixtures/modules \ - --no-host-key-check \ - primary_host=$primary \ - legacy_hosts=$compiler - echo ::endgroup:: - - name: Check if compiler is converted - timeout-minutes: 120 - run: | - echo ::group::inventory - sed -e 's/password: .*/password: "[redacted]"/' < spec/fixtures/litmus_inventory.yaml || true - echo ::endgroup:: - echo ::group::get_peadm_config - primary=$(yq '.groups[].targets[] | select(.vars.role == "primary") | .name' spec/fixtures/litmus_inventory.yaml) - compiler=$(yq '.groups[].targets[] | select(.vars.role == "compiler") | .name' spec/fixtures/litmus_inventory.yaml | head -n 1) - bundle exec bolt task run peadm::get_peadm_config \ - --targets $primary \ - --inventoryfile spec/fixtures/litmus_inventory.yaml \ - --modulepath spec/fixtures/modules \ - --no-host-key-check \ - --format json > peadm_config.json - cat peadm_config.json - echo ::endgroup:: - echo ::group::smoke_test - legacy_compiler=$(yq '.items[0].value.params.legacy_compilers[0]' peadm_config.json) - if [ "$compiler" != "$legacy_compiler" ]; then - echo "Compiler conversion failed, expected $compiler, got $legacy_compiler" - exit 1 - fi - echo ::endgroup:: - - name: Tear down test cluster - if: ${{ always() }} - continue-on-error: true - run: |- - if [ -f spec/fixtures/litmus_inventory.yaml ]; then - echo ::group::tear_down - bundle exec rake 'litmus:tear_down' - echo ::endgroup:: - echo ::group::info:request - cat request.json || true; echo - echo ::endgroup:: - fi diff --git a/.github/workflows/test-legacy-upgrade.yaml b/.github/workflows/test-legacy-upgrade.yaml deleted file mode 100644 index 23692fca..00000000 --- a/.github/workflows/test-legacy-upgrade.yaml +++ /dev/null @@ -1,205 +0,0 @@ ---- -name: Upgrade PE with legacy compilers -on: - pull_request: - paths: - - .github/workflows/**/* - - spec/**/* - - lib/**/* - - tasks/**/* - - functions/**/* - - types/**/* - - plans/**/* - - hiera/**/* - - manifests/**/* - - templates/**/* - - files/**/* - - metadata.json - - Rakefile - - Gemfile - - provision.yaml - - .rspec - - .rubocop.yml - - .puppet-lint.rc - - .fixtures.yml - branches: [main] - workflow_dispatch: - inputs: - ssh-debugging: - description: Boolean; whether or not to pause for ssh debugging - required: true - default: 'false' -jobs: - upgrade_with_legacy_compilers: - name: Upgrade PE with legacy compilers - runs-on: ubuntu-20.04 - env: - BOLT_GEM: true - BOLT_DISABLE_ANALYTICS: true - LANG: en_US.UTF-8 - steps: - - name: Start SSH session - if: ${{ github.event.inputs.ssh-debugging == 'true' }} - uses: luchihoratiu/debug-via-ssh@main - with: - NGROK_AUTH_TOKEN: ${{ secrets.NGROK_AUTH_TOKEN }} - SSH_PASS: ${{ secrets.SSH_PASS }} - - name: Checkout Source - uses: actions/checkout@v4 - - name: Activate Ruby 2.7 - uses: ruby/setup-ruby@v1 - with: - ruby-version: '2.7' - bundler-cache: true - - name: Print bundle environment - if: ${{ github.repository_owner == 'puppetlabs' }} - run: | - echo ::group::info:bundler - bundle env - echo ::endgroup:: - - name: Provision test cluster - timeout-minutes: 15 - run: | - echo ::group::prepare - mkdir -p $HOME/.ssh - echo 'Host *' > $HOME/.ssh/config - echo ' ServerAliveInterval 150' >> $HOME/.ssh/config - echo ' ServerAliveCountMax 2' >> $HOME/.ssh/config - bundle exec rake spec_prep - echo ::endgroup:: - echo ::group::provision - bundle exec bolt plan run peadm_spec::provision_test_cluster \ - --modulepath spec/fixtures/modules \ - provider=provision_service \ - image=almalinux-cloud/almalinux-8 \ - architecture=large-with-dr - echo ::endgroup:: - echo ::group::certnames - bundle exec bolt plan run peadm_spec::add_inventory_hostnames \ - --inventory spec/fixtures/litmus_inventory.yaml \ - --modulepath spec/fixtures/modules \ - --no-host-key-check \ - inventory_file=spec/fixtures/litmus_inventory.yaml - echo ::endgroup:: - echo ::group::info:request - cat request.json || true; echo - echo ::endgroup:: - echo ::group::info:inventory - sed -e 's/password: .*/password: "[redacted]"/' < spec/fixtures/litmus_inventory.yaml || true - echo ::endgroup:: - - name: Set up yq - uses: frenck/action-setup-yq@v1 - with: - version: v4.30.5 - - name: Create the params.json file - run: | - primary=$(yq '.groups[].targets[] | select(.vars.role == "primary") | .name' spec/fixtures/litmus_inventory.yaml) - compiler=$(yq '.groups[].targets[] | select(.vars.role == "compiler") | .name' spec/fixtures/litmus_inventory.yaml | head -n 1) - legacy_compiler=$(yq '.groups[].targets[] | select(.vars.role == "compiler") | .name' spec/fixtures/litmus_inventory.yaml | sed -n 2p) - replica=$(yq '.groups[].targets[] | select(.vars.role == "replica") | .name' spec/fixtures/litmus_inventory.yaml) - hash_random=$(LC_ALL=C tr -dc 'A-Za-z0-9!#$%&'\''()*+,-./:;<=>?@[\]^_`{|}~' params.json - - name: Install PE with legacy compilers - timeout-minutes: 120 - run: | - echo ::group::params.json - jq '.console_password = "[redacted]"' params.json || true - echo ::endgroup:: - echo ::group::install - bundle exec bolt plan run peadm::install \ - --inventoryfile spec/fixtures/litmus_inventory.yaml \ - --modulepath spec/fixtures/modules \ - --no-host-key-check \ - --params @params.json - echo ::endgroup:: - - name: Wait as long as the file ${HOME}/pause file is present - if: ${{ always() && github.event.inputs.ssh-debugging == 'true' }} - run: | - while [ -f "${HOME}/pause" ] ; do - echo "${HOME}/pause present, sleeping for 60 seconds..." - sleep 60 - done - echo "${HOME}/pause absent, continuing workflow." - - name: Check if compilers are configured - timeout-minutes: 120 - run: | - echo ::group::inventory - sed -e 's/password: .*/password: "[redacted]"/' < spec/fixtures/litmus_inventory.yaml || true - echo ::endgroup:: - echo ::group::get_peadm_config - primary=$(yq '.groups[].targets[] | select(.vars.role == "primary") | .name' spec/fixtures/litmus_inventory.yaml) - compiler=$(yq '.groups[].targets[] | select(.vars.role == "compiler") | .name' spec/fixtures/litmus_inventory.yaml | head -n 1) - legacy_compiler=$(yq '.groups[].targets[] | select(.vars.role == "compiler") | .name' spec/fixtures/litmus_inventory.yaml | sed -n 2p) - bundle exec bolt task run peadm::get_peadm_config \ - --targets $primary \ - --inventoryfile spec/fixtures/litmus_inventory.yaml \ - --modulepath spec/fixtures/modules \ - --no-host-key-check \ - --format json > peadm_config.json - cat peadm_config.json - echo ::endgroup:: - echo ::group::smoke_test - configured_legacy_compiler=$(yq '.items[0].value.params.legacy_compilers[0]' peadm_config.json) - configured_compiler=$(yq '.items[0].value.params.compiler_hosts[0]' peadm_config.json) - if [ "$configured_legacy_compiler" != "$legacy_compiler" ] && [ "$configured_compiler" != "$compiler" ]; then - echo "Compilers are not configured, expected $legacy_compiler and $compiler, got $configured_legacy_compiler and $configured_compiler" - exit 1 - fi - echo ::endgroup:: - - name: Create the upgrade params.json file - run: | - primary=$(yq '.groups[].targets[] | select(.vars.role == "primary") | .name' spec/fixtures/litmus_inventory.yaml) - compiler=$(yq '.groups[].targets[] | select(.vars.role == "compiler") | .name' spec/fixtures/litmus_inventory.yaml | head -n 1) - legacy_compiler=$(yq '.groups[].targets[] | select(.vars.role == "compiler") | .name' spec/fixtures/litmus_inventory.yaml | sed -n 2p) - replica=$(yq '.groups[].targets[] | select(.vars.role == "replica") | .name' spec/fixtures/litmus_inventory.yaml) - echo -n '{ "primary_host": "'$primary'", "replica_host": "'$replica'", "compiler_hosts": ["'$compiler'", "'$legacy_compiler'"], "version": "2025.0.0"}' > upgrade_params.json - - name: Upgrade PE with legacy compilers - run: | - echo ::group::upgrade_params.json - cat upgrade_params.json - echo ::endgroup:: - echo ::group::upgrade - bundle exec bolt plan run peadm::upgrade \ - --inventoryfile spec/fixtures/litmus_inventory.yaml \ - --modulepath spec/fixtures/modules \ - --no-host-key-check \ - --params @upgrade_params.json - echo ::endgroup:: - - name: Check if we still have legacy compilers configured - timeout-minutes: 120 - run: | - echo ::group::inventory - sed -e 's/password: .*/password: "[redacted]"/' < spec/fixtures/litmus_inventory.yaml || true - echo ::endgroup:: - echo ::group::get_peadm_config - primary=$(yq '.groups[].targets[] | select(.vars.role == "primary") | .name' spec/fixtures/litmus_inventory.yaml) - compiler=$(yq '.groups[].targets[] | select(.vars.role == "compiler") | .name' spec/fixtures/litmus_inventory.yaml | head -n 1) - legacy_compiler=$(yq '.groups[].targets[] | select(.vars.role == "compiler") | .name' spec/fixtures/litmus_inventory.yaml | sed -n 2p) - bundle exec bolt task run peadm::get_peadm_config \ - --targets $primary \ - --inventoryfile spec/fixtures/litmus_inventory.yaml \ - --modulepath spec/fixtures/modules \ - --no-host-key-check \ - --format json > peadm_config.json - cat peadm_config.json - echo ::endgroup:: - echo ::group::smoke_test - configured_legacy_compiler=$(yq '.items[0].value.params.legacy_compilers[0]' peadm_config.json) - configured_compiler=$(yq '.items[0].value.params.compiler_hosts[0]' peadm_config.json) - if [ "$configured_legacy_compiler" != "$legacy_compiler" ] && [ "$configured_compiler" != "$compiler" ]; then - echo "Compilers are not configured, expected $legacy_compiler and $compiler, got $configured_legacy_compiler and $configured_compiler" - exit 1 - fi - echo ::endgroup:: - - name: Tear down test cluster - if: ${{ always() }} - continue-on-error: true - run: |- - if [ -f spec/fixtures/litmus_inventory.yaml ]; then - echo ::group::tear_down - bundle exec rake 'litmus:tear_down' - echo ::endgroup:: - echo ::group::info:request - cat request.json || true; echo - echo ::endgroup:: - fi diff --git a/.github/workflows/test-upgrade-latest-dev.yaml b/.github/workflows/test-upgrade-latest-dev.yaml deleted file mode 100644 index 37ad90a7..00000000 --- a/.github/workflows/test-upgrade-latest-dev.yaml +++ /dev/null @@ -1,135 +0,0 @@ ---- -name: Upgrade to latest dev test -on: - workflow_dispatch: - inputs: - image: - description: GCP image for test cluster - required: true - default: almalinux-cloud/almalinux-8 - architecture: - type: choice - required: true - default: standard - description: PE architecture to test - options: - - standard - - standard-with-dr - - large - - large-with-dr - - extra-large - - extra-large-with-dr - version: - type: string - required: true - description: The initial version of PE to install before upgrade - default: 2023.8.1 - ssh-debugging: - description: Boolean; whether or not to pause for ssh debugging - required: true - default: 'false' -jobs: - test-upgrade: - name: PE ${{ matrix.version }} to latest dev using ${{ matrix.architecture }} - on ${{ matrix.image }} - runs-on: ubuntu-20.04 - env: - BOLT_GEM: true - BOLT_DISABLE_ANALYTICS: true - LANG: en_US.UTF-8 - strategy: - fail-fast: false - matrix: - architecture: ['${{ github.event.inputs.architecture }}'] - version: ['${{ github.event.inputs.version }}'] - image: ['${{ github.event.inputs.image }}'] - steps: - - name: Start SSH session - if: ${{ github.event.inputs.ssh-debugging == 'true' }} - uses: luchihoratiu/debug-via-ssh@main - with: - NGROK_AUTH_TOKEN: ${{ secrets.NGROK_AUTH_TOKEN }} - SSH_PASS: ${{ secrets.SSH_PASS }} - - name: Checkout Source - uses: actions/checkout@v4 - - name: Activate Ruby 2.7 - uses: ruby/setup-ruby@v1 - with: - ruby-version: '2.7' - bundler-cache: true - - name: Print bundle environment - if: ${{ github.repository_owner == 'puppetlabs' }} - run: | - echo ::group::info:bundler - bundle env - echo ::endgroup:: - - name: Provision test cluster - timeout-minutes: 15 - run: | - echo ::group::prepare - mkdir -p $HOME/.ssh - echo 'Host *' > $HOME/.ssh/config - echo ' ServerAliveInterval 150' >> $HOME/.ssh/config - echo ' ServerAliveCountMax 2' >> $HOME/.ssh/config - bundle exec rake spec_prep - echo ::endgroup:: - echo ::group::provision - bundle exec bolt plan run peadm_spec::provision_test_cluster \ - --modulepath spec/fixtures/modules \ - provider=provision_service \ - image=${{ matrix.image }} \ - architecture=${{ matrix.architecture }} - echo ::endgroup:: - echo ::group::info:request - cat request.json || true; echo - echo ::endgroup:: - echo ::group::info:inventory - sed -e 's/password: .*/password: "[redacted]"/' < spec/fixtures/litmus_inventory.yaml || true - echo ::endgroup:: - - name: Install PE on test cluster - timeout-minutes: 120 - run: | - bundle exec bolt plan run peadm_spec::install_test_cluster \ - --inventoryfile spec/fixtures/litmus_inventory.yaml \ - --modulepath spec/fixtures/modules \ - architecture=${{ matrix.architecture }} \ - version=${{ matrix.version }} \ - console_password=${{ secrets.CONSOLE_PASSWORD }} - - name: Wait as long as the file ${HOME}/pause file is present - if: ${{ always() && github.event.inputs.ssh-debugging == 'true' }} - run: | - while [ -f "${HOME}/pause" ] ; do - echo "${HOME}/pause present, sleeping for 60 seconds..." - sleep 60 - done - echo "${HOME}/pause absent, continuing workflow." - - name: Activate twingate to obtain unreleased build - uses: twingate/github-action@main - with: - service-key: ${{ secrets.TWINGATE_PUBLIC_REPO_KEY }} - - name: Get latest build name - id: latest - run: | - echo "::set-output name=ver::$(curl -q https://artifactory.delivery.puppetlabs.net/artifactory/generic_enterprise__local/main/ci-ready/LATEST)" - - name: Upgrade PE on test cluster - timeout-minutes: 120 - run: | - bundle exec bolt plan run peadm_spec::upgrade_test_cluster \ - --inventoryfile spec/fixtures/litmus_inventory.yaml \ - --modulepath spec/fixtures/modules \ - permit_unsafe_versions=true \ - download_mode="bolthost" \ - architecture=${{ matrix.architecture }} \ - pe_installer_source="https://artifactory.delivery.puppetlabs.net/artifactory/generic_enterprise__local/main/ci-ready/puppet-enterprise-${{ steps.latest.outputs.ver }}-el-8-x86_64.tar" - - name: Tear down test cluster - if: ${{ always() }} - continue-on-error: true - run: |- - if [ -f spec/fixtures/litmus_inventory.yaml ]; then - echo ::group::tear_down - bundle exec rake 'litmus:tear_down' - echo ::endgroup:: - echo ::group::info:request - cat request.json || true; echo - echo ::endgroup:: - fi diff --git a/.github/workflows/test-upgrade-latest-xlarge-dev-nightly.yaml b/.github/workflows/test-upgrade-latest-xlarge-dev-nightly.yaml deleted file mode 100644 index 0a5ee865..00000000 --- a/.github/workflows/test-upgrade-latest-xlarge-dev-nightly.yaml +++ /dev/null @@ -1,96 +0,0 @@ ---- -name: Upgrade to latest dev test nightly -on: - schedule: - - cron: 0 3 * * * -jobs: - test-upgrade: - name: PE ${{ matrix.version }} to nightly dev using ${{ matrix.architecture }} - on ${{ matrix.image }} - runs-on: ubuntu-20.04 - env: - BOLT_GEM: true - BOLT_DISABLE_ANALYTICS: true - LANG: en_US.UTF-8 - strategy: - fail-fast: false - matrix: - architecture: [extra-large-with-dr] - version: [2023.8.1] - image: [almalinux-cloud/almalinux-8] - steps: - - name: Checkout Source - uses: actions/checkout@v4 - - name: Activate Ruby 2.7 - uses: ruby/setup-ruby@v1 - with: - ruby-version: '2.7' - bundler-cache: true - - name: Print bundle environment - if: ${{ github.repository_owner == 'puppetlabs' }} - run: | - echo ::group::info:bundler - bundle env - echo ::endgroup:: - - name: Provision test cluster - timeout-minutes: 15 - run: | - echo ::group::prepare - mkdir -p $HOME/.ssh - echo 'Host *' > $HOME/.ssh/config - echo ' ServerAliveInterval 150' >> $HOME/.ssh/config - echo ' ServerAliveCountMax 2' >> $HOME/.ssh/config - bundle exec rake spec_prep - echo ::endgroup:: - echo ::group::provision - bundle exec bolt plan run peadm_spec::provision_test_cluster \ - --modulepath spec/fixtures/modules \ - provider=provision_service \ - image=${{ matrix.image }} \ - architecture=${{ matrix.architecture }} - echo ::endgroup:: - echo ::group::info:request - cat request.json || true; echo - echo ::endgroup:: - echo ::group::info:inventory - sed -e 's/password: .*/password: "[redacted]"/' < spec/fixtures/litmus_inventory.yaml || true - echo ::endgroup:: - - name: Install PE on test cluster - timeout-minutes: 120 - run: | - bundle exec bolt plan run peadm_spec::install_test_cluster \ - --inventoryfile spec/fixtures/litmus_inventory.yaml \ - --modulepath spec/fixtures/modules \ - architecture=${{ matrix.architecture }} \ - version=${{ matrix.version }} \ - console_password=${{ secrets.CONSOLE_PASSWORD }} - - name: Activate twingate to obtain unreleased build - uses: twingate/github-action@main - with: - service-key: ${{ secrets.TWINGATE_PUBLIC_REPO_KEY }} - - name: Get latest build name - id: latest - run: | - echo "::set-output name=ver::$(curl -q https://artifactory.delivery.puppetlabs.net/artifactory/generic_enterprise__local/main/ci-ready/LATEST)" - - name: Upgrade PE on test cluster - timeout-minutes: 120 - run: | - bundle exec bolt plan run peadm_spec::upgrade_test_cluster \ - --inventoryfile spec/fixtures/litmus_inventory.yaml \ - --modulepath spec/fixtures/modules \ - permit_unsafe_versions=true \ - download_mode="bolthost" \ - architecture=${{ matrix.architecture }} \ - pe_installer_source="https://artifactory.delivery.puppetlabs.net/artifactory/generic_enterprise__local/main/ci-ready/puppet-enterprise-${{ steps.latest.outputs.ver }}-el-8-x86_64.tar" - - name: Tear down test cluster - if: ${{ always() }} - continue-on-error: true - run: |- - if [ -f spec/fixtures/litmus_inventory.yaml ]; then - echo ::group::tear_down - bundle exec rake 'litmus:tear_down' - echo ::endgroup:: - echo ::group::info:request - cat request.json || true; echo - echo ::endgroup:: - fi diff --git a/.github/workflows/test-upgrade-matrix.yaml b/.github/workflows/test-upgrade-matrix.yaml deleted file mode 100644 index e59b4cde..00000000 --- a/.github/workflows/test-upgrade-matrix.yaml +++ /dev/null @@ -1,139 +0,0 @@ ---- -name: Upgrade test matrix -on: - pull_request: - paths: - - .github/workflows/**/* - - spec/**/* - - lib/**/* - - tasks/**/* - - functions/**/* - - types/**/* - - plans/**/* - - hiera/**/* - - manifests/**/* - - templates/**/* - - files/**/* - - metadata.json - - Rakefile - - Gemfile - - provision.yaml - - .rspec - - .rubocop.yml - - .puppet-lint.rc - - .fixtures.yml - branches: [main] - workflow_dispatch: {} -jobs: - test-upgrade: - name: PE ${{ matrix.version }} to ${{ matrix.version_to_upgrade }} ${{ matrix.architecture }} - on ${{ matrix.image }} - runs-on: ubuntu-20.04 - env: - BOLT_GEM: true - BOLT_DISABLE_ANALYTICS: true - LANG: en_US.UTF-8 - strategy: - fail-fast: false - matrix: - architecture: [standard, extra-large-with-dr] - version: [2019.8.12, 2021.7.9, 2023.8.1] - version_to_upgrade: [2021.7.9, 2023.8.1, 2025.0.0] - image: [almalinux-cloud/almalinux-8] - download_mode: [direct] - exclude: - - version: 2019.8.12 - version_to_upgrade: 2023.8.1 - - version: 2019.8.12 - version_to_upgrade: 2025.0.0 - - version: 2021.7.9 - version_to_upgrade: 2021.7.9 - - version: 2021.7.9 - version_to_upgrade: 2025.0.0 - - version: 2023.8.1 - version_to_upgrade: 2023.8.1 - - version: 2023.8.1 - version_to_upgrade: 2025.0.0 - - version: 2023.8.1 - version_to_upgrade: 2021.7.9 - steps: - - name: Start SSH session - if: ${{ github.event.inputs.ssh-debugging == 'true' }} - uses: luchihoratiu/debug-via-ssh@main - with: - NGROK_AUTH_TOKEN: ${{ secrets.NGROK_AUTH_TOKEN }} - SSH_PASS: ${{ secrets.SSH_PASS }} - - name: Checkout Source - uses: actions/checkout@v4 - - name: Activate Ruby 2.7 - uses: ruby/setup-ruby@v1 - with: - ruby-version: '2.7' - bundler-cache: true - - name: Print bundle environment - if: ${{ github.repository_owner == 'puppetlabs' }} - run: | - echo ::group::info:bundler - bundle env - echo ::endgroup:: - - name: Provision test cluster - timeout-minutes: 15 - run: | - echo ::group::prepare - mkdir -p $HOME/.ssh - echo 'Host *' > $HOME/.ssh/config - echo ' ServerAliveInterval 150' >> $HOME/.ssh/config - echo ' ServerAliveCountMax 2' >> $HOME/.ssh/config - bundle exec rake spec_prep - echo ::endgroup:: - echo ::group::provision - bundle exec bolt plan run peadm_spec::provision_test_cluster \ - --modulepath spec/fixtures/modules \ - provider=provision_service \ - image=${{ matrix.image }} \ - architecture=${{ matrix.architecture }} - echo ::endgroup:: - echo ::group::info:request - cat request.json || true; echo - echo ::endgroup:: - echo ::group::info:inventory - sed -e 's/password: .*/password: "[redacted]"/' < spec/fixtures/litmus_inventory.yaml || true - echo ::endgroup:: - - name: Install PE on test cluster - timeout-minutes: 120 - run: | - bundle exec bolt plan run peadm_spec::install_test_cluster \ - --inventoryfile spec/fixtures/litmus_inventory.yaml \ - --modulepath spec/fixtures/modules \ - architecture=${{ matrix.architecture }} \ - version=${{ matrix.version }} \ - console_password=${{ secrets.CONSOLE_PASSWORD }} - - name: Wait as long as the file ${HOME}/pause file is present - if: ${{ always() && github.event.inputs.ssh-debugging == 'true' }} - run: | - while [ -f "${HOME}/pause" ] ; do - echo "${HOME}/pause present, sleeping for 60 seconds..." - sleep 60 - done - echo "${HOME}/pause absent, continuing workflow." - - name: Upgrade PE on test cluster - timeout-minutes: 120 - run: | - bundle exec bolt plan run peadm_spec::upgrade_test_cluster \ - --inventoryfile spec/fixtures/litmus_inventory.yaml \ - --modulepath spec/fixtures/modules \ - architecture=${{ matrix.architecture }} \ - download_mode=${{ matrix.download_mode }} \ - version=${{ matrix.version_to_upgrade }} - - name: Tear down test cluster - if: ${{ always() }} - continue-on-error: true - run: |- - if [ -f spec/fixtures/litmus_inventory.yaml ]; then - echo ::group::tear_down - bundle exec rake 'litmus:tear_down' - echo ::endgroup:: - echo ::group::info:request - cat request.json || true; echo - echo ::endgroup:: - fi diff --git a/.github/workflows/test-upgrade.yaml b/.github/workflows/test-upgrade.yaml deleted file mode 100644 index aece32cd..00000000 --- a/.github/workflows/test-upgrade.yaml +++ /dev/null @@ -1,130 +0,0 @@ ---- -name: Upgrade test -on: - workflow_dispatch: - inputs: - image: - description: GCP image for test cluster - required: true - default: almalinux-cloud/almalinux-8 - architecture: - type: choice - required: true - default: standard - description: PE architecture to test - options: - - standard - - standard-with-dr - - large - - large-with-dr - - extra-large - - extra-large-with-dr - version: - description: PE version to install initially - required: true - default: 2019.8.12 - upgrade_version: - description: PE version to upgrade to - required: true - default: 2021.7.9 - ssh-debugging: - description: Boolean; whether or not to pause for ssh debugging - required: true - default: 'false' -jobs: - test-upgrade: - name: PE ${{ matrix.version }} ${{ matrix.architecture }} on ${{ matrix.image }} - runs-on: ubuntu-20.04 - env: - BOLT_GEM: true - BOLT_DISABLE_ANALYTICS: true - LANG: en_US.UTF-8 - strategy: - fail-fast: false - matrix: - download_mode: [direct] - architecture: ['${{ github.event.inputs.architecture }}'] - version: ['${{ github.event.inputs.version }}'] - version_to_upgrade: ['${{ github.event.inputs.upgrade_version }}'] - image: ['${{ github.event.inputs.image }}'] - steps: - - name: Start SSH session - if: ${{ github.event.inputs.ssh-debugging == 'true' }} - uses: luchihoratiu/debug-via-ssh@main - with: - NGROK_AUTH_TOKEN: ${{ secrets.NGROK_AUTH_TOKEN }} - SSH_PASS: ${{ secrets.SSH_PASS }} - - name: Checkout Source - uses: actions/checkout@v4 - - name: Activate Ruby 2.7 - uses: ruby/setup-ruby@v1 - with: - ruby-version: '2.7' - bundler-cache: true - - name: Print bundle environment - if: ${{ github.repository_owner == 'puppetlabs' }} - run: | - echo ::group::info:bundler - bundle env - echo ::endgroup:: - - name: Provision test cluster - timeout-minutes: 15 - run: | - echo ::group::prepare - mkdir -p $HOME/.ssh - echo 'Host *' > $HOME/.ssh/config - echo ' ServerAliveInterval 150' >> $HOME/.ssh/config - echo ' ServerAliveCountMax 2' >> $HOME/.ssh/config - bundle exec rake spec_prep - echo ::endgroup:: - echo ::group::provision - bundle exec bolt plan run peadm_spec::provision_test_cluster \ - --modulepath spec/fixtures/modules \ - provider=provision_service \ - image=${{ matrix.image }} \ - architecture=${{ matrix.architecture }} - echo ::endgroup:: - echo ::group::info:request - cat request.json || true; echo - echo ::endgroup:: - echo ::group::info:inventory - sed -e 's/password: .*/password: "[redacted]"/' < spec/fixtures/litmus_inventory.yaml || true - echo ::endgroup:: - - name: Install PE on test cluster - timeout-minutes: 120 - run: | - bundle exec bolt plan run peadm_spec::install_test_cluster \ - --inventoryfile spec/fixtures/litmus_inventory.yaml \ - --modulepath spec/fixtures/modules \ - architecture=${{ matrix.architecture }} \ - version=${{ matrix.version }} \ - console_password=${{ secrets.CONSOLE_PASSWORD }} - - name: Wait as long as the file ${HOME}/pause file is present - if: ${{ always() && github.event.inputs.ssh-debugging == 'true' }} - run: | - while [ -f "${HOME}/pause" ] ; do - echo "${HOME}/pause present, sleeping for 60 seconds..." - sleep 60 - done - echo "${HOME}/pause absent, continuing workflow." - - name: Upgrade PE on test cluster - timeout-minutes: 120 - run: | - bundle exec bolt plan run peadm_spec::upgrade_test_cluster \ - --inventoryfile spec/fixtures/litmus_inventory.yaml \ - --modulepath spec/fixtures/modules \ - architecture=${{ matrix.architecture }} \ - download_mode=${{ matrix.download_mode }} \ - version=${{ matrix.version_to_upgrade }} - - name: Tear down test cluster - if: ${{ always() }} - continue-on-error: true - run: |- - if [ -f spec/fixtures/litmus_inventory.yaml ]; then - echo ::group::tear_down - bundle exec rake 'litmus:tear_down' - echo ::endgroup:: - echo ::group::info:request - cat request.json || true; echo - echo ::endgroup:: - fi diff --git a/spec/acceptance/peadm_spec/plans/provision_test_cluster.pp b/spec/acceptance/peadm_spec/plans/provision_test_cluster.pp index 4529dc9b..f412e8c7 100644 --- a/spec/acceptance/peadm_spec/plans/provision_test_cluster.pp +++ b/spec/acceptance/peadm_spec/plans/provision_test_cluster.pp @@ -38,6 +38,9 @@ 'extra-large-with-dr': { ['primary', 'primary-pdb-postgresql', 'compiler', 'replica', 'replica-pdb-postgresql', 'compiler'] } + 'extra-large-with-dr-migration': { + ['primary', 'primary-pdb-postgresql', 'compiler', 'replica', 'replica-pdb-postgresql', 'compiler', 'primary2', 'primary-pdb-postgresql2', 'replica2', 'replica-pdb-postgresql2'] + } 'standard-with-extra-compiler': { ['primary', 'unconfigured-compiler'] } diff --git a/spec/acceptance/peadm_spec/plans/verify_config.pp b/spec/acceptance/peadm_spec/plans/verify_config.pp new file mode 100644 index 00000000..b4a2f819 --- /dev/null +++ b/spec/acceptance/peadm_spec/plans/verify_config.pp @@ -0,0 +1,26 @@ +plan peadm_spec::verify_config( + Peadm::SingleTargetSpec $primary_host, +) { + $primary_target = peadm::get_targets($primary_host, 1) + + out::message("Running peadm::status on primary host ${primary_host}") + $result = run_plan('peadm::status', $primary_host, { 'format' => 'json' }) + + out::message($result) + + if empty($result['failed']) { + out::message('Cluster is healthy, continuing') + } else { + fail_plan('Cluster is not healthy, aborting') + } + + $result = run_task('peadm::get_peadm_config', $primary_host, '_catch_errors' => true).first.to_data() + out::message("PE configuration: ${result}") + $replica_host = $result['value']['params']['replica_host'] + out::message("Replica host: ${replica_host}") + if $replica_host == undef or $replica_host == null { + out::message('No replica was found in the PE configuration') + } else { + out::message("Replica added successfully: ${replica_host}") + } +}