Chapter 5. Provisioning with Satellite405.7. TemplatingOne of the more powerful new features in Satellite 5.3 is Cheetah based kickstart templating. With thisnew capability, you can include variables, snippets (see below), and flow control statements such asfor loops and if statements in your kickstart files.5.7.1. Use CasesThere are a variety of reasons a user may want to use templating, such as:• You might want to reuse a particular section of a kickstart, such as a disk partitioning section,between multiple kickstarts.• If you have, for example, multiple kinds of server roles such as DNS server, proxy server, and webserver, all with their own package set. You could define a snippet for each role. For example webserver might have the following snippet defined:httpdmod_sslmod_pythonIf you want to create a web server profile, include the web server snippet in the %package sectionof your Kickstart file. If you wanted a profile to be both a web server and a proxy server, you couldinclude both snippets in the package section. Then if you wanted to add another package to theweb server snippet, mod_perl for example, by updating the snippet all profiles that are using thatsnippet would be updated as well.• You might want to perform certain actions in %post consistently across multiple kickstarts.5.7.2. VariablesTemplating allows for variables such as foo to be defined, and the value of those variables replacedwherever $foo is seen in a kickstart file.Variables are subject to a form of inheritance that allows them to be set at one level and overridden atlevels below them — the hierarchy is defined by Cobbler:• Kickstart tree (distro in cobbler) parameters come first• Kickstart Profile parameters override kickstart tree parameters• System parameters override Profile parametersIf a variable is defined at the system level, it will override the same variable defined at the Profile orDistro levels. Likewise, if a variable is defined at the Profile level, it will override the same variable ifdefined at the kickstart tree (distro) level.NoteNote that kickstart tree (distro) variables cannot be defined for non-custom (automaticallygenerated) kickstart trees such as the ones you get when you do a satellite sync.Refer to https://fedorahosted.org/cobbler/wiki/KickstartTemplating for more information.