Bug 1831885

Summary: support <kickstart/> without a template
Product: [Community] Beaker Reporter: Jiri Jaburek <jjaburek>
Component: generalAssignee: Martin Styk <mastyk>
Status: CLOSED NEXTRELEASE QA Contact: tools-bugs <tools-bugs>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: developCC: azelinka, bpeck, cbouchar, jbastian, jkriz, jstodola, mastyk
Target Milestone: 28.0Keywords: Patch
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-08-20 15:18:38 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Jiri Jaburek 2020-05-05 20:10:45 UTC
Description of problem:

Take the contents of <kickstart/> as the literal verbatim Anaconda kickstart and pass it without any changes or additions as ks= on the kernel command line.

The contents should still be subject to jinja2 interpretation and customizable via jinja2 function calls and kickstart snippets, exactly like it's possible now:


This would allow us to Beaker-ize a custom kickstart, including snippets for install_* calls, /nopxe/, efibootmgr, etc., without adding any repos, installing a harness, putting misc files in various places on the installed system, etc.

This proposes an extension like <kickstart param="no_template">...</kickstart> that we could use in a job XML.

Version-Release number of selected component (if applicable):
Beaker 27.4

Additional info:

The described functionality is not currently possible even with this in ks_meta:

manual no_autopart no_networks no_addon_repos no_debug_repos no_clock_sync no_default_harness_repo no_disable_readahead no_updates_repos

Comment 1 Jiri Jaburek 2020-05-05 20:14:36 UTC
Note that fixing this would render bug 1818904 irrelevant as the functionality could be easily templated within <kickstart/>.

Comment 2 Jiri Jaburek 2020-05-19 20:32:04 UTC
Note that this bug may be an actual bug and not a feature request - all the documentation points to <kickstart/> being *the* template, whereas now it works like ks_append with ks_meta=manual implied.

So the proper fix would be to fix <kickstart/> to fully define the kickstart and ideally remove gotchas like:

    with TemplateRenderingEnvironment():
        if kickstart:
            template = template_env.from_string(
                "{% snippet 'install_method' %}\n" + kickstart)    <----
            result = template.render(restricted_context)

(the user using this probably isn't a newbie and can supply the snippet call if needed)

When an empty <kickstart></kickstart> is supplied, the ks= passed on kernel command line should be an empty file.

Comment 4 Martin Styk 2020-08-20 12:41:33 UTC
This bug is heavily used by some of the groups.

However, to enable your workload I patched it so <kickstart> will suit your purpose.
You just need to define ks_meta="no_ks_template" and you will get empty kickstart by default.

All snippets and restricted context is available.