Merge pull request #1920 from nickanderson/feature/custom_cf_package_name

Feature/custom cf package name
This commit is contained in:
Mitchell Hashimoto 2013-07-16 16:36:22 -07:00
commit 76a91d424c
4 changed files with 9 additions and 3 deletions

View File

@ -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

View File

@ -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

View File

@ -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)

View File

@ -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