From ec7182148a40f203e71f3e18e0a22949dab1cb4f Mon Sep 17 00:00:00 2001 From: Abdul Rehman Date: Mon, 9 Jan 2017 08:36:16 +0000 Subject: [PATCH] Added example of variable reference inside file (#11097) This tripped me up earlier as I was referencing inside the file as $${variable} when it should be ${variable}. Think is brings clarity, cheers. --- .../source/docs/providers/template/d/file.html.md | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/website/source/docs/providers/template/d/file.html.md b/website/source/docs/providers/template/d/file.html.md index 90c7a61cf..4929041f1 100644 --- a/website/source/docs/providers/template/d/file.html.md +++ b/website/source/docs/providers/template/d/file.html.md @@ -12,7 +12,9 @@ Renders a template from a file. ## Example Usage -From a file: +Option 1: From a file: + +Reference the template path: ``` data "template_file" "init" { @@ -24,7 +26,15 @@ data "template_file" "init" { } ``` -Inline: +Inside the file, reference the variable as such: + +``` +#!/bin/bash + +echo "CONSUL_ADDRESS = ${consul_address}" > /tmp/iplist +``` + +Option 2: Inline: ``` data "template_file" "init" {