kitchen-puppet 0.0.25 → 0.0.26
Sign up to get free protection for your applications and to get access to all the features.
@@ -56,6 +56,9 @@ module Kitchen
|
|
56
56
|
|
57
57
|
default_config :puppet_apply_command, nil
|
58
58
|
|
59
|
+
default_config :puppet_git_init, nil
|
60
|
+
default_config :puppet_git_pr, nil
|
61
|
+
|
59
62
|
default_config :http_proxy, nil
|
60
63
|
default_config :https_proxy, nil
|
61
64
|
|
@@ -336,6 +339,32 @@ module Kitchen
|
|
336
339
|
# rubocop:disable Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity
|
337
340
|
def prepare_command
|
338
341
|
commands = []
|
342
|
+
if puppet_git_init
|
343
|
+
commands << [
|
344
|
+
sudo('rm -rf'), '/etc/puppet'
|
345
|
+
].join(' ')
|
346
|
+
|
347
|
+
commands << [
|
348
|
+
sudo('git clone'), puppet_git_init, '/etc/puppet'
|
349
|
+
].join(' ')
|
350
|
+
end
|
351
|
+
|
352
|
+
if puppet_git_pr
|
353
|
+
commands << [
|
354
|
+
sudo('git'), '--git-dir=/etc/puppet/.git/',
|
355
|
+
'fetch -f',
|
356
|
+
'origin',
|
357
|
+
"pull/#{puppet_git_pr}/head:pr_#{puppet_git_pr}"
|
358
|
+
].join(' ')
|
359
|
+
|
360
|
+
commands << [
|
361
|
+
sudo('git'), '--git-dir=/etc/puppet/.git/',
|
362
|
+
'--work-tree=/etc/puppet/',
|
363
|
+
'checkout',
|
364
|
+
"pr_#{puppet_git_pr}"
|
365
|
+
].join(' ')
|
366
|
+
end
|
367
|
+
|
339
368
|
if puppet_config
|
340
369
|
commands << [
|
341
370
|
sudo('cp'),
|
@@ -471,6 +500,14 @@ module Kitchen
|
|
471
500
|
config[:puppet_environment]
|
472
501
|
end
|
473
502
|
|
503
|
+
def puppet_git_init
|
504
|
+
config[:puppet_git_init]
|
505
|
+
end
|
506
|
+
|
507
|
+
def puppet_git_pr
|
508
|
+
config[:puppet_git_pr]
|
509
|
+
end
|
510
|
+
|
474
511
|
def hiera_config
|
475
512
|
config[:hiera_config_path]
|
476
513
|
end
|
data/provisioner_options.md
CHANGED
@@ -24,6 +24,8 @@ hiera_data_remote_path | "/var/lib/hiera" | Hiera data directory on server
|
|
24
24
|
puppet_debug| false| Enable full debugging logging on puppet run
|
25
25
|
puppet_verbose| false| Extra information logging on puppet run
|
26
26
|
puppet_noop| false| puppet runs in a no-op or dry-run mode
|
27
|
+
puppet_git_init | nil | initialize puppet from GIT repository, e.g. "git@github.com:example/puppet-repo.git"
|
28
|
+
puppet_git_pr | nil | checkout specific Pull Request from repository specified in puppet_git_init, e.g. "324"
|
27
29
|
update_package_repos| true| update OS repository metadata
|
28
30
|
custom_facts| Hash.new | Hash to set the puppet facts before running puppet apply
|
29
31
|
install_custom_facts| false | Install custom facts to yaml file at "/tmp/kitchen/facter/kitchen.yaml"
|