beaker 2.5.0 → 2.5.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/HISTORY.md +258 -2
- data/beaker.gemspec +2 -1
- data/lib/beaker/answers/version20.rb +0 -1
- data/lib/beaker/answers/version28.rb +0 -1
- data/lib/beaker/answers/version34.rb +1 -1
- data/lib/beaker/command.rb +1 -1
- data/lib/beaker/dsl/helpers.rb +48 -20
- data/lib/beaker/dsl/install_utils.rb +110 -8
- data/lib/beaker/dsl/wrappers.rb +10 -2
- data/lib/beaker/host.rb +133 -18
- data/lib/beaker/host/pswindows.rb +23 -49
- data/lib/beaker/host/pswindows/file.rb +11 -2
- data/lib/beaker/host/pswindows/pkg.rb +12 -6
- data/lib/beaker/host/unix.rb +18 -14
- data/lib/beaker/host/windows.rb +18 -1
- data/lib/beaker/host/windows/file.rb +5 -0
- data/lib/beaker/host_prebuilt_steps.rb +41 -19
- data/lib/beaker/hypervisor.rb +3 -1
- data/lib/beaker/hypervisor/docker.rb +12 -4
- data/lib/beaker/hypervisor/openstack.rb +28 -5
- data/lib/beaker/options/presets.rb +1 -0
- data/lib/beaker/version.rb +1 -1
- data/spec/beaker/dsl/helpers_spec.rb +69 -22
- data/spec/beaker/dsl/install_utils_spec.rb +82 -4
- data/spec/beaker/dsl/wrappers_spec.rb +2 -2
- data/spec/beaker/host_spec.rb +30 -2
- metadata +18 -4
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
NTAxNmJlODdhMDI1ODUxMTExMDEzZDQ5ODllMjliZDdmZDVlODU4NQ==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
YjU0MTg3ZTI3ZmFiMGNlYTdjOTFjZmJhYTUzOWI0NDkzODk0OTAzOA==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
YjU5NTJkOTRlYTg5NGRjMjgzMDU3N2RkNzUxMDM1YmY5MjFlNDBjNDc3ZjM4
|
10
|
+
NWVkMTg2ZmU2ZmUzZTU3MGU4ZDU5YjhjYjRjNmQzOGVlNzMxYTdkODBhMDFj
|
11
|
+
YTY3OTEyNzdiZjM5MjEwMWU5M2RmOWFkZGUzMGFiMDA4YzFjMjA=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
MWY1N2ZmYzBiNGFlMjQyOTdlOTUyMTIwOTU3NDE4NTMxNWI1ZTJkMTEwOWVm
|
14
|
+
MjllNzM3ODUxMDUyMWZkMzAwYWM2OTFmNTgzZjI4NThmOGM4YTI5NDBmOGMw
|
15
|
+
ODNhY2M4ZGM3ZDEwNTBhZmZmNzBlOWMyYmE5MWM1MWYwY2MwZDY=
|
data/HISTORY.md
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
# default - History
|
2
2
|
## Tags
|
3
|
-
* [LATEST -
|
3
|
+
* [LATEST - 4 Mar, 2015 (958ab02d)](#LATEST)
|
4
|
+
* [beaker2.5.0 - 23 Feb, 2015 (c421cf95)](#beaker2.5.0)
|
4
5
|
* [beaker2.4.1 - 13 Feb, 2015 (84400ed1)](#beaker2.4.1)
|
5
6
|
* [beaker2.4.0 - 13 Feb, 2015 (bc5a6676)](#beaker2.4.0)
|
6
7
|
* [beaker2.3.0 - 29 Jan, 2015 (3d185da0)](#beaker2.3.0)
|
@@ -71,7 +72,262 @@
|
|
71
72
|
* [pe1.2 - 6 Sep, 2011 (ba3dadd2)](#pe1.2)
|
72
73
|
|
73
74
|
## Details
|
74
|
-
### <a name = "LATEST">LATEST -
|
75
|
+
### <a name = "LATEST">LATEST - 4 Mar, 2015 (958ab02d)
|
76
|
+
|
77
|
+
* (GEM) update beaker version to 2.5.1 (958ab02d)
|
78
|
+
|
79
|
+
* Merge pull request #719 from kevpl/qeng1841_aio_pathsupdate (c6a15c8f)
|
80
|
+
|
81
|
+
|
82
|
+
```
|
83
|
+
Merge pull request #719 from kevpl/qeng1841_aio_pathsupdate
|
84
|
+
|
85
|
+
(QENG-1841) updated AIO pathing for linux & windows
|
86
|
+
```
|
87
|
+
* Merge pull request #726 from anodelman/maint (a23acbf2)
|
88
|
+
|
89
|
+
|
90
|
+
```
|
91
|
+
Merge pull request #726 from anodelman/maint
|
92
|
+
|
93
|
+
(maint) Upgrade google-api-client dependency to fix Ruby 1.9.x...
|
94
|
+
```
|
95
|
+
* (maint) Upgrade google-api-client dependency to fix Ruby 1.9.x... (d5301654)
|
96
|
+
|
97
|
+
|
98
|
+
```
|
99
|
+
(maint) Upgrade google-api-client dependency to fix Ruby 1.9.x...
|
100
|
+
|
101
|
+
- compatibility
|
102
|
+
|
103
|
+
- for puppetdb project:
|
104
|
+
|
105
|
+
"
|
106
|
+
Retriable was upgraded today (Jan 30th) and they shipped a version 2.0.0
|
107
|
+
that
|
108
|
+
requires Ruby >=2.0.0.
|
109
|
+
|
110
|
+
In google-api-client 0.7.1, we were pulling in version >= 1.4 of
|
111
|
+
retriable. In 0.8.2
|
112
|
+
they have a fix that pulls in ~> 1.4 version of retriable, thus pinning
|
113
|
+
the ceiling
|
114
|
+
on the upgrade to retriable 2.0.0.
|
115
|
+
"
|
116
|
+
```
|
117
|
+
* Merge pull request #626 from carlossg/ssh-restart (31bc7aa4)
|
118
|
+
|
119
|
+
|
120
|
+
```
|
121
|
+
Merge pull request #626 from carlossg/ssh-restart
|
122
|
+
|
123
|
+
[docker] No need to restart sshd
|
124
|
+
```
|
125
|
+
* Merge pull request #721 from kevpl/qeng1913_aio_pullback (69130a54)
|
126
|
+
|
127
|
+
|
128
|
+
```
|
129
|
+
Merge pull request #721 from kevpl/qeng1913_aio_pullback
|
130
|
+
|
131
|
+
(QENG-1913) rolling back the name change for pe-puppet that was made for AIO
|
132
|
+
```
|
133
|
+
* Merge pull request #722 from puppetlabs/revert-715-acceptance (fdf906b8)
|
134
|
+
|
135
|
+
|
136
|
+
```
|
137
|
+
Merge pull request #722 from puppetlabs/revert-715-acceptance
|
138
|
+
|
139
|
+
Revert "(QENG-1869) create beaker host.rb acceptance tests"
|
140
|
+
```
|
141
|
+
* Revert "(QENG-1869) create beaker host.rb acceptance tests" (d7e2c7c3)
|
142
|
+
|
143
|
+
* (QENG-1913) rolling back the name change for pe-puppet that was made for AIO (d68fe7d7)
|
144
|
+
|
145
|
+
* Merge pull request #716 from anodelman/maint (6e420185)
|
146
|
+
|
147
|
+
|
148
|
+
```
|
149
|
+
Merge pull request #716 from anodelman/maint
|
150
|
+
|
151
|
+
(QENG-1681) upgrade_pe method is generating errors when attempted...
|
152
|
+
```
|
153
|
+
* (QENG-1841) updated AIO pathing for linux & windows (fdfa69be)
|
154
|
+
|
155
|
+
* Merge pull request #715 from anodelman/acceptance (c6c377c8)
|
156
|
+
|
157
|
+
|
158
|
+
```
|
159
|
+
Merge pull request #715 from anodelman/acceptance
|
160
|
+
|
161
|
+
(QENG-1869) create beaker host.rb acceptance tests
|
162
|
+
```
|
163
|
+
* Merge pull request #714 from kevpl/qeng1721_aio_windowsinstall (14f2239d)
|
164
|
+
|
165
|
+
|
166
|
+
```
|
167
|
+
Merge pull request #714 from kevpl/qeng1721_aio_windowsinstall
|
168
|
+
|
169
|
+
(QENG-1721) added installation support of dev versions of windows puppet...
|
170
|
+
```
|
171
|
+
* (QENG-1681) upgrade_pe method is generating errors when attempted... (ae0d7333)
|
172
|
+
|
173
|
+
|
174
|
+
```
|
175
|
+
(QENG-1681) upgrade_pe method is generating errors when attempted...
|
176
|
+
|
177
|
+
...on PE 3.7.0 and later
|
178
|
+
|
179
|
+
- do pe version comparison in the upgrader method, not the answer file
|
180
|
+
generator
|
181
|
+
- use proper semvar dot comparison of versions, not just string compare
|
182
|
+
- handle not knowing what the pe_ver is currently installed
|
183
|
+
- unrelated nit: remove duplicate key entries in answer file generation
|
184
|
+
```
|
185
|
+
* Merge pull request #647 from mcanevet/feature/openstack/generate_key_pair (32e123e9)
|
186
|
+
|
187
|
+
|
188
|
+
```
|
189
|
+
Merge pull request #647 from mcanevet/feature/openstack/generate_key_pair
|
190
|
+
|
191
|
+
(gh-646) Create random keypair
|
192
|
+
```
|
193
|
+
* Merge pull request #699 from kevpl/qeng1429_should_fail_not_error (b757a552)
|
194
|
+
|
195
|
+
|
196
|
+
```
|
197
|
+
Merge pull request #699 from kevpl/qeng1429_should_fail_not_error
|
198
|
+
|
199
|
+
(QENG-1429) added clause to catch Beaker & Minitest assertions
|
200
|
+
```
|
201
|
+
* Merge pull request #708 from kevpl/qeng1847_aio_hostparams (a321d264)
|
202
|
+
|
203
|
+
|
204
|
+
```
|
205
|
+
Merge pull request #708 from kevpl/qeng1847_aio_hostparams
|
206
|
+
|
207
|
+
(QENG-1847) changed internal host path attribute usage to host.puppet me...
|
208
|
+
```
|
209
|
+
* Merge pull request #686 from mcanevet/fix/openstack/use_openstack_tenant (0aa7d5e6)
|
210
|
+
|
211
|
+
|
212
|
+
```
|
213
|
+
Merge pull request #686 from mcanevet/fix/openstack/use_openstack_tenant
|
214
|
+
|
215
|
+
(gh-685) Add openstack_tenant to network_client init
|
216
|
+
```
|
217
|
+
* Merge pull request #697 from anodelman/cygwin-less (ebda7a6d)
|
218
|
+
|
219
|
+
|
220
|
+
```
|
221
|
+
Merge pull request #697 from anodelman/cygwin-less
|
222
|
+
|
223
|
+
(QENG-1735) set up local windows vm without cygwin and get it working
|
224
|
+
```
|
225
|
+
* (QENG-1721) added installation support of dev versions of windows puppet-agent (45f92543)
|
226
|
+
|
227
|
+
* Merge pull request #670 from petems/MAINT-ps_windows_reindent (1f3034c5)
|
228
|
+
|
229
|
+
|
230
|
+
```
|
231
|
+
Merge pull request #670 from petems/MAINT-ps_windows_reindent
|
232
|
+
|
233
|
+
(MAINT) Fix indentation
|
234
|
+
```
|
235
|
+
* Merge pull request #711 from jonnytpuppet/rsync_support (27672383)
|
236
|
+
|
237
|
+
|
238
|
+
```
|
239
|
+
Merge pull request #711 from jonnytpuppet/rsync_support
|
240
|
+
|
241
|
+
Added support for rsync
|
242
|
+
```
|
243
|
+
* Merge pull request #713 from anodelman/maint (539f176d)
|
244
|
+
|
245
|
+
|
246
|
+
```
|
247
|
+
Merge pull request #713 from anodelman/maint
|
248
|
+
|
249
|
+
(MAINT) fix broken spec tests
|
250
|
+
```
|
251
|
+
* (MAINT) fix broken spec tests (76e06a75)
|
252
|
+
|
253
|
+
|
254
|
+
```
|
255
|
+
(MAINT) fix broken spec tests
|
256
|
+
|
257
|
+
- accidental breakage of spec tests
|
258
|
+
- also removed deprecated rspec method call
|
259
|
+
```
|
260
|
+
* Merge pull request #634 from liamjbennett/puppet_conf (baeee93d)
|
261
|
+
|
262
|
+
|
263
|
+
```
|
264
|
+
Merge pull request #634 from liamjbennett/puppet_conf
|
265
|
+
|
266
|
+
(gh-474) Adding a utility method for puppet.conf file
|
267
|
+
```
|
268
|
+
* Merge pull request #689 from liamjbennett/powershell_fix (854d0aa0)
|
269
|
+
|
270
|
+
|
271
|
+
```
|
272
|
+
Merge pull request #689 from liamjbennett/powershell_fix
|
273
|
+
|
274
|
+
(gh-688) Fixing the powershell wrapper to use an array of arguments
|
275
|
+
```
|
276
|
+
* QENG-1878 Added support for rsync (d2076dec)
|
277
|
+
|
278
|
+
* (QENG-1869) create beaker host.rb acceptance tests (e4c0fcf9)
|
279
|
+
|
280
|
+
|
281
|
+
```
|
282
|
+
(QENG-1869) create beaker host.rb acceptance tests
|
283
|
+
|
284
|
+
- tests that exercise basic host.rb functionality
|
285
|
+
```
|
286
|
+
* (QENG-1847) changed internal host path attribute usage to host.puppet method calls where possible (0179294e)
|
287
|
+
|
288
|
+
* (QENG-1380) design beaker DSL based acceptance tests (8341e56d)
|
289
|
+
|
290
|
+
|
291
|
+
```
|
292
|
+
(QENG-1380) design beaker DSL based acceptance tests
|
293
|
+
|
294
|
+
- initial directory hierarchy for beaker acceptance testing
|
295
|
+
```
|
296
|
+
* (QENG-1429) added clause to catch Beaker & Minitest assertions (d91692dd)
|
297
|
+
|
298
|
+
* (gh-688) Fixing the powershell wrapper to use an array of arguments (b5ebc137)
|
299
|
+
|
300
|
+
* (gh-685) Add openstack_tenant to network_client init (58c6eca1)
|
301
|
+
|
302
|
+
* (MAINT) Fix indentation (62c23595)
|
303
|
+
|
304
|
+
* (QENG-1735) set up local windows vm without cygwin and get it working (9c32cac7)
|
305
|
+
|
306
|
+
|
307
|
+
```
|
308
|
+
(QENG-1735) set up local windows vm without cygwin and get it working
|
309
|
+
|
310
|
+
- ensure that you can install PE
|
311
|
+
- deal with setting PATH/RUBY env vars
|
312
|
+
- update DSL methods to work on windows without bash
|
313
|
+
```
|
314
|
+
* (gh-646) Create random keypair (7b660047)
|
315
|
+
|
316
|
+
* (gh-474) Adding a utility method for puppet.conf file (8965fec0)
|
317
|
+
|
318
|
+
* (gh-626) [docker] Ensure that the ssh server can be restarted and container keeps running (85123f12)
|
319
|
+
|
320
|
+
|
321
|
+
```
|
322
|
+
(gh-626) [docker] Ensure that the ssh server can be restarted and container keeps running
|
323
|
+
|
324
|
+
If the sshd process dies then the container stops
|
325
|
+
Allow configuring the execution or not of set_env
|
326
|
+
Fix #611
|
327
|
+
```
|
328
|
+
### <a name = "beaker2.5.0">beaker2.5.0 - 23 Feb, 2015 (c421cf95)
|
329
|
+
|
330
|
+
* (HISTORY) update beaker history for gem release 2.5.0 (c421cf95)
|
75
331
|
|
76
332
|
* (GEM) update beaker version to 2.5.0 (9ad8bd4c)
|
77
333
|
|
data/beaker.gemspec
CHANGED
@@ -38,11 +38,12 @@ Gem::Specification.new do |s|
|
|
38
38
|
s.add_runtime_dependency 'net-ssh', '~> 2.9'
|
39
39
|
s.add_runtime_dependency 'net-scp', '~> 1.2'
|
40
40
|
s.add_runtime_dependency 'inifile', '~> 2.0'
|
41
|
+
s.add_runtime_dependency 'rsync', '~> 1.0.9'
|
41
42
|
|
42
43
|
# Optional provisioner specific support
|
43
44
|
s.add_runtime_dependency 'rbvmomi', '~> 1.8'
|
44
45
|
s.add_runtime_dependency 'fission', '~> 0.4'
|
45
|
-
s.add_runtime_dependency 'google-api-client', '~> 0.
|
46
|
+
s.add_runtime_dependency 'google-api-client', '~> 0.8'
|
46
47
|
s.add_runtime_dependency 'aws-sdk', '~> 1.57'
|
47
48
|
s.add_runtime_dependency 'docker-api'
|
48
49
|
s.add_runtime_dependency 'fog', '~> 1.25'
|
@@ -34,7 +34,6 @@ module Beaker
|
|
34
34
|
master_a = {
|
35
35
|
:q_puppetmaster_install => 'y',
|
36
36
|
:q_puppetmaster_certname => master,
|
37
|
-
:q_puppetmaster_install => 'y',
|
38
37
|
:q_puppetmaster_dnsaltnames => master_dns_altnames,
|
39
38
|
:q_puppetmaster_enterpriseconsole_hostname => dashboard,
|
40
39
|
:q_puppetmaster_enterpriseconsole_port => answer_for(options, :q_puppetmaster_enterpriseconsole_port, 443),
|
@@ -35,7 +35,6 @@ module Beaker
|
|
35
35
|
master_a = {
|
36
36
|
:q_puppetmaster_install => 'y',
|
37
37
|
:q_puppetmaster_certname => master,
|
38
|
-
:q_puppetmaster_install => 'y',
|
39
38
|
:q_puppetmaster_dnsaltnames => master_dns_altnames,
|
40
39
|
:q_puppetmaster_enterpriseconsole_hostname => dashboard,
|
41
40
|
:q_puppetmaster_enterpriseconsole_port => answer_for(options, :q_puppetmaster_enterpriseconsole_port, 443),
|
@@ -37,7 +37,7 @@ module Beaker
|
|
37
37
|
}
|
38
38
|
|
39
39
|
# If we're installing or upgrading from a non-RBAC version, set the 'admin' password
|
40
|
-
if @options[:type] == :upgrade && @options[:
|
40
|
+
if @options[:type] == :upgrade && @options[:set_console_password]
|
41
41
|
dashboard_password = "'#{@options[:answers][:q_puppet_enterpriseconsole_auth_password]}'"
|
42
42
|
the_answers[dashboard.name][:q_puppet_enterpriseconsole_auth_password] = dashboard_password
|
43
43
|
end
|
data/lib/beaker/command.rb
CHANGED
@@ -70,7 +70,7 @@ module Beaker
|
|
70
70
|
def cmd_line host, cmd = @command, env = @environment
|
71
71
|
env_string = env.nil? ? '' : environment_string_for( host, env )
|
72
72
|
|
73
|
-
cygwin = ((host['platform'] =~ /windows/) and @cmdexe) ? 'cmd.exe /c' : nil
|
73
|
+
cygwin = ((host['platform'] =~ /windows/) and host.is_cygwin? and @cmdexe) ? 'cmd.exe /c' : nil
|
74
74
|
|
75
75
|
# This will cause things like `puppet -t -v agent` which is maybe bad.
|
76
76
|
[env_string, cygwin, cmd, options_string, args_string].compact.reject(&:empty?).join(' ')
|
data/lib/beaker/dsl/helpers.rb
CHANGED
@@ -183,7 +183,7 @@ module Beaker
|
|
183
183
|
end
|
184
184
|
end
|
185
185
|
|
186
|
-
# Move a local file to a remote host
|
186
|
+
# Move a local file to a remote host using scp
|
187
187
|
# @note If using {Beaker::Host} for the hosts *scp* is not
|
188
188
|
# required on the system as it uses Ruby's net/scp library. The
|
189
189
|
# net-scp gem however is required (and specified in the gemspec.
|
@@ -210,6 +210,27 @@ module Beaker
|
|
210
210
|
end
|
211
211
|
end
|
212
212
|
|
213
|
+
# Move a local file or directory to a remote host using rsync
|
214
|
+
# @note rsync is required on the local host.
|
215
|
+
#
|
216
|
+
# @param [Host, #do_scp_to] host A host object that responds like
|
217
|
+
# {Beaker::Host}.
|
218
|
+
# @param [String] from_path A local path to a file or directory.
|
219
|
+
# @param [String] to_path A remote path to copy *from_path* to.
|
220
|
+
# @!macro common_opts
|
221
|
+
#
|
222
|
+
# @return [Result] Returns the result of the rsync operation
|
223
|
+
def rsync_to host, from_path, to_path, opts = {}
|
224
|
+
block_on host do | host |
|
225
|
+
if host['platform'] =~ /windows/ && to_path.match('`cygpath')
|
226
|
+
result = host.echo "#{to_path}"
|
227
|
+
to_path = result.raw_output.chomp
|
228
|
+
end
|
229
|
+
@result = host.do_rsync_to(from_path, to_path, opts)
|
230
|
+
@result
|
231
|
+
end
|
232
|
+
end
|
233
|
+
|
213
234
|
# Deploy packaging configurations generated by
|
214
235
|
# https://github.com/puppetlabs/packaging to a host.
|
215
236
|
#
|
@@ -238,13 +259,24 @@ module Beaker
|
|
238
259
|
# @param [String] file_path A remote path to place *file_content* at.
|
239
260
|
# @param [String] file_content The contents of the file to be placed.
|
240
261
|
# @!macro common_opts
|
262
|
+
# @option opts [String] :protocol Name of the underlying transfer method.
|
263
|
+
# Valid options are 'scp' or 'rsync'.
|
241
264
|
#
|
242
265
|
# @return [Result] Returns the result of the underlying SCP operation.
|
243
266
|
def create_remote_file(hosts, file_path, file_content, opts = {})
|
244
267
|
Tempfile.open 'beaker' do |tempfile|
|
245
268
|
File.open(tempfile.path, 'w') {|file| file.puts file_content }
|
246
269
|
|
247
|
-
|
270
|
+
opts[:protocol] ||= 'scp'
|
271
|
+
case opts[:protocol]
|
272
|
+
when 'scp'
|
273
|
+
scp_to hosts, tempfile.path, file_path, opts
|
274
|
+
when 'rsync'
|
275
|
+
rsync_to hosts, tempfile.path, file_path, opts
|
276
|
+
else
|
277
|
+
logger.debug "Unsupported transfer protocol, returning nil"
|
278
|
+
nil
|
279
|
+
end
|
248
280
|
end
|
249
281
|
end
|
250
282
|
|
@@ -553,7 +585,7 @@ module Beaker
|
|
553
585
|
end
|
554
586
|
|
555
587
|
begin
|
556
|
-
backup_file = backup_the_file(host, host['
|
588
|
+
backup_file = backup_the_file(host, host.puppet('master')['confdir'], testdir, 'puppet.conf')
|
557
589
|
lay_down_new_puppet_conf host, conf_opts, testdir
|
558
590
|
|
559
591
|
if host.use_service_scripts? && !service_args[:bypass_service_script]
|
@@ -564,6 +596,8 @@ module Beaker
|
|
564
596
|
|
565
597
|
yield self if block_given?
|
566
598
|
|
599
|
+
rescue Beaker::DSL::Assertions, Minitest::Assertion => early_assertion
|
600
|
+
fail_test(early_assertion)
|
567
601
|
rescue Exception => early_exception
|
568
602
|
original_exception = RuntimeError.new("PuppetAcceptance::DSL::Helpers.with_puppet_running_on failed (check backtrace for location) because: #{early_exception}\n#{early_exception.backtrace.join("\n")}\n")
|
569
603
|
raise(original_exception)
|
@@ -612,8 +646,7 @@ module Beaker
|
|
612
646
|
|
613
647
|
# @!visibility private
|
614
648
|
def restore_puppet_conf_from_backup( host, backup_file )
|
615
|
-
|
616
|
-
puppet_conf = File.join(puppetpath, "puppet.conf")
|
649
|
+
puppet_conf = host.puppet('master')['config']
|
617
650
|
|
618
651
|
if backup_file
|
619
652
|
host.exec( Command.new( "if [ -f '#{backup_file}' ]; then " +
|
@@ -693,8 +726,9 @@ module Beaker
|
|
693
726
|
|
694
727
|
# @!visibility private
|
695
728
|
def lay_down_new_puppet_conf( host, configuration_options, testdir )
|
696
|
-
|
697
|
-
|
729
|
+
puppetconf_main = host.puppet('master')['config']
|
730
|
+
puppetconf_filename = File.basename(puppetconf_main)
|
731
|
+
puppetconf_test = File.join(testdir, puppetconf_filename)
|
698
732
|
|
699
733
|
new_conf = puppet_conf_for( host, configuration_options )
|
700
734
|
create_remote_file host, puppetconf_test, new_conf.to_s
|
@@ -708,7 +742,7 @@ module Beaker
|
|
708
742
|
|
709
743
|
# @!visibility private
|
710
744
|
def puppet_conf_for host, conf_opts
|
711
|
-
puppetconf = host.exec( Command.new( "cat #{host['
|
745
|
+
puppetconf = host.exec( Command.new( "cat #{host.puppet('master')['config']}" ) ).stdout
|
712
746
|
new_conf = IniFile.new( puppetconf ).merge( conf_opts )
|
713
747
|
|
714
748
|
new_conf
|
@@ -1240,23 +1274,17 @@ module Beaker
|
|
1240
1274
|
vardir = agent.puppet['vardir']
|
1241
1275
|
agent_running = true
|
1242
1276
|
while agent_running
|
1243
|
-
|
1244
|
-
agent_running
|
1245
|
-
|
1277
|
+
agent_running = agent.file_exist?("#{vardir}/state/agent_catalog_run.lock")
|
1278
|
+
if agent_running
|
1279
|
+
sleep 2
|
1280
|
+
end
|
1246
1281
|
end
|
1247
1282
|
|
1248
1283
|
# The agent service is `pe-puppet` everywhere EXCEPT certain linux distros on PE 2.8
|
1249
1284
|
# In all the case that it is different, this init script will exist. So we can assume
|
1250
1285
|
# that if the script doesn't exist, we should just use `pe-puppet`
|
1251
|
-
result = on agent, "[ -e /etc/init.d/pe-puppet-agent ]", :acceptable_exit_codes => [0,1]
|
1252
1286
|
agent_service = 'pe-puppet-agent'
|
1253
|
-
|
1254
|
-
if agent['pe_ver'] && !version_is_less(agent['pe_ver'], '4.0')
|
1255
|
-
agent_service = 'puppet'
|
1256
|
-
else
|
1257
|
-
agent_service = 'pe-puppet'
|
1258
|
-
end
|
1259
|
-
end
|
1287
|
+
agent_service = 'pe-puppet' unless agent.file_exist?('/etc/init.d/pe-puppet-agent')
|
1260
1288
|
|
1261
1289
|
# Under a number of stupid circumstances, we can't stop the
|
1262
1290
|
# agent using puppet. This is usually because of issues with
|
@@ -1380,7 +1408,7 @@ module Beaker
|
|
1380
1408
|
hiera_config[:yaml][:datadir] = host[:hieradatadir]
|
1381
1409
|
hiera_config[:hierarchy] = hierarchy
|
1382
1410
|
hiera_config[:logger] = 'console'
|
1383
|
-
create_remote_file host, host[
|
1411
|
+
create_remote_file host, host.puppet['hiera_config'], hiera_config.to_yaml
|
1384
1412
|
end
|
1385
1413
|
end
|
1386
1414
|
|