Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Userdata template file not rendering #913

Closed
1 of 4 tasks
jamiebuxxx opened this issue Jun 9, 2020 · 3 comments
Closed
1 of 4 tasks

Userdata template file not rendering #913

jamiebuxxx opened this issue Jun 9, 2020 · 3 comments

Comments

@jamiebuxxx
Copy link

I have issues

I'm submitting a...

  • bug report
  • feature request
  • support request - read the FAQ first!
  • kudos, thank you, warm fuzzy

What is the current behavior?

When using a custom userdata template file under the worker_group resources options, I noticed that the template is no longer rendering as userdata content on the instance.

If this is a bug, how to reproduce? Please include a code sample if relevant.

worker_groups = [
    {
      name                          = "${var.cluster_name}-wg"
      ...
      userdata_template_file        = "${path.module}/templates/eks_compute_userdata.sh.tpl"
   }
]

The userdata on the instance:

$ cat /var/lib/cloud/instances/i-0xxxxxxxxxxxxx/user-data.txt
./templates/eks_compute_userdata.sh.tpl

What's the expected behavior?

The actually userdata content from the template should be rendered, not the path to the template. This was working before.

Are you able to fix this problem and submit a PR? Link here if you have already.

Not sure. This may be related to the following PR: #883.

Environment details

  • Affected module version: v12.1.0
  • OS: Ubuntu 18.04
  • Terraform version: 0.12.24

Any other relevant info

@dpiddockcmp
Copy link
Contributor

Oops. I feared this would happen.

You need to pass in the contents of a template. userdata_template_file = file("path/to/file.tpl")

The original implementation of userdata_template_file took the contents of a template, not the path to a file. This was accidentally broken in 12.0.0 by #854. #882 was filed about the break and resolved by #883 .

@jamiebuxxx
Copy link
Author

Thanks for the info @dpiddockcmp! That worked as expected.

@github-actions
Copy link

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 26, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants