Skip to content

Commit 68e7f57

Browse files
committed
move from pin to priority for debian
1 parent afebd4c commit 68e7f57

3 files changed

Lines changed: 16 additions & 13 deletions

File tree

manifests/params.pp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,10 @@
55
$nodejs_package_ensure = 'installed'
66
$repo_ensure = 'present'
77
$repo_pin = undef
8-
$repo_priority = fact('os.family') == 'Debian' ? '990' : 'absent'
8+
$repo_priority = $facts['os']['family'] == 'Debian' ? {
9+
true => '990',
10+
default => 'absent',
11+
}
912
$repo_proxy = 'absent'
1013
$repo_proxy_password = 'absent'
1114
$repo_proxy_username = 'absent'

spec/acceptance/class_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ def nodesource_unsupported(nodejs_version)
4242

4343
# Debian 12 contains NodeJS 18, when we test 16 and 18, we need to force the nodesource version
4444
# as Debians versions *can* be newer
45-
repo_pin =
45+
repo_priority =
4646
if fact('os.family') == 'Debian'
4747
'990'
4848
else
@@ -54,7 +54,7 @@ def nodesource_unsupported(nodejs_version)
5454
<<-PUPPET
5555
class { 'nodejs':
5656
repo_version => '#{nodejs_version}',
57-
repo_pin => #{repo_pin},
57+
repo_priority => #{repo_priority},
5858
}
5959
PUPPET
6060
end

spec/classes/nodejs_spec.rb

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -84,23 +84,23 @@
8484
end
8585
end
8686

87-
context 'and repo_pin set to 10' do
87+
context 'and repo_priority set to 10' do
8888
let :params do
89-
default_params.merge!(repo_pin: '10')
89+
default_params.merge!(repo_priority: '10')
9090
end
9191

92-
it 'the repo apt::source resource should contain pin = 10' do
93-
is_expected.to contain_apt__source('nodesource').with('pin' => '10')
92+
it 'the repo apt::source resource should contain priority = 10' do
93+
is_expected.to contain_apt__pin('nodesource').with('priority' => '10')
9494
end
9595
end
9696

97-
context 'and repo_pin not set' do
97+
context 'and repo_priority not set' do
9898
let :params do
99-
default_params.merge!(repo_pin: :undef)
99+
default_params.merge!(repo_priority: :undef)
100100
end
101101

102-
it 'the repo apt::source resource should contain pin = undef' do
103-
is_expected.to contain_apt__source('nodesource').with('pin' => nil)
102+
it 'the repo apt::source resource should contain priority = 990' do
103+
is_expected.to contain_apt__pin('nodesource').with('priority' => 990)
104104
end
105105
end
106106

@@ -109,8 +109,8 @@
109109
default_params.merge!(repo_version: '9')
110110
end
111111

112-
it 'the repo apt::source resource should contain location = https://deb.nodesource.com/node_9.x' do
113-
is_expected.to contain_apt__source('nodesource').with('location' => 'https://deb.nodesource.com/node_9.x')
112+
it 'the repo apt::source resource should contain location = [https://deb.nodesource.com/node_9.x]' do
113+
is_expected.to contain_apt__source('nodesource').with('location' => ['https://deb.nodesource.com/node_9.x'])
114114
end
115115
end
116116

0 commit comments

Comments
 (0)