Skip to content

Commit 2faa636

Browse files
author
jordanbreen28
committed
feat: allow specification of puppet version
1 parent 44e8050 commit 2faa636

File tree

2 files changed

+14
-5
lines changed

2 files changed

+14
-5
lines changed

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,15 @@ Install Litmus as a gem by running `gem install puppet_litmus`.
2929

3030
- Note if you choose to override the `litmus_inventory.yaml` location, please ensure that the directory structure you define exists.
3131

32+
## Install a specific puppet agent version
33+
34+
To install a specific version of the puppet agent, you can export the `PUPPET_VERSION` env var, like below:
35+
```
36+
export PUPPET_VERSION=8.8.1
37+
```
38+
39+
When set, the `litmus:install_agent` rake task will install the specified version. The default is `latest`.
40+
3241
## matrix_from_metadata_v3
3342

3443
matrix_from_metadata_v3 tool generates a github action matrix from the supported operating systems listed in the module's metadata.json.

lib/puppet_litmus/rake_helper.rb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -129,11 +129,11 @@ def tear_down(node_name, inventory_hash)
129129

130130
def install_agent(collection, targets, inventory_hash)
131131
include ::BoltSpec::Run
132-
params = if collection.nil?
133-
{}
134-
else
135-
{ 'collection' => collection }
136-
end
132+
puppet_version = ENV.fetch('PUPPET_VERSION', nil)
133+
params = {}
134+
params['collection'] = collection if collection
135+
params['version'] = puppet_version if puppet_version
136+
137137
raise "puppet_agent was not found in #{DEFAULT_CONFIG_DATA['modulepath']}, please amend the .fixtures.yml file" \
138138
unless File.directory?(File.join(DEFAULT_CONFIG_DATA['modulepath'], 'puppet_agent'))
139139

0 commit comments

Comments
 (0)