All,
Please note, my frame of reference is only as it applies to
Kickstarting/CentOS, using Foreman 1.10.0 (stable). Debian/Preseed might
handle this situation differently. Furthermore, if I've directed this at
the wrong audience, please just point me to the right one!
Currently when doing PXE based builds, the Finish template is never
incorporated into the final kickstart script presented to the host. It
seems the kickstart script presented to the host is only the kickstart
provision template within foreman. The foreman documentation suggests that
a pxe based host creation includes the PXE, provision, and finish templates:
http://www.theforeman.org/manuals/1.10/index.html#4.4.3ProvisioningTemplates
> The Create Host action deploys the PXELinux template to the TFTP
> server. The PXELinux template directs the host to retrieve the Provision
> template. The Provision template will direct the installer to retrieve and
> run the Finish template at the end of the install, and the* Finish
> template will notify Foreman the build is complete just before reboot*.
>
With the default templates shipped with 1.10.0, the %post section of the
kickstart default *provision *template fulfills most (but not all) of the
tasks specified in the kickstart default *finish *template (including
notification of build completion to foreman). It should be noted, there
are some slight differences between the %post in provision template, and
the finish template.
My use-case that brought this up: I have several custom applications (some
my dev's wrote, some they didn't) that I need to lay down as part of a
kickstart process. No puppet modules currently exists (on my wish-list,
likely not within the scope of what our customer is willing to pay for). I
want to leverage the "finish" template such that I could have one
standardized Provision template. I can then select the appropriate finish
template at host-creation time, which would dictate what kind of host that
would be (i.e. what application is running on that host).
TL;DR: Which direction does the foreman team want to go?
A) Have the finish templates be intended for image based deployments only,
and update the documentation accordingly.
or
B) Refactor the kickstart (and potentially preseed) provision templates to
call their respective finish templates during the %post. Would this be a
discussion for the foreman_templates plugin?
Given my use-case, I would prefer option b. It seems like that would
provide more modularity to the overall provisioning process. That being
said, I understand completely that a single use-case shouldn't (and won't)
dictate the direction of an entire project, hence, this dialog. If
anything is unclear, please let me know and I'll happily clarify.
Apologies for my verbosity and thank you in advance!
Regards,
Mike