Make minor alterations to the cloudinit docs

This commit is contained in:
James Nugent 2015-11-28 10:07:06 +00:00
parent ba9c7323a9
commit 16c8750bab
1 changed files with 17 additions and 11 deletions

View File

@ -3,16 +3,17 @@ layout: "Template"
page_title: "Template: cloudinit_multipart" page_title: "Template: cloudinit_multipart"
sidebar_current: "docs-template-resource-cloudinit-config" sidebar_current: "docs-template-resource-cloudinit-config"
description: |- description: |-
Renders a cloud-init config. Renders a multi-part cloud-init config from source files.
--- ---
# template\_cloudinit\_config # template\_cloudinit\_config
Renders a template from a file. Renders a multi-part cloud-init config from source files.
## Example Usage ## Example Usage
``` ```
# Render a part using a `template_file`
resource "template_file" "script" { resource "template_file" "script" {
template = "${file("${path.module}/init.tpl")}" template = "${file("${path.module}/init.tpl")}"
@ -21,7 +22,12 @@ resource "template_file" "script" {
} }
} }
# Render a multi-part cloudinit config making use of the part
# above, and other source files
resource "template_cloudinit_config" "config" { resource "template_cloudinit_config" "config" {
gzip = true
base64_encode = true
# Setup hello world script to be called by the cloud-config # Setup hello world script to be called by the cloud-config
part { part {
filename = "init.cfg" filename = "init.cfg"
@ -29,15 +35,16 @@ resource "template_cloudinit_config" "config" {
content = "${template_file.script.rendered}" content = "${template_file.script.rendered}"
} }
# Setup cloud-config yaml
part { part {
content_type = "text/cloud-config" content_type = "text/x-shellscript"
content = "${file(\"config.yaml\")" content = "baz"
}
part {
content_type = "text/x-shellscript"
content = "ffbaz"
} }
} }
``` ```
## Argument Reference ## Argument Reference
@ -48,7 +55,7 @@ The following arguments are supported:
* `base64_encode` - (Optional) Base64 encoding of the rendered output. * `base64_encode` - (Optional) Base64 encoding of the rendered output.
* `part` - (Required) One may specify this many times, this creates a fragment of the rendered cloud-init config. * `part` - (Required) One may specify this many times, this creates a fragment of the rendered cloud-init config file. The order of the parts is maintained in the configuration is maintained in the rendered template.
The `part` block supports: The `part` block supports:
@ -60,9 +67,8 @@ The `part` block supports:
* `merge_type` - (Optional) Gives the ability to merge multiple blocks of cloud-config together. * `merge_type` - (Optional) Gives the ability to merge multiple blocks of cloud-config together.
## Attributes Reference ## Attributes Reference
The following attributes are exported: The following attributes are exported:
* `rendered` - The final rendered template. * `rendered` - The final rendered multi-part cloudinit config.