From 93a0bad9239afc527c4296f3a970f1d053b909ce Mon Sep 17 00:00:00 2001 From: Brian Cervenka Date: Fri, 17 Mar 2017 18:03:39 -0700 Subject: [PATCH] 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 --- builtin/providers/triton/resource_machine.go | 7 +++++++ .../docs/providers/triton/r/triton_machine.html.markdown | 3 +++ 2 files changed, 10 insertions(+) diff --git a/builtin/providers/triton/resource_machine.go b/builtin/providers/triton/resource_machine.go index 7eb66591c..85b26a8a5 100644 --- a/builtin/providers/triton/resource_machine.go +++ b/builtin/providers/triton/resource_machine.go @@ -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, diff --git a/website/source/docs/providers/triton/r/triton_machine.html.markdown b/website/source/docs/providers/triton/r/triton_machine.html.markdown index f01fd8005..84d8df996 100644 --- a/website/source/docs/providers/triton/r/triton_machine.html.markdown +++ b/website/source/docs/providers/triton/r/triton_machine.html.markdown @@ -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`.