From ecb6ebaf814794d5971130ca526d0c7d86e45258 Mon Sep 17 00:00:00 2001 From: "U-quartz\\Cory" Date: Wed, 25 Sep 2013 20:29:25 -0500 Subject: [PATCH] add cfengine provisioner suse install support --- .../cfengine/cap/suse/cfengine_install.rb | 17 +++++++++++++++++ plugins/provisioners/cfengine/plugin.rb | 5 +++++ 2 files changed, 22 insertions(+) create mode 100644 plugins/provisioners/cfengine/cap/suse/cfengine_install.rb diff --git a/plugins/provisioners/cfengine/cap/suse/cfengine_install.rb b/plugins/provisioners/cfengine/cap/suse/cfengine_install.rb new file mode 100644 index 000000000..278fe49a8 --- /dev/null +++ b/plugins/provisioners/cfengine/cap/suse/cfengine_install.rb @@ -0,0 +1,17 @@ +module VagrantPlugins + module CFEngine + module Cap + module SuSE + module CFEngineInstall + def self.cfengine_install(machine, config) + machine.communicate.tap do |comm| + comm.sudo("GPGFILE=$(mktemp) && wget -O $GPGFILE #{config.repo_gpg_key_url} && rpm --import $GPGFILE; rm -f $GPGFILE") + comm.sudo("zypper addrepo -t YUM #{config.yum_repo_url} cfengine-repository") + comm.sudo("zypper se #{config.package_name} && zypper -n install #{config.package_name}") + end + end + end + end + end + end +end diff --git a/plugins/provisioners/cfengine/plugin.rb b/plugins/provisioners/cfengine/plugin.rb index 7a0842ba5..4e1a7f093 100644 --- a/plugins/provisioners/cfengine/plugin.rb +++ b/plugins/provisioners/cfengine/plugin.rb @@ -33,6 +33,11 @@ module VagrantPlugins Cap::RedHat::CFEngineInstall end + guest_capability("suse", "cfengine_install") do + require_relative "cap/suse/cfengine_install" + Cap::SuSE::CFEngineInstall + end + provisioner(:cfengine) do require_relative "provisioner" Provisioner