Hi all, I have started a rather primitive attempt of an Incus datasource for cloud-init which would interrogate /dev/incus/sock
and merge user data fragments from appropriate keys. The main thing I wanted to address is the lack of an apparent merge function between user-data stanzas provided by various profiles.
With this custom data source I could specify user-data stanzas in a profile, which contains a write_files stanza that renders a file based on contents of variables from the same profile, then override the variable in instance config, or I can have multiple runcmd stanzas merged together, etc. But for now this is done as a standalone monkey-patch which has to be added to each newly created container as I have not baked new distro images with this change. I have also not written any tests or amended ds-identify, etc.
Something like this was discussed before at How to merge profiles' user.vendor-data? - #10 by stgraber what is the state of our thinking now? Is this a dead end?
I suspect if further progress is desired then there will need to be some code changes made on how configuration from profiles & from the instance itself get presented.
Any comment is appreciated