-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Specified custom dependencies for r10k installation
- Loading branch information
Showing
7 changed files
with
77 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
# @summary r10k dependencies | ||
# | ||
# r10k dependencies (GEM packages with specific requirements) | ||
# | ||
# @example | ||
# include puppet::r10k::dependencies | ||
class puppet::r10k::dependencies { | ||
include puppet::agent::install | ||
|
||
if versioncmp($facts['puppetversion'], '8.0.0') >= 0 { | ||
$cri_ensure = 'installed' | ||
} | ||
elsif versioncmp($facts['puppetversion'], '7.0.0') >= 0 { | ||
$cri_ensure = 'installed' | ||
|
||
# https://www.puppet.com/docs/puppet/8/platform_lifecycle.html#about_agent-component-version-numbers | ||
# Puppet 7 provides Ruby 2.7.8 | ||
# The following GEM packages already require Ruby 3, so we need to install specific versions compatible with Puppet 7 | ||
|
||
package { 'faraday-net_http': | ||
ensure => '3.0.2', | ||
provider => 'puppet_gem', | ||
} | ||
|
||
package { 'faraday': | ||
ensure => '2.8.1', | ||
provider => 'puppet_gem', | ||
} | ||
|
||
Class['puppet::agent::install'] -> Package['faraday'] | ||
Class['puppet::agent::install'] -> Package['faraday-net_http'] | ||
} | ||
elsif versioncmp($facts['puppetversion'], '6.0.0') >= 0 { | ||
# Puppet 6 comes with Ruby >= 2.5 | ||
$cri_ensure = 'installed' | ||
} | ||
else { | ||
# Puppet 5 | ||
# cri-2.15.10 requires Ruby ~> 2.3 | ||
$cri_ensure = '2.15.10' | ||
} | ||
|
||
package { 'cri': | ||
ensure => $cri_ensure, | ||
provider => 'puppet_gem', | ||
} | ||
|
||
Class['puppet::agent::install'] -> Package['cri'] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,29 @@ | ||
# puppet::install::r10k | ||
# | ||
# R10K installation on the server | ||
# Installs R10K on the server using the `gem install` Exec resource to ensure it is actually installed. | ||
# | ||
# @summary R10K installation on the server | ||
# @summary R10K installation on the server. | ||
# | ||
# @example | ||
# include puppet::install::r10k | ||
# | ||
# @param r10k_package_name | ||
# @param gem_path | ||
# @param r10k_path | ||
# @param r10k_package_name The name of the R10K gem package. | ||
# @param gem_path The path to the Gem executable. | ||
# @param r10k_path The path where R10K executable will be installed. | ||
# | ||
class puppet::r10k::install ( | ||
String $r10k_package_name = $puppet::params::r10k_package_name, | ||
Stdlib::Absolutepath $gem_path = $puppet::params::gem_path, | ||
Stdlib::Absolutepath $r10k_path = $puppet::params::r10k_path, | ||
) inherits puppet::params { | ||
include puppet::agent::install | ||
include puppet::r10k::dependencies | ||
|
||
exec { 'r10k-installation': | ||
command => "${gem_path} install ${r10k_package_name}", | ||
creates => $r10k_path, | ||
} | ||
|
||
Class['puppet::agent::install'] -> Exec['r10k-installation'] | ||
Class['puppet::r10k::dependencies'] -> Exec['r10k-installation'] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# frozen_string_literal: true | ||
|
||
require 'spec_helper' | ||
|
||
describe 'puppet::r10k::dependencies' do | ||
let(:pre_condition) { 'include puppet' } | ||
|
||
on_supported_os.each do |os, os_facts| | ||
context "on #{os}" do | ||
let(:facts) { os_facts } | ||
|
||
it { is_expected.to compile.with_all_deps } | ||
end | ||
end | ||
end |