lib/vagrant-rackspace/config.rb in vagrant-rackspace-0.1.6 vs lib/vagrant-rackspace/config.rb in vagrant-rackspace-0.1.7

- old
+ new

@@ -58,10 +58,15 @@ # the key name could be provided. # # @return [String] attr_accessor :key_name + # A Hash of metadata that will be sent to the instance for configuration + # + # @return [Hash] + attr_accessor :metadata + # The option that indicates RackConnect usage or not. # # @return [Boolean] attr_accessor :rackconnect @@ -90,10 +95,15 @@ # Cloud Networks to attach to the server # # @return [Array] attr_accessor :networks + # Opt files/directories in to the rsync operation performed by this provider + # + # @return [Array] + attr_accessor :rsync_includes + # Default Rackspace Cloud Network IDs SERVICE_NET_ID = '11111111-1111-1111-1111-111111111111' PUBLIC_NET_ID = '00000000-0000-0000-0000-000000000000' def initialize @@ -107,10 +117,11 @@ @rackconnect = UNSET_VALUE @server_name = UNSET_VALUE @username = UNSET_VALUE @disk_config = UNSET_VALUE @networks = [] + @rsync_includes = [] end def finalize! @api_key = nil if @api_key == UNSET_VALUE @rackspace_region = nil if @rackspace_region == UNSET_VALUE @@ -118,13 +129,15 @@ @rackspace_auth_url = nil if @rackspace_auth_url == UNSET_VALUE @flavor = /512MB/ if @flavor == UNSET_VALUE @image = /Ubuntu/ if @image == UNSET_VALUE @rackconnect = nil if @rackconnect == UNSET_VALUE @server_name = nil if @server_name == UNSET_VALUE + @metadata = nil if @metadata == UNSET_VALUE @username = nil if @username == UNSET_VALUE @disk_config = nil if @disk_config == UNSET_VALUE @networks = nil if @networks.empty? + @rsync_includes = nil if @rsync_includes.empty? if @public_key_path == UNSET_VALUE @public_key_path = Vagrant.source_root.join("keys/vagrant.pub") end end @@ -155,9 +168,13 @@ if options[:attached] @networks << net_id unless @networks.include? net_id else @networks.delete net_id end + end + + def rsync_include(inc) + @rsync_includes << inc end def validate(machine) errors = _detected_errors