Add ability to specify custom cfengine pacakge name

This is intended to allow adding support for installing CFEngine
Enterprise.
This commit is contained in:
Nick Anderson 2013-07-12 10:47:13 -05:00
parent c4c8042c0d
commit 79e5298e70
3 changed files with 8 additions and 2 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)