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

Add env var for puppet package name #71

Merged
merged 1 commit into from
Oct 24, 2023
Merged
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
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ Other common environment variables:
* `BEAKER_PROVISION` can be set to `no` to reuse a box. Note that the box must exist already. See `BEAKER_DESTROY`
* `BEAKER_SETFILE` is used to point to a setfile containing definitions. To avoid storing large YAML files in all repositories, [beaker-hostgenerator](https://github.com/voxpupuli/beaker-hostgenerator) is used to generate them on the fly when the file is not present.
* `BEAKER_PUPPET_COLLECTION` defines the puppet collection that will be configured, defaults to `puppet`. When set to `none`, no repository will be configured and distro package naming is assumed. When set to `preinstalled`, it assumes the OS is already set up with a collection but it still ensures `puppet-agent` is installed.
* `BEAKER_PUPPET_PACKAGE_NAME` optional env var to set the puppet agent package name. If not set, the package name will be determined using [puppet_metadata](https://github.com/voxpupuli/puppet_metadata#puppet_metadata).

Since it's still plain [RSpec](https://rspec.info/), it is also possible to call an individual test file:

Expand Down
2 changes: 1 addition & 1 deletion lib/voxpupuli/acceptance/spec_helper_acceptance.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def configure_beaker(modules: :metadata, &block)
unless %w[none preinstalled].include?(collection)
BeakerPuppetHelpers::InstallUtils.install_puppet_release_repo_on(host, collection)
end
package_name = BeakerPuppetHelpers::InstallUtils.puppet_package_name(host, prefer_aio: collection != 'none')
package_name = ENV.fetch('BEAKER_PUPPET_PACKAGE_NAME', BeakerPuppetHelpers::InstallUtils.puppet_package_name(host, prefer_aio: collection != 'none'))
host.install_package(package_name)

# by default, puppet-agent creates /etc/profile.d/puppet-agent.sh which adds /opt/puppetlabs/bin to PATH
Expand Down
Loading