File tree 3 files changed +71
-4
lines changed
3 files changed +71
-4
lines changed Original file line number Diff line number Diff line change 10
10
$pkg_file = ' /tmp/webhook-go.rpm'
11
11
$package_url = " https://github.com/voxpupuli/webhook-go/releases/download/v${r10k::webhook::version} /webhook-go_${r10k::webhook::version} _linux_amd64.rpm"
12
12
}
13
- ' Debian' , ' Ubuntu ' : {
13
+ ' Debian' : {
14
14
$provider = ' dpkg'
15
15
$pkg_file = ' /tmp/webhook-go.deb'
16
16
$package_url = " https://github.com/voxpupuli/webhook-go/releases/download/v${r10k::webhook::version} /webhook-go_${r10k::webhook::version} _linux_amd64.deb"
33
33
}
34
34
}
35
35
' repo' : {
36
- warning (' webhook-go: configuring a repo is not implemented yet' )
36
+ case $facts [' os' ][' family' ] {
37
+ ' RedHat' : {
38
+ yumrepo { 'voxpupuli-webhook-go' :
39
+ descr => ' A certifiably-awesome open-source package repository curated by Vox Pupuli, hosted by Cloudsmith.' ,
40
+ baseurl => " https://dl.cloudsmith.io/public/voxpupuli/webhook-go/rpm/${facts['os']['name']}/\$ releasever/\$ basearch" ,
41
+ gpgcheck => 1,
42
+ repo_gpgcheck => 1,
43
+ enabled => true ,
44
+ gpgkey => ' https://dl.cloudsmith.io/public/voxpupuli/webhook-go/gpg.FD229D5D47E6F534.key' ,
45
+ }
46
+ }
47
+ ' Debian' : {
48
+ include apt
49
+ apt::source { 'voxpupuli-webhook-go' :
50
+ comment => ' A certifiably-awesome open-source package repository curated by Vox Pupuli, hosted by Cloudsmith.' ,
51
+ location => " https://dl.cloudsmith.io/public/voxpupuli/webhook-go/deb/${facts['os']['name']}" ,
52
+ repos => ' main' ,
53
+ key => {
54
+ ' id' => ' FD229D5D47E6F534' ,
55
+ ' source' => ' https://dl.cloudsmith.io/public/voxpupuli/webhook-go/gpg.FD229D5D47E6F534.key' ,
56
+ },
57
+ }
58
+ }
59
+ default: {
60
+ fail(" Operating system ${facts['os']['name']} not supported for packages" )
61
+ }
62
+ }
63
+ package { 'webhook-go' :
64
+ ensure => ' installed' ,
65
+ }
37
66
}
38
67
# none = people configure a repo on their own
39
68
' none' : {
Original file line number Diff line number Diff line change @@ -35,4 +35,38 @@ class { 'r10k': }
35
35
its ( :stdout ) { is_expected . to match ( %r{webhook-go} ) }
36
36
end
37
37
end
38
+
39
+ context 'with external repo' do
40
+ it_behaves_like 'an idempotent resource' do
41
+ let ( :manifest ) do
42
+ <<-PUPPET
43
+ class { 'r10k': }
44
+ -> class { 'r10k::webhook':
45
+ install_method => 'repo',
46
+ }
47
+ PUPPET
48
+ end
49
+ end
50
+ describe package ( 'webhook-go' ) do
51
+ it { is_expected . to be_installed }
52
+ end
53
+
54
+ describe file ( '/etc/voxpupuli/webhook.yml' ) do
55
+ it 'exists and has content' do
56
+ expect ( subject ) . to exist
57
+ expect ( subject ) . to be_owned_by 'root'
58
+ expect ( subject ) . to be_grouped_into 'root'
59
+ expect ( subject ) . to contain "---\n server:\n protected: true\n user: puppet\n password: puppet\n "
60
+ end
61
+ end
62
+
63
+ describe service ( 'webhook-go' ) do
64
+ it { is_expected . to be_enabled }
65
+ it { is_expected . to be_running }
66
+ end
67
+
68
+ describe command ( 'systemctl cat webhook-go' ) do
69
+ its ( :stdout ) { is_expected . to match ( %r{webhook-go} ) }
70
+ end
71
+ end
38
72
end
Original file line number Diff line number Diff line change 5
5
6
6
require 'voxpupuli/acceptance/spec_helper_acceptance'
7
7
8
- configure_beaker ( modules : :metadata )
9
-
8
+ configure_beaker do |host |
9
+ case fact ( 'os.family' )
10
+ when 'Debian'
11
+ install_puppet_module_via_pmt_on ( host , 'puppetlabs-apt' )
12
+ end
13
+ end
10
14
Dir [ './spec/support/acceptance/**/*.rb' ] . sort . each { |f | require f }
You can’t perform that action at this time.
0 commit comments