Cobbler Templates
201
11.5. Cobbler Templates
Within the RHN Satellite web interface, there are facilities to create variables for use with kickstart
distributions and profiles. For example, to create a kickstart profile variable, refer to
Section 7.4.9.3.3,
“Kickstart Details � Variables”
.
Kickstart variables are a part of an infrastructural change in Satellite to support
templating
in kickstart
files. In the context of kickstart files, templates are files that hold descriptions used to build actual
kickstart files, rather than creating specific kickstarts.
These templates are then shared by various profiles and systems that have their own variables and
corresponding values. These variables modify the templates and software called a
template engine
parses the template and variable data into a usable kickstart file. Cobbler uses an advanced template
engine called
Cheetah
that provides support for templates, variables, and snippets.
Advantages of using templates include:
• Robust features that allow administrators to create and manage large amounts of profiles or
systems without duplication of effort or manually creating kickstarts for every unique situation
• While templates can become complex and involve loops, conditionals and other enhanced features
and syntax, it can also be used simply to make kickstart files without such complexity.
11.5.1. Using Templates
Kickstart templates can have static values for certain common items such as PXE image filenames,
subnet addresses, and common paths such as
/etc/sysconfig/network-scripts/
. However,
where templates differ from standard kickstart files are in their use of variables.
For example, a standard kickstart file may have a networking passage that looks similar to the
following
network --device=eth0 --bootproto=static --ip=192.168.100.24 --
netmask=255.255.255.0 --gateway=192.168.100.1 --nameserver=192.168.100.2
However, in a kickstart template file, the networking passage may look similar to the following:
network --device=$net_dev --bootproto=static --ip=$ip_addr --
netmask=255.255.255.0 --gateway=$my_gateway --nameserver=$my_nameserver
These variables will be substituted with the values set in your kickstart profile variables or in your
system detail variables. If there are the same variables defined in both the profile and the system
detail, then the system variable takes precedence.
For more information about kickstart templates, refer to the Cobbler project page at the following URL:
https://fedorahosted.org/cobbler/wiki/KickstartTemplating
11.5.2. Kickstart Snippets
If you have common configurations that are the same across all kickstart templates and profiles, you
can utilize the
Snippets
feature of Cobbler to take advantage of code reuse.
Summary of Contents for NETWORK SATELLITE 5.3.0 - CHANNEL MANAGEMENT
Page 1: ...Red Hat Network Satellite 5 3 0 Reference Guide Red Hat Network Satellite ...
Page 32: ...20 ...
Page 44: ...Chapter 4 Red Hat Update Agent 32 Figure 4 11 Available Package Updates ...
Page 168: ...156 ...
Page 180: ...168 ...
Page 216: ...204 ...
Page 232: ...220 ...
Page 248: ...236 ...
Page 260: ...248 ...
Page 309: ...297 Appendix E Revision History Revision 1 0 Fri Feb 27 2009 ...
Page 310: ...298 ...
Page 318: ...306 ...