beaker-puppet 1.29.0 → 2.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (73) hide show
  1. checksums.yaml +4 -4
  2. data/.github/dependabot.yml +9 -0
  3. data/.github/workflows/release.yml +3 -3
  4. data/.github/workflows/test.yml +28 -7
  5. data/.rubocop.yml +5 -0
  6. data/.rubocop_todo.yml +842 -0
  7. data/CHANGELOG.md +39 -0
  8. data/Gemfile +5 -20
  9. data/Rakefile +64 -169
  10. data/acceptance/config/acceptance-options.rb +3 -3
  11. data/acceptance/config/gem/acceptance-options.rb +8 -8
  12. data/acceptance/config/git/acceptance-options.rb +8 -8
  13. data/acceptance/config/pkg/acceptance-options.rb +7 -7
  14. data/acceptance/pre_suite/gem/install.rb +6 -6
  15. data/acceptance/pre_suite/git/install.rb +22 -22
  16. data/acceptance/pre_suite/pkg/install.rb +3 -3
  17. data/acceptance/tests/backwards_compatible.rb +6 -7
  18. data/acceptance/tests/clone_git_repo_on_test.rb +12 -13
  19. data/acceptance/tests/create_tmpdir_on_test.rb +13 -9
  20. data/acceptance/tests/install_smoke_test.rb +5 -4
  21. data/acceptance/tests/stub_host.rb +11 -10
  22. data/acceptance/tests/web_helpers_test.rb +11 -10
  23. data/beaker-puppet.gemspec +16 -23
  24. data/bin/beaker-puppet +2 -4
  25. data/lib/beaker-puppet/helpers/facter_helpers.rb +9 -7
  26. data/lib/beaker-puppet/helpers/host_helpers.rb +10 -7
  27. data/lib/beaker-puppet/helpers/puppet_helpers.rb +151 -160
  28. data/lib/beaker-puppet/helpers/rake_helpers.rb +1 -1
  29. data/lib/beaker-puppet/helpers/tk_helpers.rb +22 -28
  30. data/lib/beaker-puppet/install_utils/aio_defaults.rb +39 -43
  31. data/lib/beaker-puppet/install_utils/ezbake_utils.rb +34 -42
  32. data/lib/beaker-puppet/install_utils/foss_defaults.rb +134 -138
  33. data/lib/beaker-puppet/install_utils/foss_utils.rb +294 -321
  34. data/lib/beaker-puppet/install_utils/module_utils.rb +58 -70
  35. data/lib/beaker-puppet/install_utils/puppet5.rb +30 -35
  36. data/lib/beaker-puppet/install_utils/puppet_utils.rb +58 -68
  37. data/lib/beaker-puppet/install_utils/windows_utils.rb +34 -36
  38. data/lib/beaker-puppet/version.rb +1 -1
  39. data/lib/beaker-puppet/wrappers.rb +13 -14
  40. data/lib/beaker-puppet.rb +4 -5
  41. data/setup/aio/010_Install_Puppet_Agent.rb +5 -6
  42. data/setup/common/000-delete-puppet-when-none.rb +2 -4
  43. data/setup/common/003_solaris_cert_fix.rb +74 -70
  44. data/setup/common/005_redhat_subscription_fix.rb +3 -2
  45. data/setup/common/011_Install_Puppet_Server.rb +7 -9
  46. data/setup/common/012_Finalize_Installs.rb +5 -5
  47. data/setup/common/025_StopFirewall.rb +1 -1
  48. data/setup/common/030_StopSssd.rb +2 -2
  49. data/setup/common/040_ValidateSignCert.rb +10 -12
  50. data/setup/common/045_EnsureMasterStarted.rb +2 -2
  51. data/setup/gem/010_GemInstall.rb +5 -4
  52. data/setup/git/000_EnvSetup.rb +48 -48
  53. data/setup/git/010_TestSetup.rb +13 -12
  54. data/setup/git/020_PuppetUserAndGroup.rb +3 -2
  55. data/setup/git/060_InstallModules.rb +14 -14
  56. data/setup/git/070_InstallCACerts.rb +82 -82
  57. data/spec/beaker-puppet/helpers/facter_helpers_spec.rb +22 -24
  58. data/spec/beaker-puppet/helpers/host_helpers_spec.rb +10 -6
  59. data/spec/beaker-puppet/helpers/puppet_helpers_spec.rb +506 -517
  60. data/spec/beaker-puppet/helpers/tk_helpers_spec.rb +20 -24
  61. data/spec/beaker-puppet/install_utils/ezbake_utils_spec.rb +86 -90
  62. data/spec/beaker-puppet/install_utils/foss_utils_spec.rb +636 -599
  63. data/spec/beaker-puppet/install_utils/module_utils_spec.rb +125 -116
  64. data/spec/beaker-puppet/install_utils/puppet5_spec.rb +159 -165
  65. data/spec/beaker-puppet/install_utils/puppet_utils_spec.rb +92 -77
  66. data/spec/beaker-puppet/install_utils/windows_utils_spec.rb +101 -89
  67. data/spec/beaker-puppet/wrappers_spec.rb +10 -10
  68. data/spec/helpers.rb +85 -91
  69. data/tasks/ci.rake +171 -179
  70. metadata +33 -62
  71. data/setup/common/020_InstallCumulusModules.rb +0 -13
  72. data/setup/common/021_InstallAristaModuleMasters.rb +0 -12
  73. data/setup/common/022_InstallAristaModuleAgents.rb +0 -13
@@ -12,24 +12,23 @@ module Beaker
12
12
  # {Beaker::Host}'s interface to act upon
13
13
  # * the module {Beaker::DSL::Wrappers} the provides convenience methods for {Beaker::DSL::Command} creation
14
14
  module ModuleUtils
15
-
16
15
  # The directories in the module directory that will not be scp-ed to the test system when using
17
16
  # `copy_module_to`
18
17
  PUPPET_MODULE_INSTALL_IGNORE = ['/.bundle', '/.git', '/.idea', '/.vagrant', '/.vendor', '/vendor', '/acceptance',
19
- '/bundle', '/spec', '/tests', '/log', '/.svn', '/junit', '/pkg', '/example', '/tmp']
18
+ '/bundle', '/spec', '/tests', '/log', '/.svn', '/junit', '/pkg', '/example', '/tmp',]
20
19
 
21
20
  # Install the desired module on all hosts using either the PMT or a
22
21
  # staging forge
23
22
  #
24
23
  # @see install_dev_puppet_module
25
- def install_dev_puppet_module_on( host, opts )
24
+ def install_dev_puppet_module_on(host, opts)
26
25
  if options[:forge_host]
27
- install_puppet_module_via_pmt_on( host, opts )
26
+ install_puppet_module_via_pmt_on(host, opts)
28
27
  else
29
- copy_module_to( host, opts )
28
+ copy_module_to(host, opts)
30
29
  end
31
30
  end
32
- alias :puppet_module_install_on :install_dev_puppet_module_on
31
+ alias puppet_module_install_on install_dev_puppet_module_on
33
32
 
34
33
  # Install the desired module on all hosts using either the PMT or a
35
34
  # staging forge
@@ -48,21 +47,21 @@ module Beaker
48
47
  #
49
48
  # @see install_puppet_module_via_pmt
50
49
  # @see copy_module_to
51
- def install_dev_puppet_module( opts )
52
- block_on( hosts ) {|h| install_dev_puppet_module_on( h, opts ) }
50
+ def install_dev_puppet_module(opts)
51
+ block_on(hosts) { |h| install_dev_puppet_module_on(h, opts) }
53
52
  end
54
- alias :puppet_module_install :install_dev_puppet_module
53
+ alias puppet_module_install install_dev_puppet_module
55
54
 
56
55
  # Install the desired module with the PMT on a given host
57
56
  #
58
57
  # @param opts [Hash]
59
58
  # @option opts [String] :module_name The short name of the module to be installed
60
59
  # @option opts [String] :version The version of the module to be installed
61
- def install_puppet_module_via_pmt_on( host, opts = {} )
60
+ def install_puppet_module_via_pmt_on(host, opts = {})
62
61
  block_on host do |h|
63
- version_info = opts[:version] ? "-v #{opts[:version]}" : ""
62
+ version_info = opts[:version] ? "-v #{opts[:version]}" : ''
64
63
  if opts[:source]
65
- author_name, module_name = parse_for_modulename( opts[:source] )
64
+ author_name, module_name = parse_for_modulename(opts[:source])
66
65
  modname = "#{author_name}-#{module_name}"
67
66
  else
68
67
  modname = opts[:module_name]
@@ -70,15 +69,15 @@ module Beaker
70
69
 
71
70
  puppet_opts = {}
72
71
  if host[:default_module_install_opts].respond_to? :merge
73
- puppet_opts = host[:default_module_install_opts].merge( puppet_opts )
72
+ puppet_opts = host[:default_module_install_opts].merge(puppet_opts)
74
73
  end
75
74
 
76
75
  if options[:forge_host]
77
- if options[:forge_host] =~ /^http/
78
- puppet_opts[:module_repository] = options[:forge_host]
79
- else
80
- puppet_opts[:module_repository] = "https://#{options[:forge_host]}"
81
- end
76
+ puppet_opts[:module_repository] = if options[:forge_host] =~ /^http/
77
+ options[:forge_host]
78
+ else
79
+ "https://#{options[:forge_host]}"
80
+ end
82
81
  end
83
82
 
84
83
  on h, puppet("module install #{modname} #{version_info}", puppet_opts)
@@ -87,7 +86,7 @@ module Beaker
87
86
 
88
87
  # Install the desired module with the PMT on all known hosts
89
88
  # @see #install_puppet_module_via_pmt_on
90
- def install_puppet_module_via_pmt( opts = {} )
89
+ def install_puppet_module_via_pmt(opts = {})
91
90
  install_puppet_module_via_pmt_on(hosts, opts)
92
91
  end
93
92
 
@@ -113,103 +112,97 @@ module Beaker
113
112
  #
114
113
  def copy_module_to(one_or_more_hosts, opts = {})
115
114
  block_on one_or_more_hosts do |host|
116
- opts = {:source => './',
117
- :target_module_path => host['distmoduledir'],
118
- :ignore_list => PUPPET_MODULE_INSTALL_IGNORE}.merge(opts)
115
+ opts = { source: './',
116
+ target_module_path: host['distmoduledir'],
117
+ ignore_list: PUPPET_MODULE_INSTALL_IGNORE, }.merge(opts)
119
118
 
120
119
  ignore_list = build_ignore_list(opts)
121
120
  target_module_dir = get_target_module_path(host, opts[:target_module_path])
122
- source_path = File.expand_path( opts[:source] )
121
+ source_path = File.expand_path(opts[:source])
123
122
  source_name = File.basename(source_path)
124
123
  if opts.has_key?(:module_name)
125
124
  module_name = opts[:module_name]
126
125
  else
127
- _, module_name = parse_for_modulename( source_path )
126
+ _, module_name = parse_for_modulename(source_path)
128
127
  end
129
128
 
130
129
  target_path = File.join(target_module_dir, module_name)
131
- if host.is_powershell? #make sure our slashes are correct
132
- target_path = target_path.gsub(/\//,'\\')
133
- end
130
+ target_path = target_path.gsub(%r{/}, '\\') if host.is_powershell? # make sure our slashes are correct
134
131
 
135
132
  opts[:protocol] ||= 'scp'
136
133
  case opts[:protocol]
137
134
  when 'scp'
138
- #move to the host
135
+ # move to the host
139
136
  logger.debug "Using scp to transfer #{source_path} to #{target_path}"
140
- scp_to host, source_path, target_module_dir, {:ignore => ignore_list}
137
+ scp_to host, source_path, target_module_dir, { ignore: ignore_list }
141
138
 
142
- #rename to the selected module name, if not correct
139
+ # rename to the selected module name, if not correct
143
140
  cur_path = File.join(target_module_dir, source_name)
144
- if host.is_powershell? #make sure our slashes are correct
145
- cur_path = cur_path.gsub(/\//,'\\')
146
- end
141
+ cur_path = cur_path.gsub(%r{/}, '\\') if host.is_powershell? # make sure our slashes are correct
147
142
  host.mv cur_path, target_path unless cur_path == target_path
148
143
  when 'rsync'
149
144
  logger.debug "Using rsync to transfer #{source_path} to #{target_path}"
150
- rsync_to host, source_path, target_path, {:ignore => ignore_list}
145
+ rsync_to host, source_path, target_path, { ignore: ignore_list }
151
146
  else
152
- logger.debug "Unsupported transfer protocol, returning nil"
147
+ logger.debug 'Unsupported transfer protocol, returning nil'
153
148
  nil
154
149
  end
155
150
  end
156
151
  end
157
- alias :copy_root_module_to :copy_module_to
152
+ alias copy_root_module_to copy_module_to
158
153
 
159
- def get_target_module_path(host, path=nil)
154
+ def get_target_module_path(host, path = nil)
160
155
  if path
161
- on( host, "echo #{path}" ).stdout.chomp
156
+ on(host, "echo #{path}").stdout.chomp
162
157
  else
163
158
  path = host.puppet['basemodulepath'].split(':').first
164
159
  raise ArgumentError, 'Unable to find target module path to copy to' unless path
160
+
165
161
  path
166
162
  end
167
163
  end
168
164
 
169
- #Recursive method for finding the module root
165
+ # Recursive method for finding the module root
170
166
  # Assumes that a Modulefile exists
171
167
  # @param [String] possible_module_directory
172
168
  # will look for Modulefile and if none found go up one level and try again until root is reached
173
169
  #
174
170
  # @return [String,nil]
175
171
  def parse_for_moduleroot(possible_module_directory)
176
- if File.exists?("#{possible_module_directory}/Modulefile") || File.exists?("#{possible_module_directory}/metadata.json")
172
+ if File.exist?("#{possible_module_directory}/Modulefile") || File.exist?("#{possible_module_directory}/metadata.json")
177
173
  possible_module_directory
178
174
  elsif possible_module_directory === '/'
179
175
  logger.error "At root, can't parse for another directory"
180
176
  nil
181
177
  else
182
178
  logger.debug "No Modulefile or metadata.json found at #{possible_module_directory}, moving up"
183
- parse_for_moduleroot File.expand_path(File.join(possible_module_directory,'..'))
179
+ parse_for_moduleroot File.expand_path(File.join(possible_module_directory, '..'))
184
180
  end
185
181
  end
186
182
 
187
- #Parse root directory of a module for module name
183
+ # Parse root directory of a module for module name
188
184
  # Searches for metadata.json and then if none found, Modulefile and parses for the Name attribute
189
185
  # @param [String] root_module_dir
190
186
  # @return [String] module name
191
187
  def parse_for_modulename(root_module_dir)
192
- author_name, module_name = nil, nil
193
- if File.exists?("#{root_module_dir}/metadata.json")
194
- logger.debug "Attempting to parse Modulename from metadata.json"
195
- module_json = JSON.parse(File.read "#{root_module_dir}/metadata.json")
196
- if(module_json.has_key?('name'))
197
- author_name, module_name = get_module_name(module_json['name'])
198
- end
188
+ author_name = nil
189
+ module_name = nil
190
+ if File.exist?("#{root_module_dir}/metadata.json")
191
+ logger.debug 'Attempting to parse Modulename from metadata.json'
192
+ module_json = JSON.parse(File.read("#{root_module_dir}/metadata.json"))
193
+ author_name, module_name = get_module_name(module_json['name']) if module_json.has_key?('name')
199
194
  end
200
- if !module_name && File.exists?("#{root_module_dir}/Modulefile")
201
- logger.debug "Attempting to parse Modulename from Modulefile"
195
+ if !module_name && File.exist?("#{root_module_dir}/Modulefile")
196
+ logger.debug 'Attempting to parse Modulename from Modulefile'
202
197
  if /^name\s+'?(\w+-\w+)'?\s*$/i.match(File.read("#{root_module_dir}/Modulefile"))
203
198
  author_name, module_name = get_module_name(Regexp.last_match[1])
204
199
  end
205
200
  end
206
- if !module_name && !author_name
207
- logger.debug "Unable to determine name, returning null"
208
- end
209
- return author_name, module_name
201
+ logger.debug 'Unable to determine name, returning null' if !module_name && !author_name
202
+ [author_name, module_name]
210
203
  end
211
204
 
212
- #Parse modulename from the pattern 'Auther-ModuleName'
205
+ # Parse modulename from the pattern 'Auther-ModuleName'
213
206
  #
214
207
  # @param [String] author_module_name <Author>-<ModuleName> pattern
215
208
  #
@@ -217,23 +210,21 @@ module Beaker
217
210
  #
218
211
  def get_module_name(author_module_name)
219
212
  split_name = split_author_modulename(author_module_name)
220
- if split_name
221
- return split_name[:author], split_name[:module]
222
- end
213
+ return unless split_name
214
+
215
+ [split_name[:author], split_name[:module]]
223
216
  end
224
217
 
225
- #Split the Author-Name into a hash
218
+ # Split the Author-Name into a hash
226
219
  # @param [String] author_module_attr
227
220
  #
228
221
  # @return [Hash<Symbol,String>,nil] :author and :module symbols will be returned
229
222
  #
230
223
  def split_author_modulename(author_module_attr)
231
224
  result = /(\w+)-(\w+)/.match(author_module_attr)
232
- if result
233
- {:author => result[1], :module => result[2]}
234
- else
235
- nil
236
- end
225
+ return unless result
226
+
227
+ { author: result[1], module: result[2] }
237
228
  end
238
229
 
239
230
  # Build an array list of files/directories to ignore when pushing to remote host
@@ -244,16 +235,13 @@ module Beaker
244
235
  # @option opts [Array] :ignore_list A list of files/directories to ignore
245
236
  def build_ignore_list(opts = {})
246
237
  ignore_list = opts[:ignore_list] || PUPPET_MODULE_INSTALL_IGNORE
247
- if !ignore_list.kind_of?(Array) || ignore_list.nil?
248
- raise ArgumentError "Ignore list must be an Array"
249
- end
238
+ raise ArgumentError 'Ignore list must be an Array' if !ignore_list.is_a?(Array) || ignore_list.nil?
239
+
250
240
  ignore_list << '.' unless ignore_list.include? '.'
251
241
  ignore_list << '..' unless ignore_list.include? '..'
252
242
  ignore_list
253
243
  end
254
-
255
244
  end
256
245
  end
257
-
258
246
  end
259
247
  end
@@ -16,15 +16,13 @@ module Beaker
16
16
  #
17
17
  # @return [Hash{String=>String}] build json parsed into a ruby hash
18
18
  def fetch_build_details(sha_yaml_url)
19
- dst_folder = Dir.mktmpdir
19
+ dst_folder = Dir.mktmpdir
20
20
 
21
21
  at_exit do
22
- if $!.nil? || ($!.is_a?(SystemExit) && $!.success?)
23
- if File.directory?(dst_folder)
24
- require 'fileutils'
22
+ if ($!.nil? || ($!.is_a?(SystemExit) && $!.success?)) && File.directory?(dst_folder)
23
+ require 'fileutils'
25
24
 
26
- FileUtils.rm_rf(dst_folder)
27
- end
25
+ FileUtils.rm_rf(dst_folder)
28
26
  end
29
27
  end
30
28
 
@@ -34,7 +32,7 @@ module Beaker
34
32
  sha_yaml_file_local_path = fetch_http_file(
35
33
  sha_yaml_folder_url,
36
34
  sha_yaml_filename,
37
- dst_folder
35
+ dst_folder,
38
36
  )
39
37
 
40
38
  file_hash = YAML.load_file(sha_yaml_file_local_path)
@@ -52,7 +50,7 @@ module Beaker
52
50
  fail_test(message)
53
51
  end
54
52
 
55
- return sha_yaml_folder_url, file_hash[:platform_data]
53
+ [sha_yaml_folder_url, file_hash[:platform_data]]
56
54
  end
57
55
 
58
56
  # Get the host's packaging platform, based on beaker-hostgenerator's
@@ -66,7 +64,7 @@ module Beaker
66
64
  def host_packaging_platform(host)
67
65
  packaging_platform = host[:packaging_platform]
68
66
  if ENV['BEAKER_PACKAGING_PLATFORMS']
69
- overrides = Hash[ENV['BEAKER_PACKAGING_PLATFORMS'].split(',').map { |e| e.split('=') }]
67
+ overrides = ENV['BEAKER_PACKAGING_PLATFORMS'].split(',').map { |e| e.split('=') }.to_h
70
68
  logger.debug("Found packaging platform overrides: #{overrides}")
71
69
  if overrides[host[:platform]]
72
70
  platform = overrides[host[:platform]]
@@ -91,23 +89,23 @@ module Beaker
91
89
  message = <<-EOF
92
90
  :packaging_platform not provided for host '#{host}', platform '#{host[:platform]}'
93
91
  :packaging_platform should be the platform-specific key from this list:
94
- #{ build_details.keys }
92
+ #{build_details.keys}
95
93
  EOF
96
- fail_test( message )
94
+ fail_test(message)
97
95
  end
98
96
 
99
- logger.debug("Platforms available for this build:")
100
- logger.debug("#{ build_details.keys }")
97
+ logger.debug('Platforms available for this build:')
98
+ logger.debug("#{build_details.keys}")
101
99
  logger.debug("PLATFORM SPECIFIC INFO for #{host} (packaging name '#{packaging_platform}'):")
102
100
  packaging_data = build_details[packaging_platform]
103
- logger.debug("- #{ packaging_data }, isnil? #{ packaging_data.nil? }")
101
+ logger.debug("- #{packaging_data}, isnil? #{packaging_data.nil?}")
104
102
  if packaging_data.nil?
105
103
  message = <<-EOF
106
104
  :packaging_platform '#{packaging_platform}' for host '#{host}' not in build details
107
105
  :packaging_platform should be the platform-specific key from this list:
108
- #{ build_details.keys }
106
+ #{build_details.keys}
109
107
  EOF
110
- fail_test( message )
108
+ fail_test(message)
111
109
  end
112
110
 
113
111
  artifact_buildserver_path = packaging_data[:artifact]
@@ -116,11 +114,11 @@ module Beaker
116
114
 
117
115
  artifact_url = "#{build_url}/#{artifact_buildserver_path}"
118
116
  repoconfig_url = "#{build_url}/#{repoconfig_buildserver_path}" unless repoconfig_buildserver_path.nil?
119
- artifact_url_correct = link_exists?( artifact_url )
117
+ artifact_url_correct = link_exists?(artifact_url)
120
118
  logger.debug("- artifact url: '#{artifact_url}'. Exists? #{artifact_url_correct}")
121
- fail_test('artifact url built incorrectly') if !artifact_url_correct
119
+ fail_test('artifact url built incorrectly') unless artifact_url_correct
122
120
 
123
- return artifact_url, repoconfig_url
121
+ [artifact_url, repoconfig_url]
124
122
  end
125
123
 
126
124
  # install build artifact on the given host
@@ -131,12 +129,12 @@ module Beaker
131
129
  #
132
130
  # @return nil
133
131
  def install_artifact_on(host, artifact_url, project_name)
134
- variant, version, _, _ = host[:platform].to_array
132
+ variant, version, = host[:platform].to_array
135
133
  case variant
136
134
  when 'eos'
137
135
  host.get_remote_file(artifact_url)
138
136
  onhost_package_file = File.basename(artifact_url)
139
- # TODO Will be refactored into {Beaker::Host#install_local_package}
137
+ # TODO: Will be refactored into {Beaker::Host#install_local_package}
140
138
  # immediately following this work. The release timing makes it
141
139
  # necessary to have this here separately for a short while
142
140
  host.install_from_file(onhost_package_file)
@@ -166,14 +164,12 @@ module Beaker
166
164
  scp_to host, artifact_filename, onhost_package_dir
167
165
  onhost_package_file = "#{onhost_package_dir}/#{artifact_filename}"
168
166
 
169
- # TODO Will be refactored into {Beaker::Host#install_local_package}
167
+ # TODO: Will be refactored into {Beaker::Host#install_local_package}
170
168
  # immediately following this work. The release timing makes it
171
169
  # necessary to have this here seperately for a short while
172
170
  # NOTE: the AIX 7.1 package will only install on 7.2 with
173
171
  # --ignoreos. This is a bug in package building on AIX 7.1's RPM
174
- if version == "7.2"
175
- aix_72_ignoreos_hack = "--ignoreos"
176
- end
172
+ aix_72_ignoreos_hack = '--ignoreos' if version == '7.2'
177
173
  on host, "rpm -ivh #{aix_72_ignoreos_hack} #{onhost_package_file}"
178
174
  else
179
175
  host.install_package(artifact_url)
@@ -192,7 +188,7 @@ module Beaker
192
188
  return
193
189
  end
194
190
 
195
- install_repo_configs_from_url( host, repoconfig_url )
191
+ install_repo_configs_from_url(host, repoconfig_url)
196
192
  end
197
193
 
198
194
  # Installs a specified puppet project on all hosts. Gets build information
@@ -208,26 +204,26 @@ module Beaker
208
204
  #
209
205
  # @return nil
210
206
  def install_from_build_data_url(project_name, sha_yaml_url, local_hosts = nil)
211
- if !link_exists?( sha_yaml_url )
207
+ unless link_exists?(sha_yaml_url)
212
208
  message = <<-EOF
213
209
  Unable to locate a downloadable build of #{project_name} (tried #{sha_yaml_url})
214
210
  EOF
215
- fail_test( message )
211
+ fail_test(message)
216
212
  end
217
213
 
218
- base_url, build_details = fetch_build_details( sha_yaml_url )
214
+ base_url, build_details = fetch_build_details(sha_yaml_url)
219
215
 
220
216
  install_targets = local_hosts.nil? ? hosts : Array(local_hosts)
221
217
 
222
218
  install_targets.each do |host|
223
- artifact_url, repoconfig_url = host_urls( host, build_details, base_url )
219
+ artifact_url, repoconfig_url = host_urls(host, build_details, base_url)
224
220
  if repoconfig_url.nil?
225
- install_artifact_on( host, artifact_url, project_name )
221
+ install_artifact_on(host, artifact_url, project_name)
226
222
  else
227
- install_repo_configs_on( host, repoconfig_url )
228
- host.install_package( project_name )
223
+ install_repo_configs_on(host, repoconfig_url)
224
+ host.install_package(project_name)
229
225
  end
230
- configure_type_defaults_on( host )
226
+ configure_type_defaults_on(host)
231
227
  end
232
228
  end
233
229
 
@@ -248,4 +244,3 @@ module Beaker
248
244
  end
249
245
  end
250
246
  end
251
-