Class: Kitchen::Provisioner::PolicyfileZero
- Inherits:
-
ChefBase
- Object
- ChefBase
- Kitchen::Provisioner::PolicyfileZero
- Defined in:
- lib/kitchen/provisioner/policyfile_zero.rb
Overview
Policyfile + Chef Zero provisioner.
Instance Method Summary collapse
- #create_sandbox ⇒ Object
-
#finalize_config!(*args) ⇒ Object
Emit a warning that Policyfile stuff is still experimental.
- #run_command ⇒ Object
Instance Method Details
#create_sandbox ⇒ Object
67 68 69 70 71 72 |
# File 'lib/kitchen/provisioner/policyfile_zero.rb', line 67 def create_sandbox super prepare_cookbooks prepare_validation_pem prepare_client_rb end |
#finalize_config!(*args) ⇒ Object
Emit a warning that Policyfile stuff is still experimental.
(see Base#finalize_config!)
59 60 61 62 63 64 |
# File 'lib/kitchen/provisioner/policyfile_zero.rb', line 59 def finalize_config!(*args) super ("Using experimental policyfile mode for chef-client") warn("The Policyfile feature is under active development.") warn("For best results, always use the latest chef-client version") end |
#run_command ⇒ Object
75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 |
# File 'lib/kitchen/provisioner/policyfile_zero.rb', line 75 def run_command level = config[:log_level] == :info ? :auto : config[:log_level] chef_client_bin = sudo(config[:chef_client_path]) cmd = "#{chef_client_bin} --local-mode" args = [ "--config #{config[:root_path]}/client.rb", "--log_level #{level}", "--force-formatter", "--no-color" ] if config[:chef_zero_port] args << "--chef-zero-port #{config[:chef_zero_port]}" end if config[:log_file] args << "--logfile #{config[:log_file]}" end wrap_shell_code( [cmd, *args].join(" "). tap { |str| str.insert(0, reload_ps1_path) if windows_os? } ) end |