provider/triton: Add metadata key for cloud-init

Under joyent/triton, the cloud-init cloud-config data actually comes out
of a key called cloud-init:user-data, as opposed to to the standard
user-data. This will make it possible to send the cloud-config data to
triton machines.

Documentation reference: https://docs.joyent.com/public-cloud/instances/virtual-machines/images/linux/ubuntu-certified#cloud-init-examples
This commit is contained in:
Brian Cervenka 2017-03-17 18:03:39 -07:00 committed by James Nugent
parent 8ec67413be
commit 93a0bad923
2 changed files with 10 additions and 0 deletions

View File

@ -23,6 +23,7 @@ var (
"user_script": "user-script",
"user_data": "user-data",
"administrator_pw": "administrator-pw",
"cloud_config": "cloud-init:user-data",
}
)
@ -182,6 +183,12 @@ func resourceMachine() *schema.Resource {
Optional: true,
Computed: true,
},
"cloud_config": {
Description: "copied to machine on boot",
Type: schema.TypeString,
Optional: true,
Computed: true,
},
"user_data": {
Description: "Data copied to machine on boot",
Type: schema.TypeString,

View File

@ -77,6 +77,9 @@ The following arguments are supported:
* `administrator_pw` - (string)
The initial password for the Administrator user. Only used for Windows virtual machines.
* `cloud_config` - (string)
Populate the cloud-init:user-data field. Cloud config data to pass to the instance. Traditionally user-data is used, however joyent uses that key for their own purposes. At least on ubuntu cloud-init, it expects the cloud_config to be in cloud-init:user-data instead of just user-data.
The nested `nic` block supports the following:
* `network` - (string, Optional)
The network id to attach to the network interface. It will be hex, in the format: `xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx`.