From a4597fcd9d02405d12ee748c9265f3ee68c44aba Mon Sep 17 00:00:00 2001 From: Nick Anderson Date: Mon, 17 Jun 2013 09:17:11 +0200 Subject: [PATCH 1/2] Update bootstrap symantecs CFEngine 3.5 bootstrap removed the policy-server option http://cfengine.com/blog/cfengine-is-very-easy-to-install-and-now-so-is-bootstrapping --- plugins/provisioners/cfengine/provisioner.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/provisioners/cfengine/provisioner.rb b/plugins/provisioners/cfengine/provisioner.rb index 614289734..f9a60676a 100644 --- a/plugins/provisioners/cfengine/provisioner.rb +++ b/plugins/provisioners/cfengine/provisioner.rb @@ -87,7 +87,7 @@ module VagrantPlugins @machine.ui.info(I18n.t("vagrant.cfengine_bootstrapping", policy_server: policy_server_address)) - result = cfagent("--bootstrap --policy-server #{policy_server_address}", error_check: false) + result = cfagent("--bootstrap #{policy_server_address}", error_check: false) raise Vagrant::Errors::CFEngineBootstrapFailed if result != 0 # Policy hubs need to do additional things before they're ready From 79e5298e706d534e3c9dc9bd4c66fefd2bfce0a4 Mon Sep 17 00:00:00 2001 From: Nick Anderson Date: Fri, 12 Jul 2013 10:47:13 -0500 Subject: [PATCH 2/2] Add ability to specify custom cfengine pacakge name This is intended to allow adding support for installing CFEngine Enterprise. --- .../provisioners/cfengine/cap/debian/cfengine_install.rb | 2 +- .../provisioners/cfengine/cap/redhat/cfengine_install.rb | 2 +- plugins/provisioners/cfengine/config.rb | 6 ++++++ 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/plugins/provisioners/cfengine/cap/debian/cfengine_install.rb b/plugins/provisioners/cfengine/cap/debian/cfengine_install.rb index f57522abf..57c235654 100644 --- a/plugins/provisioners/cfengine/cap/debian/cfengine_install.rb +++ b/plugins/provisioners/cfengine/cap/debian/cfengine_install.rb @@ -9,7 +9,7 @@ module VagrantPlugins comm.sudo("GPGFILE=`tempfile`; wget -O $GPGFILE #{config.repo_gpg_key_url} && apt-key add $GPGFILE; rm -f $GPGFILE") comm.sudo("apt-get update") - comm.sudo("apt-get install -y cfengine-community") + comm.sudo("apt-get install -y #{config.package_name}") end end end diff --git a/plugins/provisioners/cfengine/cap/redhat/cfengine_install.rb b/plugins/provisioners/cfengine/cap/redhat/cfengine_install.rb index 820886f4d..828b336d6 100644 --- a/plugins/provisioners/cfengine/cap/redhat/cfengine_install.rb +++ b/plugins/provisioners/cfengine/cap/redhat/cfengine_install.rb @@ -14,7 +14,7 @@ module VagrantPlugins logger.info("Installing CFEngine Community Yum Repository GPG KEY from #{config.repo_gpg_key_url}") comm.sudo("GPGFILE=$(mktemp) && wget -O $GPGFILE #{config.repo_gpg_key_url} && rpm --import $GPGFILE; rm -f $GPGFILE") - comm.sudo("yum -y install cfengine-community") + comm.sudo("yum -y install #{config.package_name}") end end end diff --git a/plugins/provisioners/cfengine/config.rb b/plugins/provisioners/cfengine/config.rb index 9ecff81dd..5d3cd3f02 100644 --- a/plugins/provisioners/cfengine/config.rb +++ b/plugins/provisioners/cfengine/config.rb @@ -20,6 +20,7 @@ module VagrantPlugins attr_accessor :upload_path attr_accessor :yum_repo_file attr_accessor :yum_repo_url + attr_accessor :package_name def initialize @am_policy_hub = UNSET_VALUE @@ -37,6 +38,7 @@ module VagrantPlugins @upload_path = UNSET_VALUE @yum_repo_file = UNSET_VALUE @yum_repo_url = UNSET_VALUE + @package_name = UNSET_VALUE end def finalize! @@ -81,6 +83,10 @@ module VagrantPlugins if @yum_repo_url == UNSET_VALUE @yum_repo_url = "http://cfengine.com/pub/yum/" end + + if @package_name == UNSET_VALUE + @package_name = "cfengine-community" + end end def validate(machine)