Skip to content

Commit 2f1592e

Browse files
Remove ruby deprecated module (DataDog#789)
Co-authored-by: Nicolas Schweitzer <nicolas.schweitzer@datadoghq.com>
1 parent ec48105 commit 2f1592e

6 files changed

Lines changed: 28 additions & 19 deletions

File tree

.fixtures.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ fixtures:
1212
puppetserver_gem:
1313
repo: "git://github.com/puppetlabs/puppetlabs-puppetserver_gem.git"
1414
ref: "1.0.0"
15-
ruby: "git://github.com/puppetlabs/puppetlabs-ruby.git"
1615
forge_modules:
1716
yumrepo_core:
1817
repo: "puppetlabs/yumrepo_core"

environments/etc/Puppetfile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ mod 'datadog_agent', :local => true
33
mod 'puppetlabs-apt', '2.4.0'
44
mod 'puppetlabs-concat', '4.0.0'
55
mod 'puppetlabs-puppetserver_gem', '1.0.0'
6-
mod 'puppetlabs-ruby', '1.0.0'
76
mod 'puppetlabs-stdlib', '4.25.0'
87
mod 'puppetlabs-powershell', '2.3.0'
98
mod 'puppetlabs-yumrepo_core', '1.0.3'

manifests/params.pp

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,22 @@
2626
case $::operatingsystem {
2727
'Ubuntu','Debian','Raspbian' : {
2828
$rubydev_package = 'ruby-dev'
29+
case $::operatingsystemrelease{
30+
'14.04': {
31+
# Specific ruby/rubygems package name for Ubuntu 14.04
32+
$ruby_package = 'ruby'
33+
$rubygems_package = 'ruby1.9.1-full'
34+
}
35+
'18.04': {
36+
# Specific ruby/rubygems package name for Ubuntu 18.04
37+
$ruby_package = 'ruby-full'
38+
$rubygems_package = 'rubygems'
39+
}
40+
default: {
41+
$ruby_package = 'ruby'
42+
$rubygems_package = 'rubygems'
43+
}
44+
}
2945
$legacy_conf_dir = '/etc/dd-agent/conf.d'
3046
$conf_dir = '/etc/datadog-agent/conf.d'
3147
$dd_user = 'dd-agent'
@@ -40,6 +56,8 @@
4056
}
4157
'RedHat','CentOS','Fedora','Amazon','Scientific','OracleLinux', 'AlmaLinux', 'Rocky', 'OpenSuSE', 'SLES' : {
4258
$rubydev_package = 'ruby-devel'
59+
$ruby_package = 'ruby'
60+
$rubygems_package = 'rubygems'
4361
$legacy_conf_dir = '/etc/dd-agent/conf.d'
4462
$conf_dir = '/etc/datadog-agent/conf.d'
4563
$dd_user = 'dd-agent'

manifests/reports.pp

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,15 @@
4949
}
5050

5151
if (! defined(Package['rubygems'])) {
52-
# Ensure rubygems is installed
53-
class { 'ruby':
54-
rubygems_update => false
52+
package { 'ruby':
53+
ensure => 'installed',
54+
name => $datadog_agent::params::ruby_package
55+
}
56+
57+
package { 'rubygems':
58+
ensure => 'installed',
59+
name => $datadog_agent::params::rubygems_package,
60+
require => Package['ruby']
5561
}
5662
}
5763

metadata.json

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,6 @@
1212
"name": "puppetlabs/stdlib",
1313
"version_requirement": ">=4.25.0 <9.0.0"
1414
},
15-
{
16-
"name": "puppetlabs/ruby",
17-
"version_requirement": ">=1.0.0 <2.0.0"
18-
},
1915
{
2016
"name": "puppetlabs/concat",
2117
"version_requirement": ">=4.0.0 <8.0.0"

spec/classes/datadog_agent_reports_spec.rb

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,7 @@
3131
is_expected.to raise_error(Puppet::Error)
3232
end
3333
else
34-
it { is_expected.to contain_class('ruby').with_rubygems_update(false) }
35-
it { is_expected.to contain_class('ruby::params') }
34+
3635
it { is_expected.to contain_package('ruby').with_ensure('installed') }
3736
it { is_expected.to contain_package('rubygems').with_ensure('installed') }
3837

@@ -87,8 +86,6 @@
8786
}
8887
end
8988

90-
it { is_expected.to contain_class('ruby').with_rubygems_update(false) }
91-
it { is_expected.to contain_class('ruby::params') }
9289
it { is_expected.to contain_package('ruby').with_ensure('installed') }
9390
it { is_expected.to contain_package('rubygems').with_ensure('installed') }
9491

@@ -131,8 +128,6 @@
131128
}
132129
end
133130

134-
it { is_expected.to contain_class('ruby').with_rubygems_update(false) }
135-
it { is_expected.to contain_class('ruby::params') }
136131
it { is_expected.to contain_package('ruby').with_ensure('installed') }
137132
it { is_expected.to contain_package('rubygems').with_ensure('installed') }
138133

@@ -170,8 +165,6 @@
170165
}
171166
end
172167

173-
it { is_expected.to contain_class('ruby').with_rubygems_update(false) }
174-
it { is_expected.to contain_class('ruby::params') }
175168
it { is_expected.to contain_package('ruby').with_ensure('installed') }
176169
it { is_expected.to contain_package('rubygems').with_ensure('installed') }
177170

@@ -211,8 +204,6 @@
211204
}
212205
end
213206

214-
it { is_expected.not_to contain_class('ruby').with_rubygems_update(false) }
215-
it { is_expected.not_to contain_class('ruby::params') }
216207
it { is_expected.not_to contain_package('ruby').with_ensure('installed') }
217208
it { is_expected.not_to contain_package('rubygems').with_ensure('installed') }
218209

0 commit comments

Comments
 (0)