Excerpts from Alexander Todorov's message of 2015-01-06 22:24 +10:00:
One more thought though. It would be nice if the default template (on
the server) defines template blocks which can be overriden by the
client. Say
client sends:
{% block partitioning %}
... some partitioning commands ...
{% endblock %}
This overrides the default autopart command on the server but leaves the rest of
the template intact. This way we can save test case authors from copying the
entire kickstart template when they have to modify just a few bits.
Or we could silently use server defaults and override only those kickstart
commands which were specified explicitly by the client.
This is an interesting idea. We have got something very similar right
now with the "snippets". For example the "rhts_partitions" snippet
provides the partitioning commands. The default implementation uses
autopart, or else adds part commands according to <partitions/> in the
recipe, but it can also be overridden by the admin on a per-lab,
per-family, or per-system basis.
Using Jinja blocks and inheritance would probably be nicer than the
custom {% snippet %} statement but the snippet stuff was a direct port
from Cobbler so that's just what we have now.
We could add a way for *users* to override the snippets in their recipe
XML. Maybe an element like
<ks_snippet name="rhts_partitions">
...
</ks_snippet>
But I don't know if that would be generally useful. Most of the time the
snippets provide important functionality (for example admins use these
to add system-specific hacks that are needed for hardware reasons) and
if the recipe overrides that it may need to provide the same
functionality anyway.
Another possibility, for partitions in particular: we have discussed
previously the idea of allowing raw kickstart commands inside the
<partitions/> element. I can't find an RFE for it though. Also, the raw
partition commands would be passed straight through to the kickstart,
not treated as a Jinja template.
Are there any other blocks you would want to override, besides the
partitioning commands?
--
Dan Callaghan <dcallagh(a)redhat.com>
Software Engineer, Hosted & Shared Services
Red Hat, Inc.