Closed deefdragon closed 1 year ago
It may be worth looking into https://registry.terraform.io/providers/hashicorp/template/latest/docs/data-sources/cloudinit_config
Apologies for the late reply, I think it would be best to rely on an official cloudinit config generator like @4censord mentioned. I am open to adding a light amount of validation to prevent obvious errors, but anything beyond that should use a more official mechanism.
When writing cloud config I rely heavily on the documentation (I do it very infrequently), so if there are other things you think should be considered outside of what you mentioned please say so.
I've added a warning log when the #cloud-config
string is missing in the template in #219. The XO client doesn't have a yaml parser installed and so I felt that was not worth the additional dependency for now.
I spent far longer than I should have attempting to get cloud config working (in large part because of the required comment) and most of the times that I failed were because of improper cloud config. Given the difficulty of debugging cloud-config at times, would it be possible to throw an error if the yaml is invalid (or missing that starting comment etc.) and or, would it be possible to have an object input instead of a string input that automatically adds the comment and formats the object to yaml in-code?