kitchen-puppet 1.38.1 → 1.39.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/kitchen-puppet/version.rb +1 -1
- data/lib/kitchen/provisioner/puppet_apply.rb +43 -2
- data/provisioner_options.md +4 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cad0cbe145792a2fcf342705612af96281936da5
|
4
|
+
data.tar.gz: 7d16b7aaeb91ab2f9131008d2e901e6161476f09
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 11ed24fe6cc60b777f5b60164a964751980cbbb45c6aad4ea159ef2740a6192169180404e06396ffcd973d00b60a78ef61dd24fd23cc634a8ba848b18d89aef0
|
7
|
+
data.tar.gz: e408a68f06dabc580cd5e7856eb4697ce5d85d87a8549139762ce4c502ae46c399d775cb823283842ce1b31cce5ad8fc5a44751723b7804c9b80f1aee9b95b3e
|
@@ -64,6 +64,9 @@ module Kitchen
|
|
64
64
|
default_config :puppet_logdest, nil
|
65
65
|
default_config :custom_install_command, nil
|
66
66
|
default_config :puppet_whitelist_exit_code, nil
|
67
|
+
default_config :require_puppet_omnibus, false
|
68
|
+
default_config :puppet_omnibus_url, 'https://raw.githubusercontent.com/petems/puppet-install-shell/master/install_puppet.sh'
|
69
|
+
default_config :puppet_enc, nil
|
67
70
|
|
68
71
|
default_config :puppet_apply_command, nil
|
69
72
|
|
@@ -165,9 +168,12 @@ module Kitchen
|
|
165
168
|
end
|
166
169
|
end
|
167
170
|
|
171
|
+
# rubocop:disable Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity
|
168
172
|
def install_command
|
169
|
-
return unless config[:require_puppet_collections] || config[:require_puppet_repo]
|
170
|
-
if config[:
|
173
|
+
return unless config[:require_puppet_collections] || config[:require_puppet_repo] || config[:require_puppet_omnibus]
|
174
|
+
if config[:require_puppet_omnibus]
|
175
|
+
install_omnibus_command
|
176
|
+
elsif config[:require_puppet_collections]
|
171
177
|
install_command_collections
|
172
178
|
else
|
173
179
|
case puppet_platform
|
@@ -229,6 +235,7 @@ module Kitchen
|
|
229
235
|
end
|
230
236
|
end
|
231
237
|
end
|
238
|
+
# rubocop:enable Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity
|
232
239
|
|
233
240
|
def install_command_collections
|
234
241
|
case puppet_platform
|
@@ -332,6 +339,20 @@ module Kitchen
|
|
332
339
|
INSTALL
|
333
340
|
end
|
334
341
|
|
342
|
+
def install_omnibus_command
|
343
|
+
info('Installing puppet using puppet omnibus')
|
344
|
+
<<-INSTALL
|
345
|
+
#{Util.shell_helpers}
|
346
|
+
if [ ! $(which puppet) ]; then
|
347
|
+
echo "-----> Installing Puppet Omnibus"
|
348
|
+
#{export_http_proxy_parm}
|
349
|
+
#{export_https_proxy_parm}
|
350
|
+
do_download #{config[:puppet_omnibus_url]} /tmp/install_puppet.sh
|
351
|
+
#{sudo_env('sh')} /tmp/install_puppet.sh
|
352
|
+
fi
|
353
|
+
INSTALL
|
354
|
+
end
|
355
|
+
|
335
356
|
def install_hiera
|
336
357
|
return unless config[:install_hiera]
|
337
358
|
<<-INSTALL
|
@@ -410,6 +431,7 @@ module Kitchen
|
|
410
431
|
prepare_hiera_config
|
411
432
|
prepare_fileserver_config
|
412
433
|
prepare_hiera_data
|
434
|
+
prepare_enc
|
413
435
|
prepare_spec_files
|
414
436
|
info('Finished Preparing files for transfer')
|
415
437
|
end
|
@@ -516,6 +538,12 @@ module Kitchen
|
|
516
538
|
].join(' ')
|
517
539
|
end
|
518
540
|
|
541
|
+
if config[:puppet_enc]
|
542
|
+
commands << [
|
543
|
+
sudo('chmod 755'), File.join("#{config[:root_path]}/enc", File.basename(config[:puppet_enc]))
|
544
|
+
].join(' ')
|
545
|
+
end
|
546
|
+
|
519
547
|
command = commands.join(' && ')
|
520
548
|
debug(command)
|
521
549
|
command
|
@@ -537,6 +565,7 @@ module Kitchen
|
|
537
565
|
custom_options,
|
538
566
|
puppet_environment_flag,
|
539
567
|
puppet_noop_flag,
|
568
|
+
puppet_enc_flag,
|
540
569
|
puppet_detailed_exitcodes_flag,
|
541
570
|
puppet_verbose_flag,
|
542
571
|
puppet_debug_flag,
|
@@ -778,6 +807,10 @@ module Kitchen
|
|
778
807
|
bash_vars
|
779
808
|
end
|
780
809
|
|
810
|
+
def puppet_enc_flag
|
811
|
+
config[:puppet_enc] ? '--node_terminus=exec --external_nodes=/tmp/kitchen/enc' : nil
|
812
|
+
end
|
813
|
+
|
781
814
|
def puppet_detailed_exitcodes_flag
|
782
815
|
config[:puppet_detailed_exitcodes] ? '--detailed-exitcodes' : nil
|
783
816
|
end
|
@@ -982,6 +1015,14 @@ module Kitchen
|
|
982
1015
|
FileUtils.cp_r(puppet_config, File.join(sandbox_path, 'puppet.conf'))
|
983
1016
|
end
|
984
1017
|
|
1018
|
+
def prepare_enc
|
1019
|
+
return unless config[:puppet_enc]
|
1020
|
+
info 'Copying enc file'
|
1021
|
+
enc_dir = File.join(sandbox_path, 'enc')
|
1022
|
+
FileUtils.mkdir_p(enc_dir)
|
1023
|
+
FileUtils.cp_r(config[:puppet_enc], enc_dir)
|
1024
|
+
end
|
1025
|
+
|
985
1026
|
def prepare_hiera_config
|
986
1027
|
return unless hiera_config
|
987
1028
|
|
data/provisioner_options.md
CHANGED
@@ -57,7 +57,10 @@ puppet_logdest | nil | _Array_ of log destinations. Include 'console' if wanted
|
|
57
57
|
custom_options | | custom options to add to puppet apply command.
|
58
58
|
custom_install_command | nil | Custom shell command to be used at install stage. Can be multiline. See examples below.
|
59
59
|
puppet_whitelist_exit_code | nil | Whitelist exit code expected from puppet run. Intended to be used together with `puppet_detailed_exitcodes`.
|
60
|
-
|
60
|
+
require_puppet_omnibus | false | Set if using omnibus puppet install
|
61
|
+
puppet_omnibus_url | https://raw.githubusercontent.com/ petems/puppet-install-shell/ master/install_puppet.sh | omnibus puppet v3 install location.
|
62
|
+
_for puppet v4 change to_ | https://raw.githubusercontent.com/ petems/puppet-install-shell/ master/install_puppet_agent.sh |
|
63
|
+
puppet_enc | | path for external node classifier script
|
61
64
|
|
62
65
|
## Puppet Apply Configuring Provisioner Options
|
63
66
|
|
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.
|
4
|
+
version: 1.39.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Neill Turner
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-04-
|
11
|
+
date: 2016-04-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: test-kitchen
|