puppet_litmus 0.8.2 → 0.9.0

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
  SHA256:
3
- metadata.gz: a527ba98485f1866beae52685328a36964eada2cf7b21ca16d3d17c6c066db9a
4
- data.tar.gz: 03be38057ea7e5c0798f4f9e960bf3b7b2332e0daf1562ede26de7937b7c00de
3
+ metadata.gz: 0b35af75cfb29a6b0d69af360963c915baf0858a65141b0f5cd0d737ef89ca87
4
+ data.tar.gz: ad7089e5bda00652105165a5e702667a0018c1900128905e62093966aedd5865
5
5
  SHA512:
6
- metadata.gz: 66dc6092d02bb1b6fb2fb29c20e31a2787f7bcde6a6a5b7ff2a36aedf6655dc3687bcfe0e04156fea5e51f43ba9530777af33d81f5b2a8fef29276ef93c923f5
7
- data.tar.gz: f418baa685a925dc5165a677add62266505cbb81408e438daa9ea792bf3596aef1dec2cd4c1b2c237dbe025b3e6effb73fcff0ff15397bb0c6964575c45ba555
6
+ metadata.gz: 3f5735b661f80558413f0a4df2f067992277253073e1713ddf651096d0fce951d349afc9d475ea839bb94ac990f071711028fc5d7ac05caa03e7c396e2e607c3
7
+ data.tar.gz: 58b8442ccc3d8be07d3c24376b5af0067bafbbce1ecf5faa3534089bdbed0cb6bb99236fc340c650a2c2ce0fd612a7651c40e360ec449d17bf50723963b970cf
@@ -27,6 +27,7 @@ module PuppetLitmus::Serverspec
27
27
  # :catch_changes [Boolean] exit status of 1 if there were changes.
28
28
  # :expect_failures [Boolean] doesnt return an exit code of non-zero if the apply failed.
29
29
  # :manifest_file_location [Path] The place on the target system.
30
+ # :hiera_config [Path] The path to the hiera.yaml configuration on the runner.
30
31
  # :prefix_command [String] prefixes the puppet apply command; eg "export LANGUAGE='ja'".
31
32
  # :debug [Boolean] run puppet apply with the debug flag.
32
33
  # :noop [Boolean] run puppet apply with the noop flag.
@@ -46,6 +47,7 @@ module PuppetLitmus::Serverspec
46
47
  end
47
48
  command_to_run = "#{opts[:prefix_command]} puppet apply #{manifest_file_location}"
48
49
  command_to_run += " --modulepath #{Dir.pwd}/spec/fixtures/modules" if target_node_name.nil? || target_node_name == 'localhost'
50
+ command_to_run += " --hiera_config='#{opts[:hiera_config]}'" unless opts[:hiera_config].nil?
49
51
  command_to_run += ' --detailed-exitcodes' if !opts[:catch_changes].nil? && (opts[:catch_changes] == true)
50
52
  command_to_run += ' --debug' if !opts[:debug].nil? && (opts[:debug] == true)
51
53
  command_to_run += ' --noop' if !opts[:noop].nil? && (opts[:noop] == true)
@@ -2,5 +2,5 @@
2
2
 
3
3
  # version of this gem
4
4
  module PuppetLitmus
5
- VERSION ||= '0.8.2'
5
+ VERSION ||= '0.9.0'
6
6
  end
@@ -22,6 +22,20 @@ RSpec.describe PuppetLitmus::Serverspec do
22
22
  end
23
23
  end
24
24
 
25
+ describe '.apply_manifest' do
26
+ context 'when specifying a hiera config' do
27
+ let(:manifest) { "include '::doot'" }
28
+ let(:result) { ['result' => { 'exit_code' => 0, 'stdout' => nil, 'stderr' => nil }] }
29
+ let(:command) { " puppet apply /bla.pp --modulepath #{Dir.pwd}/spec/fixtures/modules --hiera_config='/hiera.yaml'" }
30
+
31
+ it 'passes the --hiera_config flag if the :hiera_config opt is specified' do
32
+ expect(dummy_class).to receive(:create_manifest_file).with(manifest).and_return('/bla.pp')
33
+ expect(dummy_class).to receive(:run_command).with(command, nil, config: nil, inventory: nil).and_return(result)
34
+ dummy_class.apply_manifest(manifest, hiera_config: '/hiera.yaml')
35
+ end
36
+ end
37
+ end
38
+
25
39
  describe '.run_shell' do
26
40
  let(:command_to_run) { "puts 'doot'" }
27
41
  let(:result) { ['result' => { 'exit_code' => 0, 'stdout' => nil, 'stderr' => nil }] }
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: puppet_litmus
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.2
4
+ version: 0.9.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Puppet, Inc.
@@ -110,15 +110,16 @@ required_rubygems_version: !ruby/object:Gem::Requirement
110
110
  - !ruby/object:Gem::Version
111
111
  version: '0'
112
112
  requirements: []
113
- rubygems_version: 3.0.4
113
+ rubyforge_project:
114
+ rubygems_version: 2.7.6
114
115
  signing_key:
115
116
  specification_version: 4
116
117
  summary: Providing a simple command line tool for puppet content creators, to enable
117
118
  simple and complex test deployments.
118
119
  test_files:
119
120
  - spec/data/inventory.yaml
121
+ - spec/lib/puppet_litmus/serverspec_spec.rb
120
122
  - spec/lib/puppet_litmus/inventory_manipulation_spec.rb
121
123
  - spec/lib/puppet_litmus/rake_tasks_spec.rb
122
- - spec/lib/puppet_litmus/serverspec_spec.rb
123
124
  - spec/lib/puppet_litmus/version_spec.rb
124
125
  - spec/spec_helper.rb