Skip to content

Commit

Permalink
rm manage_ruby_dependency param & r10k::install::gem
Browse files Browse the repository at this point in the history
This parameter has an UNDECLARED dependency on the EOL puppetlabs/ruby
module. That module uses legacy facts and is not compatible with
puppet8.
  • Loading branch information
jhoblitt committed Sep 18, 2024
1 parent 2de90d1 commit e416c21
Show file tree
Hide file tree
Showing 10 changed files with 5 additions and 157 deletions.
1 change: 0 additions & 1 deletion .fixtures.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ fixtures:
git: https://github.com/puppetlabs/puppetlabs-git.git
inifile: https://github.com/puppetlabs/puppetlabs-inifile.git
mcollective: https://github.com/choria-io/puppet-mcollective.git
ruby: https://github.com/puppetlabs/puppetlabs-ruby.git
systemd: https://github.com/voxpupuli/puppet-systemd.git
vcsrepo: https://github.com/puppetlabs/puppetlabs-vcsrepo.git
yumrepo_core: https://github.com/puppetlabs/puppetlabs-yumrepo_core.git
Expand Down
20 changes: 1 addition & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -615,9 +615,6 @@ Deprecated: for older [configfile](https://docs.puppetlabs.com/puppet/latest/ref
##### `manage_modulepath`
Deprecated: declare a resource for managing `modulepath` in Puppet.conf

##### `manage_ruby_dependency`
When using system ruby , options on how to declare

##### `proxy`
A string setting the`r10k.yaml` configuration value of the same name

Expand All @@ -628,22 +625,7 @@ An optional string specifying location to retrieve gem
Integer defining how many threads should be spawn while updating modules. Only available for r10k >= 3.3.0.

##### `r10k_basedir`
This module requires the [puppetlabs-ruby](https://github.com/puppetlabs/puppetlabs-ruby.git) module. In the event that your environment already includes
the module with some customization, you can use the `manage_ruby_dependency`
parameter to adjust how this module expresses that requirement.
The supported values are `include`,`declare`, or `ignore`. The values' behavior
is outlined below:

* *declare* **default** This will explicitly declare the ruby module.
Additional declarations of the ruby module will result in an inability to
compile a catalog.

* *include* This will simply include the ruby module. When combined with class
ordering, this will permit the user to manage the instantiation of the ruby module elsewhere, potentially with non-standard parameter values.

* *ignore* This will assume that ruby is handled via some other mechanism than
a puppet module named `ruby`. It is left to the user to insure the
requirement be met.

##### `package_name`
The name of the package to be installed via the provider

Expand Down
33 changes: 0 additions & 33 deletions REFERENCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@

* [`r10k`](#r10k): This class configures r10k
* [`r10k::install::bundle`](#r10k--install--bundle): This class installs the r10k bundle
* [`r10k::install::gem`](#r10k--install--gem): Install the r10k gem using system ruby
* [`r10k::install::puppet_gem`](#r10k--install--puppet_gem): This class links the r10k binary for Puppet FOSS 4.2 and up
* [`r10k::mcollective`](#r10k--mcollective): Install the r10k mcollective agent
* [`r10k::mcollective::application`](#r10k--mcollective--application): Install the r10k mcollective application to a client
Expand Down Expand Up @@ -55,7 +54,6 @@ The following parameters are available in the `r10k` class:
* [`puppet_master`](#-r10k--puppet_master)
* [`modulepath`](#-r10k--modulepath)
* [`manage_modulepath`](#-r10k--manage_modulepath)
* [`manage_ruby_dependency`](#-r10k--manage_ruby_dependency)
* [`r10k_basedir`](#-r10k--r10k_basedir)
* [`package_name`](#-r10k--package_name)
* [`provider`](#-r10k--provider)
Expand Down Expand Up @@ -128,14 +126,6 @@ Data type: `Boolean`

Default value: `$r10k::params::manage_modulepath`

##### <a name="-r10k--manage_ruby_dependency"></a>`manage_ruby_dependency`

Data type: `Enum['include','declare','ignore']`



Default value: `$r10k::params::manage_ruby_dependency`

##### <a name="-r10k--r10k_basedir"></a>`r10k_basedir`

Data type: `Stdlib::Absolutepath`
Expand Down Expand Up @@ -347,29 +337,6 @@ Data type: `String[1]`

Default value: `'https://github.com/adrienthebo/r10k.git'`

### <a name="r10k--install--gem"></a>`r10k::install::gem`

Install the r10k gem using system ruby

#### Parameters

The following parameters are available in the `r10k::install::gem` class:

* [`manage_ruby_dependency`](#-r10k--install--gem--manage_ruby_dependency)
* [`version`](#-r10k--install--gem--version)

##### <a name="-r10k--install--gem--manage_ruby_dependency"></a>`manage_ruby_dependency`

Data type: `String[1]`



##### <a name="-r10k--install--gem--version"></a>`version`

Data type: `String[1]`

R10k gem version

### <a name="r10k--install--puppet_gem"></a>`r10k::install::puppet_gem`

This class links the r10k binary for Puppet FOSS 4.2 and up
Expand Down
4 changes: 1 addition & 3 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
# @param puppet_master
# @param modulepath
# @param manage_modulepath
# @param manage_ruby_dependency
# @param r10k_basedir
# @param package_name
# @param provider
Expand All @@ -23,7 +22,7 @@
# @param puppetconf_path
# @param cachedir
# Path to a directory to be used by r10k for caching data
# @param sources
# @param sources
# Hash containing data sources to be used by r10k to create dynamic Puppet environments
# @param postrun
# Array containing the parts of a system call Example: ['/usr/bin/curl', '-F', 'deploy=done', 'http://my-app.site/endpoint']
Expand All @@ -48,7 +47,6 @@
Boolean $puppet_master = $r10k::params::puppet_master,
String[1] $modulepath = $r10k::params::modulepath,
Boolean $manage_modulepath = $r10k::params::manage_modulepath,
Enum['include','declare','ignore'] $manage_ruby_dependency = $r10k::params::manage_ruby_dependency,
Stdlib::Absolutepath $r10k_basedir = $r10k::params::r10k_basedir,
String[1] $package_name = $r10k::params::package_name,
String[1] $provider = $r10k::params::provider,
Expand Down
8 changes: 1 addition & 7 deletions manifests/install.pp
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,7 @@
include r10k::install::bundle
}
'puppet_gem', 'gem', 'openbsd', 'pkgng', 'pacman', 'portage': {
if $r10k::provider == 'gem' {
class { 'r10k::install::gem':
manage_ruby_dependency => $r10k::manage_ruby_dependency,
version => $r10k::version;
}
}
elsif $r10k::provider == 'puppet_gem' {
if $r10k::provider == 'puppet_gem' {
# Puppet FOSS 4.2 and up ships a vendor provided ruby.
# Using puppet_gem uses that instead of the system ruby.
include r10k::install::puppet_gem
Expand Down
29 changes: 0 additions & 29 deletions manifests/install/gem.pp

This file was deleted.

1 change: 0 additions & 1 deletion manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
}
$version = 'installed'
$manage_modulepath = false
$manage_ruby_dependency = 'ignore'
$root_user = 'root'
$root_group = 'root'

Expand Down
11 changes: 0 additions & 11 deletions spec/classes/init_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -166,15 +166,12 @@
let :params do
{
install_options: '',
manage_ruby_dependency: 'declare',
provider: 'gem',
version: version,
puppet_master: true
}
end

it { is_expected.to contain_class('r10k::install::gem').with(version: version) }

it do
expect(subject).to contain_package('r10k').with(
ensure: version,
Expand All @@ -186,7 +183,6 @@
context 'with gem with empty install_options', if: os_facts[:os]['name'] != 'Gentoo' do
let :params do
{
manage_ruby_dependency: 'include',
provider: 'gem',
version: version,
install_options: [],
Expand All @@ -206,7 +202,6 @@
context 'with gem with populated install_options', if: os_facts[:os]['name'] != 'Gentoo' do
let :params do
{
manage_ruby_dependency: 'include',
provider: 'gem',
version: version,
install_options: ['BOGON'],
Expand All @@ -228,7 +223,6 @@
{
version: version,
provider: 'puppet_gem',
manage_ruby_dependency: 'declare',
install_options: ''
}
end
Expand All @@ -246,7 +240,6 @@
context 'with puppet_gem on Puppet FOSS' do
let :params do
{
manage_ruby_dependency: 'declare',
install_options: '',
provider: 'puppet_gem',
version: version,
Expand All @@ -272,7 +265,6 @@
context 'with defaults and source specified', if: os_facts[:os]['name'] != 'Gentoo' do
let :params do
{
manage_ruby_dependency: 'include',
provider: 'gem',
version: version,
gem_source: 'https://some.alternate.source.com/',
Expand All @@ -281,8 +273,6 @@
}
end

it { is_expected.to contain_class('r10k::install::gem') }

it do
expect(subject).to contain_package('r10k').with(
ensure: version,
Expand All @@ -297,7 +287,6 @@
{
version: version,
provider: 'bundle',
manage_ruby_dependency: 'declare',
install_options: '',
puppet_master: true
}
Expand Down
51 changes: 0 additions & 51 deletions spec/classes/install/gem_spec.rb

This file was deleted.

4 changes: 2 additions & 2 deletions spec/classes/webhook_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
end

context 'with default params' do
if %w[archlinux-rolling-x86_64 gentoo-2-x86_64].include?(os)
if %w[archlinux-rolling-x86_64 archlinux-6-x86_64 gentoo-2-x86_64].include?(os)
it { is_expected.not_to compile }
else
it { is_expected.to compile.with_all_deps }
Expand Down Expand Up @@ -89,7 +89,7 @@
generate_types: true
'
context 'with default install_method' do
if %w[archlinux-rolling-x86_64 gentoo-2-x86_64].include?(os)
if %w[archlinux-rolling-x86_64 archlinux-6-x86_64 gentoo-2-x86_64].include?(os)
it { is_expected.not_to compile }
else
it { is_expected.to compile.with_all_deps }
Expand Down

0 comments on commit e416c21

Please sign in to comment.