Utility provider that exposes the cloudinit_config data source which renders a multipart MIME configuration for use with cloud-init (previously available as the template_cloudinit_config resource in the template provider)
This causes cloud-init schema --system --annotate to complain:
# E1: File None needs to begin with "#cloud-config"
The other issue is that merge_type = "list(append)+dict(recurse_array)+str()" doesn't seem to do anything for the parts besides the first.
I had to stick merge_type = "list(append)+dict(recurse_array)+str()" in my part YAML files for cloudinit to not overwrite previous parts.
Proposal
Would it be possible to move the #cloud-init above the --MIMEBOUNDARY, or add an additional one there?
I'm not sure what the feasible solutions might be.
How much impact is this issue causing?
Medium
Additional Information
This was discovered (both problems of the #cloud-init comment, and the merge_type = "list(append)+dict(recurse_array)+str()" not being inserted into each part) when troubleshooting upgrading from Amazon Linux 2 to Amazon Linux 2023 (cloud-init v19 to v22) here
You'll see that the resolution for that issue was that I needed to manually put merge_type = "list(append)+dict(recurse_array)+str()" into each of my user_data/parts/<part>.yaml, even though I had it in my Terraform block parts:
part {
content = file("files/user_data/parts/base.yaml")
merge_type = "list(append)+dict(recurse_array)+str()"
}
Code of Conduct
[X] I agree to follow this project's Code of Conduct
Terraform CLI and Provider Versions
Terraform v1.4.4 on darwin_arm64
Use Cases or Problem Statement
When using a multipart
cloudinit_config
such asit ends up generating a
/var/lib/cloud/instance/user-data.txt
file that starts withThis causes
cloud-init schema --system --annotate
to complain:The other issue is that
merge_type = "list(append)+dict(recurse_array)+str()"
doesn't seem to do anything for the parts besides the first.I had to stick
merge_type = "list(append)+dict(recurse_array)+str()"
in my part YAML files for cloudinit to not overwrite previous parts.Proposal
Would it be possible to move the
#cloud-init
above the--MIMEBOUNDARY
, or add an additional one there?I'm not sure what the feasible solutions might be.
How much impact is this issue causing?
Medium
Additional Information
This was discovered (both problems of the
#cloud-init
comment, and themerge_type = "list(append)+dict(recurse_array)+str()"
not being inserted into each part) when troubleshooting upgrading from Amazon Linux 2 to Amazon Linux 2023 (cloud-init v19 to v22) herehttps://github.com/canonical/cloud-init/issues/5533
You'll see that the resolution for that issue was that I needed to manually put
merge_type = "list(append)+dict(recurse_array)+str()"
into each of myuser_data/parts/<part>.yaml
, even though I had it in my Terraform block parts:Code of Conduct