The drawback to the native `%include` Kickstart directive is that it requires a static, hard-coded, absolute path. This means that we cannot, for example, host a copy of the kickstarts from a different branch for testing, without modifying the URLs of all the included files. Switching to using Jinja templates introduces a build step, but the result is that the artifacts are self-contained. This way, they can be deployed anywhere. I'm not sure where I'll put them, though, and they'll need a Jenkins job to run the build and publish them.
12 lines
203 B
Python
Executable File
12 lines
203 B
Python
Executable File
#!/usr/bin/env python3
|
|
import os
|
|
import sys
|
|
|
|
import jinja2
|
|
|
|
env = jinja2.Environment(
|
|
loader=jinja2.FileSystemLoader(os.getcwd()),
|
|
)
|
|
tmpl = env.get_template(sys.argv[1])
|
|
print(tmpl.render(), end='')
|