builder/digitalocean: user data support [GH-2113]

This commit is contained in:
Mitchell Hashimoto 2015-06-10 19:29:48 -07:00
parent c9c9e2871c
commit 5cfd26a0d3
3 changed files with 4 additions and 0 deletions

View File

@ -26,6 +26,7 @@ type Config struct {
PrivateNetworking bool `mapstructure:"private_networking"`
SnapshotName string `mapstructure:"snapshot_name"`
DropletName string `mapstructure:"droplet_name"`
UserData string `mapstructure:"user_data"`
SSHUsername string `mapstructure:"ssh_username"`
SSHPort uint `mapstructure:"ssh_port"`

View File

@ -31,6 +31,7 @@ func (s *stepCreateDroplet) Run(state multistep.StateBag) multistep.StepAction {
godo.DropletCreateSSHKey{ID: int(sshKeyId)},
},
PrivateNetworking: c.PrivateNetworking,
UserData: c.UserData,
})
if err != nil {
err := fmt.Errorf("Error creating droplet: %s", err)

View File

@ -67,6 +67,8 @@ each category, the available configuration keys are alphabetized.
for a droplet to enter a desired state (such as "active") before
timing out. The default state timeout is "6m".
* `user_data` (string) - User data to launch with the Droplet.
## Basic Example
Here is a basic example. It is completely valid as soon as you enter your