kitchen-puppet 0.0.30 → 0.0.31

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: 5642be7475bf0630875b90636a565d6900b77ae7
4
- data.tar.gz: 5243d5d8468c4ca6ec654b2f58b0ca395dfe986a
3
+ metadata.gz: 3f972d0a87b1def1a969330b08fee33887823ba7
4
+ data.tar.gz: 536cd0b900f3e927578114c1fd62b1901ffe8df7
5
5
  SHA512:
6
- metadata.gz: bb5906e46ad8d73d14e3ebf14f08afe42b4ceebb912636cbe8eb7db8a1eb07533bdfa528790e0990a7fa784ef1499592d092257906f6dfd85ffd80ed78ed3a1b
7
- data.tar.gz: 1e2730f250b0d5dcd5746aeb18adff0fe627ac4d27c58434fa4ff4a0505a89e842d1aa40c444f33b3ccb3c44a8efd4f50bfb90b75cb1ec268944a4289c2c7150
6
+ metadata.gz: 791e698c2111a21c9afe7c3cd9a2c84c0e97beea6defd4379cdaa241f33db77c0ac1ebe1ad7346907e1abe31e3f051c555a04381dc001cf92ad19cf435dccfa4
7
+ data.tar.gz: 8620ff75720a0a8264b520b09fbdf71f1d2820719af142667a6744c09040252cda881998c15dc5a5f7bcb1e898a18a6b757168f04fd09f7d230d2d40e9c3abff
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Kitchen
4
4
  module Puppet
5
- VERSION = '0.0.30'
5
+ VERSION = '0.0.31'
6
6
  end
7
7
  end
@@ -116,6 +116,12 @@ module Kitchen
116
116
  provisioner.calculate_path('manifests', :directory)
117
117
  end
118
118
 
119
+ default_config :spec_files_path do |provisioner|
120
+ provisioner.calculate_path('spec', :directory)
121
+ end
122
+
123
+ default_config :spec_files_remote_path, '/etc/puppet/spec'
124
+
119
125
  default_config :puppet_debug, false
120
126
  default_config :puppet_verbose, false
121
127
  default_config :puppet_noop, false
@@ -359,7 +365,10 @@ module Kitchen
359
365
  def init_command
360
366
  dirs = %w(modules manifests files hiera hiera.yaml)
361
367
  .map { |dir| File.join(config[:root_path], dir) }.join(' ')
362
- cmd = "#{sudo('rm')} -rf #{dirs} #{hiera_data_remote_path} /etc/hiera.yaml #{puppet_dir}/hiera.yaml #{puppet_dir}/fileserver.conf;"
368
+ cmd = "#{sudo('rm')} -rf #{dirs} #{hiera_data_remote_path} \
369
+ /etc/hiera.yaml #{puppet_dir}/hiera.yaml \
370
+ #{spec_files_remote_path} \
371
+ #{puppet_dir}/fileserver.conf;"
363
372
  cmd += config[:puppet_environment] ? "#{sudo('rm')} -f #{File.join(puppet_dir, config[:puppet_environment])};" : ''
364
373
  cmd += " mkdir -p #{config[:root_path]}; #{sudo('mkdir')} -p #{puppet_dir}"
365
374
  debug(cmd)
@@ -378,6 +387,7 @@ module Kitchen
378
387
  prepare_hiera_config
379
388
  prepare_fileserver_config
380
389
  prepare_hiera_data
390
+ prepare_spec_files
381
391
  info('Finished Preparing files for transfer')
382
392
  end
383
393
 
@@ -471,6 +481,15 @@ module Kitchen
471
481
  ].join(' ')
472
482
  end
473
483
 
484
+ if spec_files_path && spec_files_remote_path
485
+ commands << [
486
+ sudo('mkdir -p'), spec_files_remote_path
487
+ ].join(' ')
488
+ commands << [
489
+ sudo('cp -r'), File.join(config[:root_path], 'spec/*'), spec_files_remote_path
490
+ ].join(' ')
491
+ end
492
+
474
493
  command = commands.join(' && ')
475
494
  debug(command)
476
495
  command
@@ -694,6 +713,14 @@ module Kitchen
694
713
  config[:remove_puppet_repo]
695
714
  end
696
715
 
716
+ def spec_files_path
717
+ config[:spec_files_path]
718
+ end
719
+
720
+ def spec_files_remote_path
721
+ config[:spec_files_remote_path]
722
+ end
723
+
697
724
  def facterlib
698
725
  return nil if config[:facterlib].nil?
699
726
  bash_vars = "export FACTERLIB='#{config[:facterlib]}';"
@@ -828,7 +855,7 @@ module Kitchen
828
855
  module_target_path = File.join(sandbox_path, 'modules', module_name)
829
856
  FileUtils.mkdir_p(module_target_path)
830
857
  FileUtils.cp_r(
831
- Dir.glob(File.join(config[:kitchen_root], '*')).reject { |entry| entry =~ /modules$/ },
858
+ Dir.glob(File.join(config[:kitchen_root], '*')).reject { |entry| entry =~ /modules$|spec$|pkg$/ },
832
859
  module_target_path,
833
860
  remove_destination: true
834
861
  )
@@ -875,6 +902,15 @@ module Kitchen
875
902
  FileUtils.cp_r(Dir.glob("#{hiera_eyaml_key_path}/*"), tmp_hiera_key_dir)
876
903
  end
877
904
 
905
+ def prepare_spec_files
906
+ return unless spec_files_path
907
+ info('Preparing spec files')
908
+ tmp_spec_dir = File.join(sandbox_path, 'spec')
909
+ debug("Copying specs from #{spec_files_path} to #{tmp_spec_dir}")
910
+ FileUtils.mkdir_p(tmp_spec_dir)
911
+ FileUtils.cp_r(Dir.glob("#{spec_files_path}/*"), tmp_spec_dir)
912
+ end
913
+
878
914
  def resolve_with_librarian
879
915
  Kitchen.mutex.synchronize do
880
916
  ENV['SSL_CERT_FILE'] = librarian_puppet_ssl_file if librarian_puppet_ssl_file
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: 0.0.30
4
+ version: 0.0.31
5
5
  platform: ruby
6
6
  authors:
7
7
  - Neill Turner
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-08-15 00:00:00.000000000 Z
11
+ date: 2015-08-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: test-kitchen