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 deleted file mode 100644 index c8f6e393..00000000 --- a/.github/workflows/test-backup-restore-migration.yaml +++ /dev/null @@ -1,217 +0,0 @@ ---- -name: Backup and restore test -on: - workflow_dispatch: - inputs: - image: - description: GCP image for test cluster - required: true - default: almalinux-cloud/almalinux-8 - architecture: - description: PE architecture to test - required: true - default: standard - version: - description: PE version to install - required: true - default: 2021.7.4 - ssh-debugging: - description: Boolean; whether or not to pause for ssh debugging - required: true - default: 'false' -jobs: - backup: - name: 'Backup: Cluster A: PE ${{ inputs.version }} ${{ inputs.architecture }} - on ${{ inputs.image }}' - runs-on: ubuntu-20.04 - env: - BOLT_GEM: true - BOLT_DISABLE_ANALYTICS: true - LANG: en_US.UTF-8 - steps: - - name: Start SSH session - if: ${{ github.event.inputs.ssh-debugging == 'true' }} - uses: luchihoratiu/debug-via-ssh@main - with: - NGROK_AUTH_TOKEN: ${{ secrets.NGROK_AUTH_TOKEN }} - SSH_PASS: ${{ secrets.SSH_PASS }} - - name: Checkout Source - uses: actions/checkout@v4 - - name: Activate Ruby 2.7 - uses: ruby/setup-ruby@v1 - with: - ruby-version: '2.7' - bundler-cache: true - - name: Print bundle environment - if: ${{ github.repository_owner == 'puppetlabs' }} - run: | - echo ::group::info:bundler - bundle env - echo ::endgroup:: - - name: Provision test cluster - timeout-minutes: 15 - run: | - echo ::group::prepare - mkdir -p $HOME/.ssh - echo 'Host *' > $HOME/.ssh/config - echo ' ServerAliveInterval 150' >> $HOME/.ssh/config - echo ' ServerAliveCountMax 2' >> $HOME/.ssh/config - bundle exec rake spec_prep - echo ::endgroup:: - echo ::group::provision - bundle exec bolt plan run peadm_spec::provision_test_cluster \ - --modulepath spec/fixtures/modules \ - provider=provision_service \ - image=${{ inputs.image }} \ - architecture=${{ inputs.architecture }} - echo ::endgroup:: - echo ::group::info:request - cat request.json || true; echo - echo ::endgroup:: - echo ::group::info:inventory - sed -e 's/password: .*/password: "[redacted]"/' < spec/fixtures/litmus_inventory.yaml || true - echo ::endgroup:: - - # - name: Save inventory file A to an artifact - # uses: actions/upload-artifact@v3 - # with: - # name: inventory_A - # path: spec/fixtures/litmus_inventory.yaml - - name: Install PE on test cluster - timeout-minutes: 120 - run: | - bundle exec bolt plan run peadm_spec::install_test_cluster \ - --inventoryfile spec/fixtures/litmus_inventory.yaml \ - --modulepath spec/fixtures/modules \ - architecture=${{ inputs.architecture }} \ - version=${{ inputs.version }} \ - console_password=${{ secrets.CONSOLE_PASSWORD }} - - name: Start SSH session - if: github.event.inputs.ssh-debugging == 'true' - uses: luchihoratiu/debug-via-ssh@main - with: - NGROK_AUTH_TOKEN: ${{ secrets.NGROK_AUTH_TOKEN }} - SSH_PASS: ${{ secrets.SSH_PASS }} - - # - name: Download artifacts - # # if: always() - # uses: actions/download-artifact@v3 - # with: - # path: spec/fixtures/ - - name: perform PE backup of cluster A - timeout-minutes: 10 - continue-on-error: true - run: | - echo ::group::prepare - mkdir -p $HOME/.ssh - echo 'Host *' > $HOME/.ssh/config - echo ' ServerAliveInterval 150' >> $HOME/.ssh/config - echo ' ServerAliveCountMax 2' >> $HOME/.ssh/config - bundle exec rake spec_prep - echo ::endgroup:: - echo ::group::backup - bundle exec bolt plan run peadm_spec::test_backup \ - --inventoryfile spec/fixtures/litmus_inventory.yaml \ - --modulepath spec/fixtures/modules - echo ::endgroup:: - - name: Wait as long as the file ${HOME}/pause file is present - continue-on-error: true - # if: ${{ always() && github.event.inputs.ssh-debugging == 'true' }} - if: github.event.inputs.ssh-debugging == 'true' - run: | - while [ -f "${HOME}/pause" ] ; do - echo "${HOME}/pause present, sleeping for 60 seconds..." - sleep 10 - done - echo "${HOME}/pause absent, continuing workflow." - - name: Tear down cluster A - if: always() - run: | - if [ -f spec/fixtures/litmus_inventory.yaml ]; then - echo ::group::tear_down - bundle exec rake 'litmus:tear_down' - echo ::endgroup:: - echo ::group::info:request - cat request.json || true; echo - echo ::endgroup:: - fi - restore: - name: 'Restore: Cluster B: PE ${{ inputs.version }} ${{ inputs.architecture }} - on ${{ inputs.image }}' - runs-on: ubuntu-20.04 - env: - BOLT_GEM: true - BOLT_DISABLE_ANALYTICS: true - LANG: en_US.UTF-8 - steps: - - name: Checkout Source - uses: actions/checkout@v4 - - name: Activate Ruby 2.7 - uses: ruby/setup-ruby@v1 - with: - ruby-version: '2.7' - bundler-cache: true - - name: Print bundle environment - if: ${{ github.repository_owner == 'puppetlabs' }} - run: | - echo ::group::info:bundler - bundle env - echo ::endgroup:: - - name: Provision test cluster - timeout-minutes: 15 - run: | - echo ::group::prepare - mkdir -p $HOME/.ssh - echo 'Host *' > $HOME/.ssh/config - echo ' ServerAliveInterval 150' >> $HOME/.ssh/config - echo ' ServerAliveCountMax 2' >> $HOME/.ssh/config - bundle exec rake spec_prep - echo ::endgroup:: - echo ::group::provision - bundle exec bolt plan run peadm_spec::provision_test_cluster \ - --modulepath spec/fixtures/modules \ - provider=provision_service \ - image=${{ inputs.image }} \ - architecture=${{ inputs.architecture }} - echo ::endgroup:: - echo ::group::info:request - cat request.json || true; echo - echo ::endgroup:: - echo ::group::info:inventory - sed -e 's/password: .*/password: "[redacted]"/' < spec/fixtures/litmus_inventory.yaml || true - echo ::endgroup:: - - # - name: Save inventory file B to an artifact - # uses: actions/upload-artifact@v3 - # with: - # name: inventory_B - # path: spec/fixtures/litmus_inventory.yaml - - name: Install PE on test cluster - timeout-minutes: 120 - run: | - bundle exec bolt plan run peadm_spec::install_test_cluster \ - --inventoryfile spec/fixtures/litmus_inventory.yaml \ - --modulepath spec/fixtures/modules \ - architecture=${{ inputs.architecture }} \ - version=${{ inputs.version }} \ - console_password=${{ secrets.CONSOLE_PASSWORD }} - - name: Wait for backup to finish - uses: lewagon/wait-on-check-action@v1.3.4 - with: - ref: ${{ github.ref }} - check-name: 'Backup: Cluster A: PE ${{ inputs.version }} ${{ inputs.architecture }} - on ${{ inputs.image }}' - repo-token: ${{ secrets.GITHUB_TOKEN }} - wait-interval: 10 - - name: Tear down cluster B - if: always() - run: |- - cp spec/fixtures/inventory_B/litmus_inventory.yaml spec/fixtures/litmus_inventory.yaml || true - if [ -f spec/fixtures/litmus_inventory.yaml ]; then - echo ::group::tear_down - bundle exec rake 'litmus:tear_down' - echo ::endgroup:: - echo ::group::info:request - cat request.json || true; echo - echo ::endgroup:: - fi diff --git a/.github/workflows/test-backup-restore.yaml b/.github/workflows/test-backup-restore.yaml deleted file mode 100644 index 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-replace-failed-postgresql.yaml b/.github/workflows/test-migration.yaml similarity index 70% rename from .github/workflows/test-replace-failed-postgresql.yaml rename to .github/workflows/test-migration.yaml index 6ecd6978..283726af 100644 --- a/.github/workflows/test-replace-failed-postgresql.yaml +++ b/.github/workflows/test-migration.yaml @@ -1,5 +1,5 @@ --- -name: Test replace failed PostgreSQL +name: Test Migration on: pull_request: paths: @@ -25,9 +25,10 @@ on: branches: [main] workflow_dispatch: {} jobs: - test-replace-failed-postgresql: + test-migration: name: PE ${{ matrix.version }} ${{ matrix.architecture }} on ${{ matrix.image }} - runs-on: ubuntu-20.04 + PE upgrade? ${{ matrix.new_pe_version }} + runs-on: ubuntu-latest env: BOLT_GEM: true BOLT_DISABLE_ANALYTICS: true @@ -35,10 +36,21 @@ jobs: strategy: fail-fast: false matrix: - architecture: [extra-large-with-dr-and-spare-replica] - install_architecture: [extra-large-with-dr] - version: [2021.7.9, 2023.8.1, 2025.0.0] + architecture: + - standard + # - large + # - extra-large + # - standard-with-dr + # - large-with-dr + # - extra-large-with-dr + # version: [2021.7.9, 2023.8.1, 2025.0.0] + version: [2025.0.0] image: [almalinux-cloud/almalinux-8] + include: + - architecture: standard + version: 2023.8.1 + image: almalinux-cloud/almalinux-8 + new_pe_version: 2025.0.0 steps: - name: Checkout Source uses: actions/checkout@v4 @@ -70,7 +82,7 @@ jobs: --modulepath spec/fixtures/modules \ provider=provision_service \ image=${{ matrix.image }} \ - architecture=${{ matrix.architecture }} \ + architecture=${{ matrix.architecture }}-migration \ --log-level trace echo ::endgroup:: echo ::group::info:request @@ -95,11 +107,11 @@ jobs: bundle exec bolt plan run peadm_spec::install_test_cluster \ --inventoryfile spec/fixtures/litmus_inventory.yaml \ --modulepath spec/fixtures/modules \ - architecture=${{ matrix.install_architecture }} \ + architecture=${{ matrix.architecture }} \ version=${{ matrix.version }} \ console_password=${{ secrets.CONSOLE_PASSWORD }} \ code_manager_auto_configure=true - - name: Replace failed PostgreSQL + - name: Perform migration run: | echo ::group::prepare mkdir -p $HOME/.ssh @@ -108,16 +120,17 @@ jobs: echo ' ServerAliveCountMax 2' >> $HOME/.ssh/config bundle exec rake spec_prep echo ::endgroup:: - bundle exec bolt plan run peadm_spec::test_replace_failed_postgres \ + bundle exec bolt plan run peadm_spec::test_migration \ --inventoryfile spec/fixtures/litmus_inventory.yaml \ --modulepath spec/fixtures/modules \ - primary_host=$(yq '.groups[].targets[] | select(.vars.role == "primary") | .name' spec/fixtures/litmus_inventory.yaml) \ - replica_host=$(yq '.groups[].targets[] | select(.vars.role == "replica") | .name' spec/fixtures/litmus_inventory.yaml) \ - working_postgresql_host=$(yq '.groups[].targets[] | select(.vars.role == "replica-pdb-postgresql") | .name' spec/fixtures/litmus_inventory.yaml) \ - failed_postgresql_host=$(yq '.groups[].targets[] | select(.vars.role == "primary-pdb-postgresql") | .name' spec/fixtures/litmus_inventory.yaml) \ - replacement_postgresql_host=$(yq '.groups[].targets[] | select(.vars.role == "spare-replica") | .name' spec/fixtures/litmus_inventory.yaml) \ + primary_host=$(yq -r '.groups[].targets[] | select(.vars.role == "primary") | .name // ""' spec/fixtures/litmus_inventory.yaml) \ + new_primary_host=$(yq -r '.groups[].targets[] | select(.vars.role == "new-primary") | .name // ""' spec/fixtures/litmus_inventory.yaml) \ + new_replica_host=$(yq -r '.groups[].targets[] | select(.vars.role == "new-replica") | .name // ""' spec/fixtures/litmus_inventory.yaml) \ + new_primary_postgresql_host=$(yq -r '.groups[].targets[] | select(.vars.role == "new-primary-pdb-postgresql") | .name // ""' spec/fixtures/litmus_inventory.yaml) \ + new_replica_postgresql_host=$(yq -r '.groups[].targets[] | select(.vars.role == "new-replica-pdb-postgresql") | .name // ""' spec/fixtures/litmus_inventory.yaml) \ + upgrade_version=${{ matrix.new_pe_version }} \ --no-host-key-check - - name: Tear down PE XL DR test cluster + - name: Tear down PE ${{ matrix.architecture }} test cluster if: ${{ always() }} continue-on-error: true run: |- 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/functions/migration_opts_default.pp b/functions/migration_opts_default.pp index a096d9a9..99b57e55 100644 --- a/functions/migration_opts_default.pp +++ b/functions/migration_opts_default.pp @@ -7,6 +7,6 @@ function peadm::migration_opts_default () { 'config' => false, 'orchestrator' => true, 'puppetdb' => true, - 'rbac' => false, + 'rbac' => true, } } diff --git a/plans/migrate.pp b/plans/migrate.pp index c9aa7197..43469a83 100644 --- a/plans/migrate.pp +++ b/plans/migrate.pp @@ -15,13 +15,13 @@ backup_type => 'migration', }) - download_file($backup_file['path'], 'backup', $old_primary_host) + $download_results = download_file($backup_file['path'], 'backup', $old_primary_host) + $download_path = $download_results[0]['path'] $backup_filename = basename($backup_file['path']) $remote_backup_path = "/tmp/${backup_filename}" - $current_dir = system::env('PWD') - upload_file("${current_dir}/downloads/backup/${old_primary_host}/${backup_filename}", $remote_backup_path, $new_primary_host) + upload_file($download_path, $remote_backup_path, $new_primary_host) $old_primary_target = get_targets($old_primary_host)[0] $old_primary_password = peadm::get_pe_conf($old_primary_target)['console_admin_password'] diff --git a/plans/restore.pp b/plans/restore.pp index bbb8bd95..66e70610 100644 --- a/plans/restore.pp +++ b/plans/restore.pp @@ -89,7 +89,7 @@ $replica_target, $compiler_targets, ]) - + out::message("puppetdb_postgres_targets: ${puppetdb_postgresql_targets}") # Map of recovery option name to array of database hosts to restore the # relevant .dump content to. $restore_databases = { diff --git a/spec/acceptance/peadm_spec/plans/provision_test_cluster.pp b/spec/acceptance/peadm_spec/plans/provision_test_cluster.pp index 4529dc9b..e9b3451a 100644 --- a/spec/acceptance/peadm_spec/plans/provision_test_cluster.pp +++ b/spec/acceptance/peadm_spec/plans/provision_test_cluster.pp @@ -54,6 +54,24 @@ ['primary', 'primary-pdb-postgresql', 'compiler', 'replica', 'replica-pdb-postgresql', 'compiler', 'spare-replica'] } + 'standard-migration': { + ['primary', 'new-primary'] + } + 'standard-with-dr-migration': { + ['primary', 'replica', 'new-primary', 'new-replica'] + } + 'large-migration': { + ['primary', 'compiler', 'new-primary'] + } + 'large-with-dr-migration': { + ['primary', 'compiler', 'replica', 'compiler', 'new-primary', 'new-replica'] + } + 'extra-large-migration': { + ['primary', 'primary-pdb-postgresql', 'compiler', 'new-primary', 'new-primary-pdb-postgresql'] + } + 'extra-large-with-dr-migration': { + ['primary', 'primary-pdb-postgresql', 'compiler', 'replica', 'replica-pdb-postgresql', 'compiler', 'new-primary', 'new-replica', 'new-primary-pdb-postgresql', 'new-replica-pdb-postgresql'] + } default: { fail_plan("Unknown architecture: ${architecture}") } diff --git a/spec/acceptance/peadm_spec/plans/test_migration.pp b/spec/acceptance/peadm_spec/plans/test_migration.pp new file mode 100644 index 00000000..3913356e --- /dev/null +++ b/spec/acceptance/peadm_spec/plans/test_migration.pp @@ -0,0 +1,98 @@ +plan peadm_spec::test_migration( + String $primary_host, + String $new_primary_host, + Optional[String] $new_replica_host = undef, + Optional[String] $new_primary_postgresql_host = undef, + Optional[String] $new_replica_postgresql_host = undef, + Optional[String] $upgrade_version = undef, +) { + out::message("primary_host:${primary_host}.") + out::message("new_primary_host:${new_primary_host}.") + out::message("new_replica_host:${new_replica_host}.") + out::message("new_primary_postgresql_host:${new_primary_postgresql_host}.") + out::message("new_replica_postgresql_host:${new_replica_postgresql_host}.") + out::message("upgrade_version:${upgrade_version}.") + + # Convert String values to targets if they are not blank + $primary_target = $primary_host ? { '' => undef, default => peadm::get_targets($primary_host, 1) } + $new_primary_target = $new_primary_host ? { '' => undef, default => peadm::get_targets($new_primary_host, 1) } + $new_replica_target = $new_replica_host ? { '' => undef, default => peadm::get_targets($new_replica_host, 1) } + $new_primary_postgresql_target = $new_primary_postgresql_host ? { '' => undef, default => peadm::get_targets($new_primary_postgresql_host, 1) } + $new_replica_postgresql_target = $new_replica_postgresql_host ? { '' => undef, default => peadm::get_targets($new_replica_postgresql_host, 1) } + + # output the targets + out::message("primary_target:${primary_target}.") + out::message("new_primary_target:${new_primary_target}.") + out::message("new_replica_target:${new_replica_target}.") + out::message("new_primary_postgresql_target:${new_primary_postgresql_target}.") + out::message("new_replica_postgresql_target:${new_replica_postgresql_target}.") + + # run infra status on the primary + out::message("Running peadm::status on primary host ${primary_target}") + $primary_status = run_plan('peadm::status', $primary_target, { 'format' => 'json' }) + out::message($primary_status) + + if empty($primary_status['failed']) { + out::message('Cluster is healthy, continuing') + } else { + fail_plan('Cluster is not healthy, aborting') + } + + # perform the migration + run_plan('peadm::migrate', + old_primary_host => $primary_target, + new_primary_host => $new_primary_target, + ) + + # run infra status on the new primary + peadm::wait_until_service_ready('all', $new_primary_target) + out::message("Running peadm::status on new primary host ${new_primary_target}") + $new_primary_status = run_plan('peadm::status', $new_primary_target, { 'format' => 'json' }) + out::message($new_primary_status) + + if empty($new_primary_status['failed']) { + out::message('Migrated cluster is healthy, continuing') + } else { + out::message('Migrated cluster is not healthy, verify status of services') + } + + # get the config from new_primary_target and verify config looks as expected + $peadm_config = run_task('peadm::get_peadm_config', $new_primary_target, '_catch_errors' => true).first.to_data() + out::message("peadm_config: ${peadm_config}") + # if new_replica_target is supplied then check that is in the expected place in the config + if $new_replica_target { + if $peadm_config['params']['replica_host'] == $new_replica_target { + out::message("New replica host ${new_replica_target} set up correctly") + } else { + fail_plan("New replica host ${new_replica_target} was not set up correctly") + } + } + + # if new_primary_postgresql_target is supplied then check that is in the expected place in the config + if $new_primary_postgresql_target { + if $peadm_config['params']['primary_postgresql_host'] == $new_primary_postgresql_target { + out::message("New primary postgres host ${new_primary_postgresql_target} set up correctly") + } else { + fail_plan("New primary postgres host ${new_primary_postgresql_target} was not set up correctly") + } + } + + # if new_replica_postgresql_target is supplied then check that is in the expected place in the config + if $new_replica_postgresql_target { + if $peadm_config['params']['replica_postgresql_host'] == $new_replica_postgresql_target { + out::message("New primary postgres host ${new_replica_postgresql_target} set up correctly") + } else { + fail_plan("New primary postgres host ${new_replica_postgresql_target} was not set up correctly") + } + } + + # if a new PE version was specified then check it has been upgraded + out::message("upgrade_version:${upgrade_version}.") + if $upgrade_version and $upgrade_version != '' and !empty($upgrade_version) { + if $peadm_config['value']['pe_version'] == $upgrade_version { + out::message("Upgraded to new PE version ${upgrade_version} correctly") + } else { + fail_plan("Failed to upgrade to new PE version ${upgrade_version} correctly") + } + } +}