Excerpts from Nick Coghlan's message of 2015-01-06 11:55 +10:00:
----- Original Message -----
> From: "Alexander Todorov" <atodorov(a)redhat.com>
> Additionally Dan Callaghan commented on Gerrit:
> >
> > Yes it sounds like this is a good time to re-think the template vars for
> > workflow-installer-test. It would be really good to have them more
> > consistent with the server side templates.
>
> I don't know how server side templates look like so Dan please comment how
> can we make both sides more consistent ?
For Beaker 0.18, Dan changed the server side templates to largely be
OS feature based rather than version based:
https://beaker-project.org/docs/whats-new/release-0.18.html#better-suppor...
Previously, Beaker's server-side templates would treat any distro as
RHEL 6, which was no longer a viable assumption once RHEL and CentOS
7 had been released.
It seems to me that same logic applies for client side templates as
well: anything based on checking distro names and versions is always
going to struggle to handle derived distros correctly, while checking
for the relevant OS features works just as well for derivatives as it
does for the main trio of Fedora/RHEL/CentOS.
Yes, we learnt the hard way that hard-coding conditionals against the
family name throughout our templates leads to a world of pain. We still
have all the piles of nasty logic but it is consolidated into this one
(reasonably) neat Python method:
https://git.beaker-project.org/cgit/beaker/tree/Server/bkr/server/model/d...
Alex, you can browse the server templates here:
https://git.beaker-project.org/cgit/beaker/tree/Server/bkr/server/kicksta...
https://git.beaker-project.org/cgit/beaker/tree/Server/bkr/server/snippets/
Note that all of the "distro feature" variables which are documented in
Nick's link above, and which you can see being used in those templates
(has_systemd, etc), are available to recipe kickstarts as well. So you
can put in your recipe things like:
<kickstart>
...
autopart {% if has_autopart_type is defined %}--type=btrfs{% end if %}
...
</kickstart>
in the same way that the server templates do it now.
So maybe it would be possible to eliminate the need for rendering the
templates client-side at all?
--
Dan Callaghan <dcallagh(a)redhat.com>
Software Engineer, Hosted & Shared Services
Red Hat, Inc.