Class: Kitchen::Provisioner::Itamae
- Inherits:
-
Base
- Object
- Base
- Kitchen::Provisioner::Itamae
- Defined in:
- lib/kitchen/provisioner/itamae.rb
Instance Method Summary collapse
Instance Method Details
#create_sandbox ⇒ Object
27 28 29 30 |
# File 'lib/kitchen/provisioner/itamae.rb', line 27 def create_sandbox super FileUtils.cp_r(Dir.glob("#{config[:itamae_root]}/*"), sandbox_path) end |
#init_command ⇒ Object
33 34 35 36 37 38 39 40 41 |
# File 'lib/kitchen/provisioner/itamae.rb', line 33 def init_command cmd = [] cmd << "#{sudo("rm")} -rf #{config[:root_path]} ; mkdir -p #{config[:root_path]}" debug("Cleanup Kitchen Root") config[:itamae_plugins].map do |plugin| cmd << %Q{#{sudo('chef-apply')} -e "chef_gem %Q{itamae-plugin-recipe-#{plugin}} do action :upgrade end"} end Util.wrap_command(cmd.join("\n")) end |
#install_command ⇒ Object
61 62 63 64 65 |
# File 'lib/kitchen/provisioner/itamae.rb', line 61 def install_command return unless config[:parasite_chef_omnibus] lines = [Util.shell_helpers, download_helpers, chef_helpers, chef_install_function, itamae_install_function] Util.wrap_command(lines.join("\n")) end |
#run_command ⇒ Object
44 45 46 47 48 49 50 51 52 53 54 55 56 57 |
# File 'lib/kitchen/provisioner/itamae.rb', line 44 def run_command debug(JSON.pretty_generate(config)) runlist = config[:run_list].map do |recipe| cmd = ["cd #{config[:root_path]};", sudo('/opt/chef/bin/itamae')] cmd << 'local' cmd << '--ohai' if config[:with_ohai] cmd << config[:itamae_option] cmd << "-j #{config[:node_json]}" if config[:node_json] cmd << recipe cmd.join(" ") end debug(runlist.join("\n")) Util.wrap_command(runlist.join("\n")) end |