Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ubuntu 24.04 Support for BOLT #3376

Draft
wants to merge 7 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/apply.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/bolt_server.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/bolt_spec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -49,13 +49,13 @@ 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
- name: Run tests
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
2 changes: 1 addition & 1 deletion .github/workflows/docker_transport.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/linux.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ on:
jobs:
integration:
name: Integration
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
strategy:
matrix:
ruby: [3.1]
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/local_transport.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/mend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/modules.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ on:
jobs:
linux:
name: Linux
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
strategy:
matrix:
ruby: [3.1]
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/orch_transport.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release-notes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/schemas.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ssh_transport.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/unit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
8 changes: 4 additions & 4 deletions Puppetfile
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand All @@ -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'

Expand Down
14 changes: 14 additions & 0 deletions bolt-modules/boltlib/lib/puppet/functions/apply_prep.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions spec/integration/apply_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,7 @@
'plugin' => 'task',
'task' => 'puppet_agent::install',
'parameters' => {
'version' => '7.0.0'
'version' => '8.0.0'
}
}
}
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion spec/integration/cli/cli_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading