Skip to content

Commit

Permalink
Add support for attaching Block Storage Volume to the droplet
Browse files Browse the repository at this point in the history
  • Loading branch information
estevesd committed Jun 7, 2017
1 parent 8e66190 commit 1849921
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,8 @@ The following attributes are available to further configure the provider:
* A boolean indicating whether to install the DigitalOcean agent for monitoring. It defaults to `false`.
- `provider.tags`
* A flat array of tag names as strings to apply to the Droplet after it is created. Tag names can either be existing or new tags.
- `provider.volumes`
* A flat array including the unique identifier for each Block Storage volume attached to the Droplet.
- `config.vm.synced_folder`
* Supports both rsync__args and rsync__exclude, see the [Vagrant Docs](http://docs.vagrantup.com/v2/synced-folders/rsync.html) for more information. rsync__args default to `["--verbose", "--archive", "--delete", "-z", "--copy-links"]` and rsync__exclude defaults to `[".vagrant/"]`.

Expand Down
3 changes: 2 additions & 1 deletion lib/vagrant-digitalocean/actions/create.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ def call(env)
:ipv6 => @machine.provider_config.ipv6,
:user_data => @machine.provider_config.user_data,
:monitoring => @machine.provider_config.monitoring,
:tags => @machine.provider_config.tags
:tags => @machine.provider_config.tags,
:volumes => @machine.provider_config.volumes
}.delete_if { |k, v| v.nil? })

# wait for request to complete
Expand Down
3 changes: 3 additions & 0 deletions lib/vagrant-digitalocean/config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ class Config < Vagrant.plugin('2', :config)
attr_accessor :user_data
attr_accessor :monitoring
attr_accessor :tags
attr_accessor :volumes

alias_method :setup?, :setup

Expand All @@ -31,6 +32,7 @@ def initialize
@user_data = UNSET_VALUE
@monitoring = UNSET_VALUE
@tags = UNSET_VALUE
@volumes = UNSET_VALUE
end

def finalize!
Expand All @@ -47,6 +49,7 @@ def finalize!
@user_data = nil if @user_data == UNSET_VALUE
@monitoring = false if @monitoring == UNSET_VALUE
@tags = nil if @tags == UNSET_VALUE
@volumes = nil if @volumes == UNSET_VALUE
end

def validate(machine)
Expand Down

0 comments on commit 1849921

Please sign in to comment.