Forum archive
tkldev: how to preseed inithooks.conf for baremetal?
Hello,
the documentation of inithooks makes mention that /etc/inithooks.conf can be populated with values that when present will cause the installator to not ask the user for input.
Can that be done for generation of an ISO build from within tkldev?
If so, where the snippet belongs?
cat>/etc/inithooks.conf<<EOF export ROOT_PASS=supersecretrootpass export DB_PASS=supersecretmysqlpass export APP_EMAIL=admin@example.com export APP_PASS=webappadminpassword export SEC_ALERTS=admin@example.com export SEC_UPDATES=FORCE export HUB_APIKEY=SKIP EOF
Say the appliance is a wordpress, should the above go to:
/turnkey/fab/products/wordpress/overlay/etc/inithooks.conf
OR perhaps here
/turnkey/fab/products/core/overlay/etc/inithooks.conf
In any case, what file should the above be specified in? conf.d/main of the appliance or the core appliance? or maybe elswhere?
After reading this in the documentation:
It is possible to bypass this interactive configuration process by creating /etc/inithooks.conf in the appliance filesystem and writing inithooks configuration variables into it before the first system boot.
I would like to assume that cat < /etc/inithooks.conf<<EOF ... EOF shoud go into wordpress/conf.d/main.
Do you guys have any hints for me here?
Please help
Lin Pro
So whilst all appliances are essentially based on Core, when you build them, they do not actually use the code contained within /turnkey/fab/products/core/. The shared code actually exists somewhere else altogether; in common (locally in TKLDev it is in /turnkey/fab/common/).
Armed with that knowledge, if you intend to (re)build multiple appliances it may actually make sense to put generic pre-seeding (for any/all) appliances in common. E.g. you could put a copy of your desired inithooks.conf in common/overlays/turnkey.d/pre-seed/etc/inithooks.conf (the contents of all directories in common/overlays/turnkey.d/ are overlayed for all appliances at build time). Alternatively if you prefer to do it via conf script (rather than an overlay file) that could go in a file in common/conf/turnkey.d/ e.g. common/conf/turnkey.d/pre-seed. There is no hard and fast rule regarding whether to use an overlay or conf script.
Alternatively if you only intend to (re)build one appliance then additions to common are overkill. Instead I would either add it as /turnkey/fab/products/wordpress/overlay/etc/inithooks.conf or via wordpress/conf.d/main (or a separate script in wordpress/conf.d/). Obviously if you go the common route; any appliance specific modifications must be done via an appliance specific conf script; otherwise the appliance overlay file will overwrite the one from common...