beaker-puppet 0.6.0 → 0.7.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- ODMyNzY5MjBiMWEyNGVmZTUyZmQzMWEyNjZkMjIzYTAzNDdmYjdmNQ==
4
+ MDFjMDdlN2QwYTMxOTQ0YjM0ZTdlODFlMjMwM2EyMTU5OTE4ZmE0OQ==
5
5
  data.tar.gz: !binary |-
6
- NzVkNmJmZmI0ZTczZmVmYWQ3MTgzOGJkZGJmNTBhZTk4OThlMmI5Zg==
6
+ ODY5MzhlODg2OWYwMTNjNGY1OWE0Mjg3YTk5YmM2NjJkNjliYWVmNQ==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- NDE4ZWYyZjE3NmYxNWJhMWQ1YzE4YTFjZDczZGI4MzA4NGJmM2JkZDExMDJm
10
- ZjI5ODM1M2RhMWE0OTIzMWE0MDhhMzBiMWViNmQ0NzZhZjA5NjYzZWFmYWQz
11
- MGZkZTgwOTBkZjg2OWRiMWVkOWI0MzJhYWE0ZGQ0ZDZiZmE1ZGQ=
9
+ ZGYzZjQyYWU2M2IzNGYxNGIwZDI0ZGU4YWY5NjI3NDI4ZGRhNmZhNzkzZjU0
10
+ YjQ0MGQ1ZTA4NTY4ZmJjMzk5MGVkNjI5M2NmMDI4MDNlNDdhMjBiNTJjOTRh
11
+ ZGMxYzYxODJlYWNhZWZmZmZlOGI4ZDE2ZmI5YzY0OTJiOTBjMWM=
12
12
  data.tar.gz: !binary |-
13
- YzUzN2I1ZTA5MThiMjFkYTNiMzJlNzNlMzIzZDM3ZmMyYjFmMGZlYzljY2Nk
14
- NzA2ZGNhOTVhM2FiMmQ0Njc0NWFmODZhOTFiMDI0OGRjYTJlYjBmNmYyOWRl
15
- Y2MxNDgyN2I3ZDI5MTYxN2Q1NDExYWJiZjFiZjkwOWNhOTBiN2E=
13
+ OTZjODNjNGMwMmNhY2NjMWEyZjBhNGU0ZGExMDQ2ZDdhYzkzZTdiNTA3NmI1
14
+ ZDRlZjRjYjhkNWZlMDNlMjliNDBlMDNjYTcxZDRjNWI0NmNmYTlkYzk2ZWNl
15
+ ZWQ5ODA2ZjEwOGI2OTdhYWQ2NWRlZWQyMmU3NjcwMWJkOTJmZDU=
@@ -139,11 +139,13 @@ module BeakerPuppet
139
139
  # @param [String] project_name Name of the project to install
140
140
  # @param [String] sha_yaml_url URL to the <SHA>.yaml file containing the
141
141
  # build details
142
+ # @param [String or Array] hosts Optional string or array of host or hosts to
143
+ # install on
142
144
  #
143
145
  # @note This install method only works for Puppet versions >= 5.0
144
146
  #
145
147
  # @return nil
146
- def install_from_build_data_url(project_name, sha_yaml_url)
148
+ def install_from_build_data_url(project_name, sha_yaml_url, local_hosts = nil)
147
149
  if !link_exists?( sha_yaml_url )
148
150
  message = <<-EOF
149
151
  <SHA>.yaml URL '#{ sha_yaml_url }' does not exist.
@@ -153,7 +155,10 @@ module BeakerPuppet
153
155
  end
154
156
 
155
157
  base_url, build_details = fetch_build_details( sha_yaml_url )
156
- hosts.each do |host|
158
+
159
+ install_targets = local_hosts.nil? ? hosts : Array(local_hosts)
160
+
161
+ install_targets.each do |host|
157
162
  artifact_url, repoconfig_url = host_urls( host, build_details, base_url )
158
163
  if repoconfig_url.nil?
159
164
  install_artifact_on( host, artifact_url, project_name )
@@ -1,3 +1,3 @@
1
1
  module BeakerPuppet
2
- VERSION = '0.6.0'
2
+ VERSION = '0.7.0'
3
3
  end
@@ -234,6 +234,28 @@ describe ClassMixedWithDSLInstallUtils do
234
234
  subject.install_from_build_data_url( 'project_name', 'project_sha' )
235
235
  end
236
236
 
237
+ it 'calls #configure_type_defaults_on one host if set' do
238
+ allow( subject ).to receive( :fetch_build_details )
239
+ allow( subject ).to receive( :host_urls )
240
+ allow( subject ).to receive( :install_artifact_on )
241
+
242
+ expect( subject ).to receive( :configure_type_defaults_on ).with( hosts[0] ).once
243
+ subject.install_from_build_data_url( 'project_name', 'project_sha', host[0] )
244
+ end
245
+
246
+ it 'calls #configure_type_defaults_on custom array of hosts if set' do
247
+ allow( subject ).to receive( :fetch_build_details )
248
+ allow( subject ).to receive( :host_urls )
249
+ allow( subject ).to receive( :install_artifact_on )
250
+
251
+ custom_host_list = hosts.sample(1 + rand(hosts.count))
252
+
253
+ custom_host_list do |host|
254
+ expect( subject ).to receive( :configure_type_defaults_on ).with( host ).once
255
+ end
256
+ subject.install_from_build_data_url( 'project_name', 'project_sha', custom_host_list )
257
+ end
258
+
237
259
  it 'passes the artifact_url from #hosts_artifact_url to #install_artifact_on' do
238
260
  allow( subject ).to receive( :fetch_build_details )
239
261
  allow( subject ).to receive( :configure_type_defaults_on )
@@ -279,4 +301,4 @@ describe ClassMixedWithDSLInstallUtils do
279
301
  end
280
302
  end
281
303
 
282
- end
304
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: beaker-puppet
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.0
4
+ version: 0.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Puppet
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-08-21 00:00:00.000000000 Z
11
+ date: 2017-09-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec