-
Notifications
You must be signed in to change notification settings - Fork 13
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
Feature request: accept cloudinit data inline #12
Comments
Hi, many thanks for your feature request! Your feature request is a valid one, and is technically possible with
One way you can work around this provider's lack of a data "cloudinit_config" "cloudinit_ubuntu" {
part {
content = file("./cloudinit/groups.yml")
}
part {
content = file("./cloudinit/users.yml")
}
# etc.
}
resource "local_file" "cloudinit_ubuntu" {
filename = "ubuntu-cloudinit.yml"
content = data.cloudinit_config.cloudinit_ubuntu.rendered
}
resource "multipass_instance" "ubuntu" {
name = "ubuntu"
disk = "3072MiB"
memory = "512MiB"
cloudinit_file = local_file.cloudinit_ubuntu.filename
} [1] https://registry.terraform.io/providers/hashicorp/local/latest/docs/resources/file |
Thanks for teaching me how to use the I can find another way to combine the YAML segments, which will be sufficient if I end up only needing to combine plain cloud config data. |
This is how I solved this (adjacent cloud-init template yaml inside of I think passing this in via stdin would be awesome and happy to work on that PR if you haven't already!
|
I am trying to use
cloudinit_config
with manypart
blocks to compose a MIME document to use for cloudinit against a multipass resource.The
cloudinit_config
resource only exposes arendered
value. I am new to terraform, so maybe I'm missing something, but I don't see a way to write that rendered value to a file, and then provide the path of the file to the multipass resource.I would like to be able to write:
AFAICS, it should be okay to hold
cloudinit_data
in memory, and then pass it as stdin tomultipass launch --cloud-init=-
, but it could just as well go into a temporary file managed by the multipass provider if necessary.The text was updated successfully, but these errors were encountered: