From 6e2298ccd40e00c6e2c3599699c1543583265b68 Mon Sep 17 00:00:00 2001 From: alex501212 Date: Thu, 20 Feb 2025 14:34:49 +0000 Subject: [PATCH 1/7] update puppetlabs-puppet_agent to 4.22.0 --- Puppetfile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Puppetfile b/Puppetfile index 193db0b25..4eba42579 100644 --- a/Puppetfile +++ b/Puppetfile @@ -6,8 +6,8 @@ moduledir File.join(File.dirname(__FILE__), 'modules') # Core modules used by 'apply' mod 'puppetlabs-service', '3.0.0' -mod 'puppetlabs-puppet_agent', '4.21.0' -mod 'puppetlabs-facts', '1.6.0' +mod 'puppetlabs-puppet_agent', '4.22.0' +mod 'puppetlabs-facts', '1.7.0' # Core types and providers for Puppet 6 mod 'puppetlabs-augeas_core', '1.5.0' @@ -25,12 +25,12 @@ mod 'puppetlabs-zone_core', '1.2.0' mod 'puppetlabs-package', '3.0.1' mod 'puppetlabs-puppet_conf', '2.0.0' mod 'puppetlabs-reboot', '5.0.0' -mod 'puppetlabs-stdlib', '9.6.0' +mod 'puppetlabs-stdlib', '9.7.0' # Task helpers mod 'puppetlabs-powershell_task_helper', '0.1.0' mod 'puppetlabs-ruby_task_helper', '0.6.1' -mod 'puppetlabs-ruby_plugin_helper', '0.2.0' +mod 'puppetlabs-ruby_plugin_helper', '0.3.0' mod 'puppetlabs-python_task_helper', '0.5.0' mod 'puppetlabs-bash_task_helper', '2.1.1' From bc222287cd579858d07131e7ae298f9761fa6429 Mon Sep 17 00:00:00 2001 From: alex501212 Date: Tue, 25 Feb 2025 10:30:44 +0000 Subject: [PATCH 2/7] check puppet version and set collection before running tasks --- .../boltlib/lib/puppet/functions/apply_prep.rb | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/bolt-modules/boltlib/lib/puppet/functions/apply_prep.rb b/bolt-modules/boltlib/lib/puppet/functions/apply_prep.rb index db9c5b5de..fd47a716e 100644 --- a/bolt-modules/boltlib/lib/puppet/functions/apply_prep.rb +++ b/bolt-modules/boltlib/lib/puppet/functions/apply_prep.rb @@ -2,6 +2,7 @@ require 'bolt/logger' require 'bolt/task' +require 'puppet/version' # Installs the `puppet-agent` package on targets if needed, then collects facts, # including any custom facts found in Bolt's module path. The package is @@ -63,6 +64,19 @@ def inventory # Runs a task. This method is called by the puppet_library hook. # def run_task(targets, task, args = {}, options = {}) + # check if user specified a collection in options or args + if options['collection'] + args['collection'] = options['collection'] + elsif !args['collection'] + begin + # Set collection to Puppet major version + major_version = Puppet.version.split('.').first + args['collection'] = "puppet#{major_version}" + rescue LoadError => e + # Default to unofficial release + args['collection'] = 'puppet' + end + end executor.run_task(targets, task, args, options) end From 5af4ab52ac4462fa30b4d28ceca472a34bbd3ab6 Mon Sep 17 00:00:00 2001 From: alex501212 Date: Tue, 25 Feb 2025 12:42:30 +0000 Subject: [PATCH 3/7] update github workflows to ubuntu24 --- .github/workflows/apply.yaml | 6 +++--- .github/workflows/bolt_server.yaml | 2 +- .github/workflows/bolt_spec.yaml | 6 +++--- .github/workflows/docker_transport.yaml | 2 +- .github/workflows/docs.yaml | 2 +- .github/workflows/lint.yaml | 2 +- .github/workflows/linux.yaml | 2 +- .github/workflows/local_transport.yaml | 6 +++--- .github/workflows/mend.yml | 2 +- .github/workflows/modules.yaml | 2 +- .github/workflows/orch_transport.yaml | 2 +- .github/workflows/release-notes.yaml | 2 +- .github/workflows/schemas.yaml | 2 +- .github/workflows/ssh_transport.yaml | 2 +- .github/workflows/unit.yaml | 2 +- 15 files changed, 21 insertions(+), 21 deletions(-) diff --git a/.github/workflows/apply.yaml b/.github/workflows/apply.yaml index de149a430..64738af85 100644 --- a/.github/workflows/apply.yaml +++ b/.github/workflows/apply.yaml @@ -26,7 +26,7 @@ jobs: name: Tests strategy: matrix: - os: [ubuntu-22.04, windows-latest] + os: [ubuntu-24.04, windows-latest] ruby: [3.1] runs-on: ${{ matrix.os }} steps: @@ -48,11 +48,11 @@ jobs: - name: Install modules if: steps.modules.outputs.cache-hit != 'true' run: bundle exec r10k puppetfile install - - if: matrix.os == 'ubuntu-22.04' + - if: matrix.os == 'ubuntu-24.04' uses: ./.github/actions/sudo_setup - if: matrix.os == 'windows-latest' uses: ./.github/actions/windows_agent_setup - - if: matrix.os == 'ubuntu-22.04' + - if: matrix.os == 'ubuntu-24.04' name: Run tests run: bundle exec rake ci:apply:linux - if: matrix.os == 'windows-latest' diff --git a/.github/workflows/bolt_server.yaml b/.github/workflows/bolt_server.yaml index 5bd75d19f..e48423a80 100644 --- a/.github/workflows/bolt_server.yaml +++ b/.github/workflows/bolt_server.yaml @@ -27,7 +27,7 @@ jobs: name: Tests strategy: matrix: - os: [ubuntu-22.04, windows-latest] + os: [ubuntu-24.04, windows-latest] ruby: [3.1] runs-on: ${{ matrix.os }} steps: diff --git a/.github/workflows/bolt_spec.yaml b/.github/workflows/bolt_spec.yaml index dcfb07d95..cdbcaf4f5 100644 --- a/.github/workflows/bolt_spec.yaml +++ b/.github/workflows/bolt_spec.yaml @@ -27,7 +27,7 @@ jobs: name: Tests strategy: matrix: - os: [ubuntu-22.04, windows-latest] + os: [ubuntu-24.04, windows-latest] ruby: [3.1] runs-on: ${{ matrix.os }} steps: @@ -49,7 +49,7 @@ jobs: - name: Install modules if: steps.modules.outputs.cache-hit != 'true' run: bundle exec r10k puppetfile install - - if: matrix.os == 'ubuntu-22.04' + - if: matrix.os == 'ubuntu-24.04' uses: ./.github/actions/docker_setup - if: matrix.os == 'windows-latest' uses: ./.github/actions/windows_agentless_setup @@ -57,5 +57,5 @@ jobs: if: matrix.os == 'windows-latest' run: bundle exec rake ci:boltspec:windows - name: Run tests - if: matrix.os == 'ubuntu-22.04' + if: matrix.os == 'ubuntu-24.04' run: bundle exec rake ci:boltspec:linux diff --git a/.github/workflows/docker_transport.yaml b/.github/workflows/docker_transport.yaml index ae7089c19..318b4d5fa 100644 --- a/.github/workflows/docker_transport.yaml +++ b/.github/workflows/docker_transport.yaml @@ -17,7 +17,7 @@ on: jobs: docker_transport: name: Docker Transport - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 strategy: matrix: ruby: [3.1] diff --git a/.github/workflows/docs.yaml b/.github/workflows/docs.yaml index dc847f056..4d8a319e5 100644 --- a/.github/workflows/docs.yaml +++ b/.github/workflows/docs.yaml @@ -19,7 +19,7 @@ jobs: docs: name: Docs - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 steps: - name: Checkout repository uses: actions/checkout@v2 diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index 79171b15c..b6a94b749 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -11,7 +11,7 @@ jobs: rubocop: name: Rubocop - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 steps: - name: Checkout repository uses: actions/checkout@v2 diff --git a/.github/workflows/linux.yaml b/.github/workflows/linux.yaml index c797ff0ed..4c55fdcec 100644 --- a/.github/workflows/linux.yaml +++ b/.github/workflows/linux.yaml @@ -17,7 +17,7 @@ on: jobs: integration: name: Integration - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 strategy: matrix: ruby: [3.1] diff --git a/.github/workflows/local_transport.yaml b/.github/workflows/local_transport.yaml index 36b7a3ce6..001b212cb 100644 --- a/.github/workflows/local_transport.yaml +++ b/.github/workflows/local_transport.yaml @@ -26,7 +26,7 @@ jobs: name: Tests strategy: matrix: - os: [ubuntu-22.04, windows-latest] + os: [ubuntu-24.04, windows-latest] ruby: [3.1] runs-on: ${{ matrix.os }} steps: @@ -48,11 +48,11 @@ jobs: - name: Install modules if: steps.modules.outputs.cache-hit != 'true' run: bundle exec r10k puppetfile install - - if: matrix.os == 'ubuntu-22.04' + - if: matrix.os == 'ubuntu-24.04' uses: ./.github/actions/sudo_setup - if: matrix.os == 'windows-latest' uses: ./.github/actions/windows_agent_setup - - if: matrix.os == 'ubuntu-22.04' + - if: matrix.os == 'ubuntu-24.04' name: Run tests run: bundle exec rake ci:local_transport:linux - if: matrix.os == 'windows-latest' diff --git a/.github/workflows/mend.yml b/.github/workflows/mend.yml index 75be416d8..7596ceae6 100644 --- a/.github/workflows/mend.yml +++ b/.github/workflows/mend.yml @@ -7,7 +7,7 @@ on: jobs: scan: name: Mend Scanning - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 steps: - name: checkout repo content uses: actions/checkout@v3 diff --git a/.github/workflows/modules.yaml b/.github/workflows/modules.yaml index 497971568..2a8d722b6 100644 --- a/.github/workflows/modules.yaml +++ b/.github/workflows/modules.yaml @@ -17,7 +17,7 @@ on: jobs: linux: name: Linux - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 strategy: matrix: ruby: [3.1] diff --git a/.github/workflows/orch_transport.yaml b/.github/workflows/orch_transport.yaml index 21ba10e95..816fa0f0f 100644 --- a/.github/workflows/orch_transport.yaml +++ b/.github/workflows/orch_transport.yaml @@ -26,7 +26,7 @@ jobs: name: Tests strategy: matrix: - os: [ubuntu-22.04, windows-latest] + os: [ubuntu-24.04, windows-latest] ruby: [3.1] runs-on: ${{ matrix.os }} steps: diff --git a/.github/workflows/release-notes.yaml b/.github/workflows/release-notes.yaml index fccd9b34c..fbad3fb1a 100644 --- a/.github/workflows/release-notes.yaml +++ b/.github/workflows/release-notes.yaml @@ -13,7 +13,7 @@ jobs: release-notes: name: Release Notes - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 steps: - name: Checkout repository uses: actions/checkout@v2 diff --git a/.github/workflows/schemas.yaml b/.github/workflows/schemas.yaml index 8a678ba18..68939fd67 100644 --- a/.github/workflows/schemas.yaml +++ b/.github/workflows/schemas.yaml @@ -14,7 +14,7 @@ jobs: generate: name: Generate - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 steps: - name: Checkout repository uses: actions/checkout@v2 diff --git a/.github/workflows/ssh_transport.yaml b/.github/workflows/ssh_transport.yaml index 556009be5..3fbebd39f 100644 --- a/.github/workflows/ssh_transport.yaml +++ b/.github/workflows/ssh_transport.yaml @@ -17,7 +17,7 @@ on: jobs: ssh_transport: name: SSH Transport - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 strategy: matrix: ruby: [3.1] diff --git a/.github/workflows/unit.yaml b/.github/workflows/unit.yaml index b1bcfc81d..12334cf26 100644 --- a/.github/workflows/unit.yaml +++ b/.github/workflows/unit.yaml @@ -23,7 +23,7 @@ jobs: name: Unit strategy: matrix: - os: [ubuntu-22.04, windows-latest] + os: [ubuntu-24.04, windows-latest] ruby: [3.1] runs-on: ${{ matrix.os }} steps: From 80711fbb1ddec3b7594374d47a19ec591c54d1a4 Mon Sep 17 00:00:00 2001 From: alex501212 Date: Tue, 25 Feb 2025 15:22:37 +0000 Subject: [PATCH 4/7] expect puppet8 in apply_spec --- spec/integration/apply_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/integration/apply_spec.rb b/spec/integration/apply_spec.rb index 04a30c4f9..4858a01da 100644 --- a/spec/integration/apply_spec.rb +++ b/spec/integration/apply_spec.rb @@ -418,7 +418,7 @@ result = results['items'] expect(result.count).to eq(1) expect(result[0]).to include('status' => 'success') - expect(result[0]['value']['version']).to match(/^7\.0/) + expect(result[0]['value']['version']).to match(/^8\.0/) end end end From c480227ec4ba133edd99c886ab6e61945bbe318a Mon Sep 17 00:00:00 2001 From: alex501212 Date: Tue, 25 Feb 2025 15:49:01 +0000 Subject: [PATCH 5/7] update apply_space install puppet test --- spec/integration/apply_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/integration/apply_spec.rb b/spec/integration/apply_spec.rb index 4858a01da..e067aa710 100644 --- a/spec/integration/apply_spec.rb +++ b/spec/integration/apply_spec.rb @@ -394,7 +394,7 @@ 'plugin' => 'task', 'task' => 'puppet_agent::install', 'parameters' => { - 'version' => '7.0.0' + 'version' => '8.0.0' } } } From afabaa9bcffcf1f947b9b4d1dad419c8fdae8737 Mon Sep 17 00:00:00 2001 From: alex501212 Date: Tue, 25 Feb 2025 16:17:03 +0000 Subject: [PATCH 6/7] unexpected token is replaced by expected object key warning --- spec/integration/cli/cli_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/integration/cli/cli_spec.rb b/spec/integration/cli/cli_spec.rb index 03de8ecaf..44f9ca3e7 100644 --- a/spec/integration/cli/cli_spec.rb +++ b/spec/integration/cli/cli_spec.rb @@ -429,7 +429,7 @@ ['sample::params', 'Task with parameters'] ) - expect(@log_output.readlines).to include(/unexpected token/) + expect(@log_output.readlines).to include(/expected object key/) end end end From 5cb3a2d3e8eb49f5b549f064b0d4b54d6c1ff444 Mon Sep 17 00:00:00 2001 From: alex501212 Date: Tue, 25 Feb 2025 16:45:30 +0000 Subject: [PATCH 7/7] !feature * **Added Ubuntu24 Support** Added support for Ubuntu-24.04-x64