Repository navigation
|
Using cloud-init, we want to provide specialized cloud instances with a pre-configured software component (user application). This software component comprises of several (.deb) packages and a specific configuration (rather complex, across multiple configuration files). Cloud-init should not only pre-install the required additional packages (can easily be done with the package-update-upgrade-install module), but also allow to inject parts of the configuration in an easy fashion. What's the recommended approach for injection such configuration details for application packages? With full file injection and script inject, too much complexity is put into the cloud-init data. We rather want a solution tailored to the needs and avoiding complexity. So would a custom configuration module the best way forward?
|
Replies: 2 comments
|
For the shape you describe, I would separate two layers:
If those per-instance keys are application-specific and need validation/rendering across several files, a custom module is the right cloud-init-native boundary. The documented out-of-tree route is:
For an app package, I would usually ship the module in your own The awkward part is schema. The cloud-init module creation docs say upstream modules should provide
There is not a generic cloud-init feature that turns arbitrary cloud-config variables into systemd environment files for every application. You can approximate it with So my recommendation would be: package the application defaults, expose a narrow If this gives you a workable extension boundary, please mark the answer as solved. |
|
I think @yudin-s is correct that trying to bake all of the things into cloud-init is probably too much. In addition to his suggestions, and possibly as an alternative to baking everything into an image, you may want to look at a post cloud-init configuration management tool like chef/puppet/ansible. These are much more suited to the kinds of complex operations you're trying to execute. If you wish, you can get cloud-init to kick off an initial chef/puppet/ansible run. |
For the shape you describe, I would separate two layers:
.debdependencies, default templates, systemd units, validation scripts, and documentation.If those per-instance keys are application-specific and need validation/rendering across several files, a custom module is the right cloud-init-native boundary. The documented out-of-tree route is:
cc_<name>.py;/usr/lib/python3/di…