Forum archive
best way to mixin e.g. custom plan files with existing TKL images?
Hi there, I'm finally getting used to using TKLdev to crank out a new .iso when I want one. I have a series of customizations which I apply to some of my servers depending what I'm using them for. This includes a set of custom packages, but I'll probably want to make other changes as well.
I'm wondering if anyone has tips and tricks for keeping a set of changes that's common between servers, that can be 'applied' after the defintions are 'git clone'd or similar. I searched around but couldn't find anything.
If you are adding these custom packages to multiple builds, the best place to put them is in common (by default /turnkey/fab/common). In there you'll find the base plan. That is applied to all servers (it's essentially Core's plan).
Alternatively, if you don't want to do that, you could create your own custom plan (i'd recommend putting it in the turnkey directory, e.g. common/plans/turnkey/custom. Then in each appliance that wants this plan included, add it near the top of the plan file (e.g. products/core/plan/main - just below '#include'):
if you want other common customisations, you can add them to common too. Including common custom conf scripts and/or overlays is similar (but slightly different). If you want them to be included in all builds, then you can simply add new conf script(s) and/or overlays to common/conf/turnkey.d and/or common/overlays/turnkey.d. Overlays and conf scripts in those locations will be included in all future builds.
Alternatively, if you don't necessarily want them in all builds, but more than one, then you can put them in the directory above those (i.e. common/conf/ and/or common/overlays/ respectively). Then you can include them via each appliance's Makefile. Add them at the top, like this:
These will use conf/overlay from common/conf/custom-conf & common/overlays/custom-overlay/ respectively. Additional items can be added on the end (i.e. space separated list).
To make managing a group of conf script(s) and overlays(s) easier, you can group then together via a common makefile (in common/mk/turnkey/). E.g. common/mk/turnkey/custom.mk:
Omit lines that aren't relevant (i.e. in my example I'm including other common makefiles, which is likely not relevant to you).
Then to use the common makefile, add this to each server Makefile:
Hopefully that all makes sense and answers your question properly.