File tree Expand file tree Collapse file tree 6 files changed +61
-1
lines changed Expand file tree Collapse file tree 6 files changed +61
-1
lines changed Original file line number Diff line number Diff line change @@ -2,7 +2,13 @@ fixtures:
2
2
repositories :
3
3
stdlib : " git://github.com/puppetlabs/puppetlabs-stdlib.git"
4
4
archive : " git://github.com/voxpupuli/puppet-archive.git"
5
+ hashi_stack : " https://github.com/voxpupuli/puppet-hashi_stack.git"
5
6
systemd : " git://github.com/camptocamp/puppet-systemd.git"
6
7
file_capability : " git://github.com/smoeding/puppet-file_capability.git"
8
+ apt : " https://github.com/puppetlabs/puppetlabs-apt.git"
9
+ yum : " https://github.com/voxpupuli/puppet-yum.git"
10
+ yumrepo_core :
11
+ repo : " https://github.com/puppetlabs/puppetlabs-yumrepo_core.git"
12
+ puppet_version : " >= 6.0.0"
7
13
symlinks :
8
14
vault : " #{source_dir}"
Original file line number Diff line number Diff line change 50
50
# * `service_options`
51
51
# Extra argument to pass to `vault server`, as per:
52
52
# `vault server --help`
53
-
53
+ #
54
+ # * `manage_repo`
55
+ # Configure the upstream HashiCorp repository. Only relevant when $nomad::install_method = 'repo'.
56
+ #
54
57
# * `manage_service`
55
58
# Instruct puppet to manage service or not
56
59
#
88
91
$service_enable = $::vault::params::service_enable,
89
92
$service_ensure = $::vault::params::service_ensure,
90
93
$service_provider = $::vault::params::service_provider,
94
+ Boolean $manage_repo = $::vault::params::manage_repo,
91
95
$manage_service = $::vault::params::manage_service,
92
96
$manage_service_file = $::vault::params::manage_service_file,
93
97
Hash $storage = $::vault::params::storage,
Original file line number Diff line number Diff line change 25
25
}
26
26
27
27
' repo' : {
28
+ if $vault::manage_repo {
29
+ include hashi_stack::repo
30
+ }
28
31
package { $::vault::package_name :
29
32
ensure => $::vault::package_ensure ,
30
33
}
Original file line number Diff line number Diff line change 69
69
$install_method = ' repo'
70
70
$bin_dir = ' /bin'
71
71
$manage_service_file = true
72
+ $manage_repo = false
72
73
}
73
74
default: {
74
75
$install_method = ' archive'
75
76
$bin_dir = ' /usr/local/bin'
76
77
$manage_service_file = undef
78
+ $manage_repo = true
77
79
}
78
80
}
79
81
$os = downcase($facts [' kernel' ])
Original file line number Diff line number Diff line change 21
21
"name" : " puppet-archive" ,
22
22
"version_requirement" : " >= 2.0.0 < 5.0.0"
23
23
},
24
+ {
25
+ "name" : " puppet/hashi_stack" ,
26
+ "version_requirement" : " >=1.0.0 <2.0.0"
27
+ },
24
28
{
25
29
"name" : " camptocamp-systemd" ,
26
30
"version_requirement" : " >= 1.1.1 < 3.0.0"
Original file line number Diff line number Diff line change 201
201
end
202
202
end
203
203
204
+ context "When asked not to manage the repo" do
205
+ let ( :params ) { {
206
+ :manage_repo => false
207
+ } }
208
+
209
+ case facts [ :os ] [ 'family' ]
210
+ when 'Debian'
211
+ it { should_not contain_apt__source ( 'HashiCorp' ) }
212
+ when 'RedHat'
213
+ it { should_not contain_yumrepo ( 'HashiCorp' ) }
214
+ end
215
+ end
216
+
217
+ context "When asked to manage the repo but not to install using repo" do
218
+ let ( :params ) { {
219
+ :install_method => 'archive' ,
220
+ :manage_repo => true
221
+ } }
222
+
223
+ case facts [ :os ] [ 'family' ]
224
+ when 'Debian'
225
+ it { should_not contain_apt__source ( 'HashiCorp' ) }
226
+ when 'RedHat'
227
+ it { should_not contain_yumrepo ( 'HashiCorp' ) }
228
+ end
229
+ end
230
+
231
+ context "When asked to manage the repo and to install as repo" do
232
+ let ( :params ) { {
233
+ :install_method => 'repo' ,
234
+ :manage_repo => true
235
+ } }
236
+
237
+ case facts [ :os ] [ 'family' ]
238
+ when 'Debian'
239
+ it { should contain_apt__source ( 'HashiCorp' ) }
240
+ when 'RedHat'
241
+ it { should contain_yumrepo ( 'HashiCorp' ) }
242
+ end
243
+ end
244
+
204
245
context 'when installed from package repository' do
205
246
let ( :params ) do
206
247
{
You can’t perform that action at this time.
0 commit comments