-
Notifications
You must be signed in to change notification settings - Fork 9.7k
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
Nested interpolation #641
Comments
I can see the use case of this, but it would be an incredibly complex feature to add and the use cases just aren't there right now. What use case are you using this for? Perhaps we can come up with an alternate approach. In the mean time, I'm going to close this as "wontfix" for now, since there is no short term future where we add this, unfortunately. |
@mitchellh I have found an alternative approach by now (blog post is coming). The one simple thing I wanted to concatenate a common head with a host-specific tail, like so:
Templates (#642) would a very nice alternative, I think. |
fwiw - I ended up working around this issue by making cloudinit pull in and execute some scripts from S3. tl;dr - I didn't try to make cloudinit dynamic or drop a bunch of files, I just used EC2 tags and sed'ed the results. This does have the downside of a being a "master" cloudinit file, which means that any change and everything would get rebuilt. We work around that by versioning the file. we are still in early days, but I was surprised by how well it worked. OTOH - Templates would be nice, and would let us just use cloudinit the way it was supposed to be used. Example cloudinit:
|
In my case it's all based around systemd units and environment files, and I am using CoreOS. I am still working on the blog post, but here is the essence:
In this particular setup I do have all units run everywhere at the moment, just the environment files differ... But if I were to not run some on certain hosts, I'd use conditional start stanzas. |
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. |
A two-level nested interpolation would be great.
Some of the usage examples would be:
${vars.foo-${count.index}}
${file("foo-${count.index}")
The text was updated successfully, but these errors were encountered: