kitchen-puppet 1.47.2 → 1.47.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4c3e4ff489eab900c9165f7404833defb112829c
4
- data.tar.gz: b077a8638d92ab3f846fafa6f20b9f0b35d5540d
3
+ metadata.gz: 6596c5f2430164122f20de74aa006ccb24ff1d05
4
+ data.tar.gz: 99b2d37ae1be0399b2dd1bf7d9e795b8f425731c
5
5
  SHA512:
6
- metadata.gz: 4cd3c79075fbb5d37e8dfa37ccd1a7ee48b1b8335a0b686ba64b19a7939e949dff4e2172652a050933f99f1cebd4e2e00beaf303c42ee41a501e2edf28ff7851
7
- data.tar.gz: d1f640fb5959de7d703257bd6902b79b1d65cb8becf5b86dbfe2685e81395a1ed57f5832c181e897546aa599d8a72a1a926df6276a7cedc1034f376a0270e320
6
+ metadata.gz: 3ee0dfda2fead9651e29d008c13c6ef26ab9fae9299c0411cca54cea9791a3ded09bbfee35198650214e5cf0fa578b031b0adceb734117aed06c089d594f598b
7
+ data.tar.gz: 4b754f7a4c325265aa25c8a76d2a6991da13d69246e7a5e3936f34606e952cc40e1e77416545a7dd4be352ee38e5cb30f7fd5d83b7f1d300e196693a30db6ea7
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Kitchen
4
4
  module Puppet
5
- VERSION = '1.47.2'.freeze
5
+ VERSION = '1.47.3'.freeze
6
6
  end
7
7
  end
@@ -54,6 +54,8 @@ module Kitchen
54
54
  default_config :puppet_agent_command, nil
55
55
 
56
56
  default_config :http_proxy, nil
57
+ default_config :https_proxy, nil
58
+ default_config :no_proxy, nil
57
59
 
58
60
  default_config :puppet_config_path do |provisioner|
59
61
  provisioner.calculate_path('puppet.conf', :file)
@@ -287,7 +289,10 @@ module Kitchen
287
289
  end
288
290
 
289
291
  def sudo_env(pm)
290
- http_proxy ? "#{sudo('env')} http_proxy=#{http_proxy} #{pm}" : sudo(pm).to_s
292
+ s = https_proxy ? "https_proxy=#{https_proxy}" : nil
293
+ p = http_proxy ? "http_proxy=#{http_proxy}" : nil
294
+ n = no_proxy ? "no_proxy=#{no_proxy}" : nil
295
+ p || s ? "#{sudo('env')} #{p} #{s} #{n} #{pm}" : sudo(pm).to_s
291
296
  end
292
297
 
293
298
  def custom_facts
@@ -359,17 +364,30 @@ module Kitchen
359
364
  end
360
365
 
361
366
  def gem_proxy_parm
362
- http_proxy ? "--http-proxy #{http_proxy}" : nil
367
+ p = http_proxy ? "--http-proxy #{http_proxy}" : nil
368
+ n = no_proxy ? "--no-http-proxy #{no_proxy}" : nil
369
+ p ? "#{p} #{n}" : nil
363
370
  end
364
371
 
365
372
  def wget_proxy_parm
366
- http_proxy ? "-e use_proxy=yes -e http_proxy=#{http_proxy}" : nil
373
+ s = https_proxy ? "-e https_proxy=#{https_proxy}" : nil
374
+ p = http_proxy ? "-e http_proxy=#{http_proxy}" : nil
375
+ n = no_proxy ? "-e no_proxy=#{no_proxy}" : nil
376
+ p || s ? "-e use_proxy=yes #{p} #{s} #{n}" : nil
367
377
  end
368
378
 
369
379
  def http_proxy
370
380
  config[:http_proxy]
371
381
  end
372
382
 
383
+ def https_proxy
384
+ config[:https_proxy]
385
+ end
386
+
387
+ def no_proxy
388
+ config[:no_proxy]
389
+ end
390
+
373
391
  def chef_url
374
392
  config[:chef_bootstrap_url]
375
393
  end
@@ -78,6 +78,7 @@ module Kitchen
78
78
 
79
79
  default_config :http_proxy, nil
80
80
  default_config :https_proxy, nil
81
+ default_config :no_proxy, nil
81
82
 
82
83
  default_config :ignored_paths_from_root, ['spec']
83
84
  default_config :hiera_data_remote_path, '/var/lib/hiera'
@@ -431,6 +432,7 @@ module Kitchen
431
432
  echo '-----> Installing Chef Omnibus to install busser to run tests'
432
433
  #{export_http_proxy_parm}
433
434
  #{export_https_proxy_parm}
435
+ #{export_no_proxy_parm}
434
436
  do_download #{chef_url} /tmp/install.sh
435
437
  #{sudo('sh')} /tmp/install.sh
436
438
  fi
@@ -450,6 +452,7 @@ module Kitchen
450
452
  echo "-----> Installing Puppet Omnibus"
451
453
  #{export_http_proxy_parm}
452
454
  #{export_https_proxy_parm}
455
+ #{export_no_proxy_parm}
453
456
  do_download #{config[:puppet_omnibus_url]} /tmp/install_puppet.sh
454
457
  #{sudo_env('sh')} /tmp/install_puppet.sh #{version}
455
458
  fi
@@ -938,7 +941,8 @@ module Kitchen
938
941
  def sudo_env(pm)
939
942
  s = https_proxy ? "https_proxy=#{https_proxy}" : nil
940
943
  p = http_proxy ? "http_proxy=#{http_proxy}" : nil
941
- p || s ? "#{sudo('env')} #{p} #{s} #{pm}" : sudo(pm).to_s
944
+ n = no_proxy ? "no_proxy=#{no_proxy}" : nil
945
+ p || s ? "#{sudo('env')} #{p} #{s} #{n} #{pm}" : sudo(pm).to_s
942
946
  end
943
947
 
944
948
  def remove_puppet_repo
@@ -1057,13 +1061,16 @@ module Kitchen
1057
1061
  end
1058
1062
 
1059
1063
  def gem_proxy_parm
1060
- http_proxy ? "--http-proxy #{http_proxy}" : nil
1064
+ p = http_proxy ? "--http-proxy #{http_proxy}" : nil
1065
+ n = no_proxy ? "--no-http-proxy #{no_proxy}" : nil
1066
+ p || n ? "#{p} #{n}" : nil
1061
1067
  end
1062
1068
 
1063
1069
  def wget_proxy_parm
1064
1070
  p = http_proxy ? "-e http_proxy=#{http_proxy}" : nil
1065
1071
  s = https_proxy ? "-e https_proxy=#{https_proxy}" : nil
1066
- p || s ? "-e use_proxy=yes #{p} #{s}" : nil
1072
+ n = no_proxy ? "-e no_proxy=#{no_proxy}" : nil
1073
+ p || s ? "-e use_proxy=yes #{p} #{s} #{n}" : nil
1067
1074
  end
1068
1075
 
1069
1076
  def posh_proxy_parm
@@ -1084,6 +1091,10 @@ module Kitchen
1084
1091
  https_proxy ? "export https_proxy=#{https_proxy}" : nil
1085
1092
  end
1086
1093
 
1094
+ def export_no_proxy_parm
1095
+ no_proxy ? "export no_proxy=#{no_proxy}" : nil
1096
+ end
1097
+
1087
1098
  def http_proxy
1088
1099
  config[:http_proxy]
1089
1100
  end
@@ -1092,6 +1103,10 @@ module Kitchen
1092
1103
  config[:https_proxy]
1093
1104
  end
1094
1105
 
1106
+ def no_proxy
1107
+ config[:no_proxy]
1108
+ end
1109
+
1095
1110
  def chef_url
1096
1111
  config[:chef_bootstrap_url]
1097
1112
  end
@@ -1151,38 +1166,50 @@ module Kitchen
1151
1166
 
1152
1167
  FileUtils.mkdir_p(tmpmodules_dir)
1153
1168
  resolve_with_librarian if File.exist?(puppetfile) && config[:resolve_with_librarian_puppet]
1169
+ modules_to_copy = {}
1154
1170
 
1155
- if modules && modules.include?(':')
1156
- debug('Found multiple directories in module path merging.....')
1171
+ # If root dir (.) is a module, add it for copying
1172
+ self_name = read_self_module_name
1173
+ modules_to_copy[self_name] = '.' if self_name
1174
+
1175
+ if modules
1157
1176
  modules_array = modules.split(':')
1158
- modules_array.each do |m|
1159
- copy_modules(m, tmpmodules_dir)
1177
+ modules_array.each do |m_path|
1178
+ Dir.glob("#{m_path}/*").each do |m|
1179
+ name = File.basename(m)
1180
+ if modules_to_copy.include? name
1181
+ debug("Found duplicated module: #{name}. The path taking precedence: '#{modules_to_copy[name]}', ignoring '#{m}'")
1182
+ else
1183
+ modules_to_copy[name] = m
1184
+ end
1185
+ end
1160
1186
  end
1161
- elsif modules
1162
- copy_modules(modules, tmpmodules_dir)
1163
- else
1164
- info 'nothing to do for modules'
1165
1187
  end
1166
1188
 
1167
- copy_self_as_module
1189
+ if modules_to_copy.empty?
1190
+ info 'Nothing to do for modules'
1191
+ else
1192
+ copy_modules(modules_to_copy, tmpmodules_dir)
1193
+ end
1168
1194
  end
1169
1195
 
1170
- def copy_modules(source, destination)
1171
- return unless File.directory?(source)
1172
-
1173
- debug("Copying modules from #{source} to #{destination}")
1174
-
1196
+ def copy_modules(modules, destination)
1175
1197
  excluded_paths = %w(modules pkg) + config[:ignored_paths_from_root]
1176
-
1177
- Dir.glob("#{source}/*").each do |f|
1178
- module_name = File.basename(f)
1179
- target = "#{destination}/#{module_name}"
1198
+ debug("Copying modules to directory: #{destination}")
1199
+ modules.each do |name, source|
1200
+ next unless File.directory?(source)
1201
+ debug("Copying module #{name} from #{source}...")
1202
+ target = "#{destination}/#{name}"
1180
1203
  FileUtils.mkdir_p(target) unless File.exist? target
1181
- FileUtils.cp_r(Dir.glob("#{source}/#{module_name}/*").reject { |entry| entry =~ /#{excluded_paths.join('$|')}$/ }, target, remove_destination: true)
1204
+ FileUtils.cp_r(
1205
+ Dir.glob("#{source}/*").reject { |entry| entry =~ /#{excluded_paths.join('$|')}$/ },
1206
+ target,
1207
+ remove_destination: true
1208
+ )
1182
1209
  end
1183
1210
  end
1184
1211
 
1185
- def copy_self_as_module
1212
+ def read_self_module_name
1186
1213
  if File.exist?(modulefile)
1187
1214
  warn('Modulefile found but this is deprecated, ignoring it, see https://tickets.puppetlabs.com/browse/PUP-1188')
1188
1215
  end
@@ -1192,20 +1219,10 @@ module Kitchen
1192
1219
  begin
1193
1220
  module_name = JSON.parse(IO.read(metadata_json))['name'].split('-').last
1194
1221
  rescue
1195
- error("not able to load or parse #{metadata_json_path} for the name of the module")
1222
+ error("not able to load or parse #{metadata_json} for the name of the module")
1196
1223
  end
1197
1224
 
1198
- return unless module_name
1199
- module_target_path = File.join(sandbox_path, 'modules', module_name)
1200
- FileUtils.mkdir_p(module_target_path)
1201
-
1202
- excluded_paths = %w(modules pkg) + config[:ignored_paths_from_root]
1203
-
1204
- FileUtils.cp_r(
1205
- Dir.glob(File.join(config[:kitchen_root], '*')).reject { |entry| entry =~ /#{excluded_paths.join('$|')}$/ },
1206
- module_target_path,
1207
- remove_destination: true
1208
- )
1225
+ module_name
1209
1226
  end
1210
1227
 
1211
1228
  def prepare_puppet_config
@@ -62,6 +62,7 @@ manifest | 'site.pp' | manifest for puppet apply to run
62
62
  manifests_path | | puppet repo manifests directory
63
63
  max_retries| 1 | maximum number of retry attempts of converge command
64
64
  modules_path | | puppet repo manifests directory. Can be multiple directories separated by colons and then they will be merged
65
+ no_proxy | nil | list of URLs or IPs that should be excluded from proxying
65
66
  platform | platform_name kitchen.yml parameter | OS platform of server
66
67
  puppet_apply_command | nil | Overwrite the puppet apply command. Needs "sudo -E puppet apply" as a prefix.
67
68
  puppet_apt_repo | "http://apt.puppetlabs.com/puppetlabs-release-precise.deb"| apt repo Ubuntu12 see https://apt.puppetlabs.com for others
@@ -227,6 +228,8 @@ puppet_agent_command | nil | Overwrite the puppet agent command. Needs "sudo -E
227
228
  require_chef_for_busser | true | Install chef as currently needed by busser to run tests. NOTE: kitchen 1.4 only requires ruby to run busser so this is not required.
228
229
  puppet_config_path | | path of custom puppet.conf file
229
230
  http_proxy | nil | use http proxy when installing puppet and packages
231
+ https_proxy | nil | use https proxy when installing puppet and packages
232
+ no_proxy | nil | list of URLs or IPs that should be excluded from proxying
230
233
  ignore_spec_fixtures | | ignore spec/fixtures directory
231
234
 
232
235
  NOTE: Puppet Collections Support not in puppet agent yet
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kitchen-puppet
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.47.2
4
+ version: 1.47.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Neill Turner
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-02-24 00:00:00.000000000 Z
11
+ date: 2017-03-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: test-kitchen
@@ -80,7 +80,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
80
80
  version: '0'
81
81
  requirements: []
82
82
  rubyforge_project: "[none]"
83
- rubygems_version: 2.2.2
83
+ rubygems_version: 2.4.5.1
84
84
  signing_key:
85
85
  specification_version: 4
86
86
  summary: puppet provisioner for test-kitchen