-
Notifications
You must be signed in to change notification settings - Fork 47
Use templatefile function when possible rather than template_file resource #196
Comments
Part of #196 Signed-off-by: Mateusz Gozdek <mateusz@kinvolk.io>
Part of #196 Signed-off-by: Mateusz Gozdek <mateusz@kinvolk.io>
Since Terraform 0.12, Terraform provides built-in templatefile() function, which provides the same functionality as template_file data source from template provider, so it is preferred to use this one. This commit changes Ignition configuration to use this new function. Unfortunately, not all uses of template_file can be replaced, as one is used with count, so we would have to duplicate the function call or use 'null_resource' instead, which is not very beneficial. The other use is about building CLC snippets, which changing is out of scope for this commit. Part of #196. Signed-off-by: Mateusz Gozdek <mateusz@kinvolk.io>
Since Terraform 0.12, Terraform provides built-in templatefile() function, which provides the same functionality as template_file data source from template provider, so it is preferred to use this one. This commit changes Ignition configuration to use this new function. Unfortunately, not all uses of template_file can be replaced, as one is used with count, so we would have to duplicate the function call or use 'null_resource' instead, which is not very beneficial. The other use is about building CLC snippets, which changing is out of scope for this commit. Part of #196. Signed-off-by: Mateusz Gozdek <mateusz@kinvolk.io>
More context:
|
This commit changes the template method we use in Packet Terraform files where possible, from template_file data source coming from 3rd party Terraform provider to built-in 'templatefile' function, which is available from Terraform 0.12, as it provides the exact same functionality, but do not require downloading 3rd party provider. Also 'template' provider recommends using this function: https://www.terraform.io/docs/providers/template/d/file.html. Part of #196 Signed-off-by: Mateusz Gozdek <mateusz@kinvolk.io>
Just found out some pros and cons about it:
IMO |
This commit changes the template method we use in baremetal Terraform code responsible for generating workers Ignition configs from template_file data source coming from 3rd party Terraform provider to built-in 'templatefile' function, which is available from Terraform 0.12, as it provides the exact same functionality, but do not require downloading 3rd party provider. Also 'template' provider recommends using this function: https://www.terraform.io/docs/providers/template/d/file.html. This also allows passing parameters to the template in complex types (like lists) and call functions like 'join' inside the template, which better separates data from how they are rendered. Part of #196 Signed-off-by: Mateusz Gozdek <mateusz@kinvolk.io>
This commit changes the template method we use in baremetal Terraform code responsible for generating workers Ignition configs from template_file data source coming from 3rd party Terraform provider to built-in 'templatefile' function, which is available from Terraform 0.12, as it provides the exact same functionality, but do not require downloading 3rd party provider. Also 'template' provider recommends using this function: https://www.terraform.io/docs/providers/template/d/file.html. This also allows passing parameters to the template in complex types (like lists) and call functions like 'join' inside the template, which better separates data from how they are rendered. Part of #196 Signed-off-by: Mateusz Gozdek <mateusz@kinvolk.io>
This commit changes the template method we use in baremetal Terraform code responsible for generating workers Ignition configs from template_file data source coming from 3rd party Terraform provider to built-in 'templatefile' function, which is available from Terraform 0.12, as it provides the exact same functionality, but do not require downloading 3rd party provider. Also 'template' provider recommends using this function: https://www.terraform.io/docs/providers/template/d/file.html. This also allows passing parameters to the template in complex types (like lists) and call functions like 'join' inside the template, which better separates data from how they are rendered. Part of #196 Signed-off-by: Mateusz Gozdek <mateusz@kinvolk.io>
This commit changes the template method we use in baremetal Terraform code responsible for generating workers Ignition configs from template_file data source coming from 3rd party Terraform provider to built-in 'templatefile' function, which is available from Terraform 0.12, as it provides the exact same functionality, but do not require downloading 3rd party provider. Also 'template' provider recommends using this function: https://www.terraform.io/docs/providers/template/d/file.html. This also allows passing parameters to the template in complex types (like lists) and call functions like 'join' inside the template, which better separates data from how they are rendered. Part of #196 Signed-off-by: Mateusz Gozdek <mateusz@kinvolk.io>
This commit changes the template method we use in baremetal Terraform code responsible for generating workers Ignition configs from template_file data source coming from 3rd party Terraform provider to built-in 'templatefile' function, which is available from Terraform 0.12, as it provides the exact same functionality, but do not require downloading 3rd party provider. Also 'template' provider recommends using this function: https://www.terraform.io/docs/providers/template/d/file.html. This also allows passing parameters to the template in complex types (like lists) and call functions like 'join' inside the template, which better separates data from how they are rendered. Part of #196 Signed-off-by: Mateusz Gozdek <mateusz@kinvolk.io>
Turns out |
On it |
template_file is deprecated closes: #196 Signed-off-by: knrt10 <kautilya@kinvolk.io>
template_file is deprecated. closes: #196 Signed-off-by: knrt10 <kautilya@kinvolk.io>
Prior to Terraform 0.12,
template_file
resource was used to do templating in Terraform. With 0.12, nowtemplatefile
function should be used instead.The text was updated successfully, but these errors were encountered: