Use knife vsphere plugin command directly in my recipe


#1

Hello guys,
I’m using knife vsphere plugin to take virtual machine snapshot,
it successfully work in command line,
i want now use it directly in a recipe, is it possible ?
i’ve got error "FATAL: Cookbook file has a ruby syntax error:"
i looked for a documentation about that but i didnt find anything.
Thanks for your help!


#2

i finally ran it using bash command
bash ‘snapshot_vmchefnode’ do
user 'root’
cwd '/root/chef-repo/'
code <<-EOH
myknifecommand
EOH
end