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

Switch to new OpenVox packages #56

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
27 changes: 7 additions & 20 deletions lib/beaker_puppet_helpers/install_utils.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
# @api private
REPOS = {
release: {
apt: 'https://apt.puppet.com',
yum: 'https://yum.puppet.com',
apt: 'https://apt.overlookinfratech.com',
yum: 'https://yum.overlookinfratech.com',
},
nightly: {
apt: 'https://nightlies.puppet.com/apt',
Expand All @@ -25,15 +25,15 @@
# @param [Beaker::Host] host
# A host to act upon.
# @param [String] collection
# The collection to install. The default (puppet) is the latest
# The collection to install. The default (openvox) is the latest
# available version.
# @param [Boolean] nightly
# Whether to install nightly or release packages
#
# @note This method only works on redhat-like and debian-like hosts. There
# are no official Puppet releases for other platforms.
#
def self.install_puppet_release_repo_on(host, collection = 'puppet', nightly: false)
def self.install_puppet_release_repo_on(host, collection = 'openvox', nightly: false)
repos = REPOS[nightly ? :nightly : :release]

variant, version, _arch = host['packaging_platform'].split('-', 3)
Expand All @@ -46,7 +46,7 @@
# package. We'll have to remember to update this block when
# we update the signing keys
if variant == 'sles' && version >= '11'
%w[puppet puppet-20250406].each do |gpg_key|
%w[overlook].each do |gpg_key|
wget_on(host, "https://yum.puppet.com/RPM-GPG-KEY-#{gpg_key}") do |filename|
host.exec(Beaker::Command.new("rpm --import '#{filename}'"))
end
Expand All @@ -56,7 +56,7 @@
url = "#{repos[:yum]}/#{collection}-release-#{variant}-#{version}.noarch.rpm"
host.install_package(url)
when 'debian', 'ubuntu'
url = "#{repos[:apt]}/#{collection}-release-#{host['platform'].codename}.deb"
url = "#{repos[:apt]}/#{collection}-release-#{variant}#{version}.deb"
wget_on(host, url) do |filename|
host.install_package(filename)
end
Expand All @@ -76,21 +76,8 @@
# @param [Boolean] prefer_aio
# Whether to prefer AIO packages or OS packages
# @return [String] The Puppet package name
def self.puppet_package_name(host, prefer_aio: true)

Check failure on line 79 in lib/beaker_puppet_helpers/install_utils.rb

View workflow job for this annotation

GitHub Actions / Rubocop

Lint/UnusedMethodArgument: Unused method argument - `host`. If it's necessary, use `_` or `_host` as an argument name to indicate that it won't be used. If it's unnecessary, remove it. You can also write as `puppet_package_name(*)` if you want the method to accept any arguments but don't care about them. (https://rubystyle.guide#underscore-unused-vars)

Check failure on line 79 in lib/beaker_puppet_helpers/install_utils.rb

View workflow job for this annotation

GitHub Actions / Rubocop

Lint/UnusedMethodArgument: Unused method argument - `prefer_aio`. You can also write as `puppet_package_name(*)` if you want the method to accept any arguments but don't care about them. (https://rubystyle.guide#underscore-unused-vars)
case host['packaging_platform'].split('-', 3).first
when 'debian'
# 12 started to ship puppet-agent with puppet as a legacy package
(prefer_aio || host['packaging_platform'].split('-', 3)[1].to_i >= 12) ? 'puppet-agent' : 'puppet'
when /el|fedora|sles|cisco_/
prefer_aio ? 'puppet-agent' : 'puppet'
when /freebsd/
'sysutils/puppet8'
when 'ubuntu'
# 23.04 started to ship puppet-agent with puppet as a legacy package
(prefer_aio || host['packaging_platform'].split('-', 3)[1].to_i >= 2304) ? 'puppet-agent' : 'puppet'
else
'puppet'
end
'openvox-agent'
end

# @param [Beaker::Host] host
Expand Down
Loading