diff --git a/plugins/provisioners/chef/cap/suse/chef_install.rb b/plugins/provisioners/chef/cap/suse/chef_install.rb new file mode 100644 index 000000000..c6cedcefe --- /dev/null +++ b/plugins/provisioners/chef/cap/suse/chef_install.rb @@ -0,0 +1,27 @@ +require_relative "../../omnibus" + +module VagrantPlugins + module Chef + module Cap + module Suse + module ChefInstall + def self.chef_install(machine, project, version, channel, options = {}) + unless curl?(machine) + machine.communicate.sudo("zypper -n -q update") + machine.communicate.sudo("zypper -n -q install curl") + end + + command = Omnibus.sh_command(project, version, channel, options) + machine.communicate.sudo(command) + end + + protected + + def self.curl?(machine) + machine.communicate.test("/usr/bin/which -s curl") + end + end + end + end + end +end diff --git a/plugins/provisioners/chef/plugin.rb b/plugins/provisioners/chef/plugin.rb index f7af36138..48a51e031 100644 --- a/plugins/provisioners/chef/plugin.rb +++ b/plugins/provisioners/chef/plugin.rb @@ -78,6 +78,11 @@ module VagrantPlugins Cap::Redhat::ChefInstall end + guest_capability(:suse, :chef_install) do + require_relative "cap/suse/chef_install" + Cap::Suse::ChefInstall + end + guest_capability(:windows, :chef_install) do require_relative "cap/windows/chef_install" Cap::Windows::ChefInstall