Skip to content

Commit

Permalink
Remove ruby deprecated module (#789)
Browse files Browse the repository at this point in the history
Co-authored-by: Nicolas Schweitzer <nicolas.schweitzer@datadoghq.com>
  • Loading branch information
KevinFairise2 and chouetz authored Oct 23, 2023
1 parent c42d8ee commit 1ac783a
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 19 deletions.
1 change: 0 additions & 1 deletion .fixtures.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ fixtures:
puppetserver_gem:
repo: "git://github.com/puppetlabs/puppetlabs-puppetserver_gem.git"
ref: "1.0.0"
ruby: "git://github.com/puppetlabs/puppetlabs-ruby.git"
forge_modules:
yumrepo_core:
repo: "puppetlabs/yumrepo_core"
Expand Down
1 change: 0 additions & 1 deletion environments/etc/Puppetfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ mod 'datadog_agent', :local => true
mod 'puppetlabs-apt', '2.4.0'
mod 'puppetlabs-concat', '4.0.0'
mod 'puppetlabs-puppetserver_gem', '1.0.0'
mod 'puppetlabs-ruby', '1.0.0'
mod 'puppetlabs-stdlib', '4.25.0'
mod 'puppetlabs-powershell', '2.3.0'
mod 'puppetlabs-yumrepo_core', '1.0.3'
Expand Down
18 changes: 18 additions & 0 deletions manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,22 @@
case $::operatingsystem {
'Ubuntu','Debian','Raspbian' : {
$rubydev_package = 'ruby-dev'
case $::operatingsystemrelease{
'14.04': {
# Specific ruby/rubygems package name for Ubuntu 14.04
$ruby_package = 'ruby'
$rubygems_package = 'ruby1.9.1-full'
}
'18.04': {
# Specific ruby/rubygems package name for Ubuntu 18.04
$ruby_package = 'ruby-full'
$rubygems_package = 'rubygems'
}
default: {
$ruby_package = 'ruby'
$rubygems_package = 'rubygems'
}
}
$legacy_conf_dir = '/etc/dd-agent/conf.d'
$conf_dir = '/etc/datadog-agent/conf.d'
$dd_user = 'dd-agent'
Expand All @@ -40,6 +56,8 @@
}
'RedHat','CentOS','Fedora','Amazon','Scientific','OracleLinux', 'AlmaLinux', 'Rocky', 'OpenSuSE', 'SLES' : {
$rubydev_package = 'ruby-devel'
$ruby_package = 'ruby'
$rubygems_package = 'rubygems'
$legacy_conf_dir = '/etc/dd-agent/conf.d'
$conf_dir = '/etc/datadog-agent/conf.d'
$dd_user = 'dd-agent'
Expand Down
12 changes: 9 additions & 3 deletions manifests/reports.pp
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,15 @@
}

if (! defined(Package['rubygems'])) {
# Ensure rubygems is installed
class { 'ruby':
rubygems_update => false
package { 'ruby':
ensure => 'installed',
name => $datadog_agent::params::ruby_package
}

package { 'rubygems':
ensure => 'installed',
name => $datadog_agent::params::rubygems_package,
require => Package['ruby']
}
}

Expand Down
4 changes: 0 additions & 4 deletions metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,6 @@
"name": "puppetlabs/stdlib",
"version_requirement": ">=4.25.0 <9.0.0"
},
{
"name": "puppetlabs/ruby",
"version_requirement": ">=1.0.0 <2.0.0"
},
{
"name": "puppetlabs/concat",
"version_requirement": ">=4.0.0 <8.0.0"
Expand Down
11 changes: 1 addition & 10 deletions spec/classes/datadog_agent_reports_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,7 @@
is_expected.to raise_error(Puppet::Error)
end
else
it { is_expected.to contain_class('ruby').with_rubygems_update(false) }
it { is_expected.to contain_class('ruby::params') }

it { is_expected.to contain_package('ruby').with_ensure('installed') }
it { is_expected.to contain_package('rubygems').with_ensure('installed') }

Expand Down Expand Up @@ -87,8 +86,6 @@
}
end

it { is_expected.to contain_class('ruby').with_rubygems_update(false) }
it { is_expected.to contain_class('ruby::params') }
it { is_expected.to contain_package('ruby').with_ensure('installed') }
it { is_expected.to contain_package('rubygems').with_ensure('installed') }

Expand Down Expand Up @@ -131,8 +128,6 @@
}
end

it { is_expected.to contain_class('ruby').with_rubygems_update(false) }
it { is_expected.to contain_class('ruby::params') }
it { is_expected.to contain_package('ruby').with_ensure('installed') }
it { is_expected.to contain_package('rubygems').with_ensure('installed') }

Expand Down Expand Up @@ -170,8 +165,6 @@
}
end

it { is_expected.to contain_class('ruby').with_rubygems_update(false) }
it { is_expected.to contain_class('ruby::params') }
it { is_expected.to contain_package('ruby').with_ensure('installed') }
it { is_expected.to contain_package('rubygems').with_ensure('installed') }

Expand Down Expand Up @@ -211,8 +204,6 @@
}
end

it { is_expected.not_to contain_class('ruby').with_rubygems_update(false) }
it { is_expected.not_to contain_class('ruby::params') }
it { is_expected.not_to contain_package('ruby').with_ensure('installed') }
it { is_expected.not_to contain_package('rubygems').with_ensure('installed') }

Expand Down

0 comments on commit 1ac783a

Please sign in to comment.