[CentOS] PXE boot, Kickstart NFS install and %include...
wmcdonald at gmail.com
Tue Mar 14 15:17:08 UTC 2006
I was just wondering how (or indeed if) people use the %include
directive in Kickstart configuration files when building systems via
NFS. I've been trying to modularise our Kickstart files a little to
make things more readable, having generic defaults and role specific
stuff split out into separate configs.
I've tried this configuration...
[root at archive kickstart]# cat centos4-install-ks.cfg
# Kickstart to build default CentOS system
# $Id: centos4-install-ks.cfg,v 1.2 2006/03/13 14:21:32 root Exp root $
# Setup kickstart defaults (keyboard, NFS server etc.)
# Setup partitions (mailstore specific)
# Package list to install
# Setup /etc/hosts with required ip/name mappings (mailstore specific)
# Setup CentOS Yum repository
# Add CentOS GPG key used to sign their RPM packages
rpm --import /usr/share/doc/centos-release-4/RPM-GPG-KEY-centos4
# Setup Dag repository
# Setup users and their authorized_keys
# Setup secure SSHD configuration
# Setup Sudo
# Setup Nagios Remote Plugin Execution
# Setup Bacula, /etc/bacula/bacula-fd.conf still needs to have the finalised
# hostname entered manually :( (for now)
# Install "standard" additional components
yum -y install keychain bash-completion multitail webmin
And a sample of one of the modular configs...
[root at archive kickstart]# cat include/secure-sshd.cfg
# Lock down sshd_config to only accept SSH2 keybased auth
mkdir -p /etc/ssh/RCS
ci -t-"Main SSHD configuration file." -u /etc/ssh/sshd_config
co -l /etc/ssh/sshd_config
cat <<EOF > /etc/ssh/sshd_config
# Main SSHD configuration file.
# FILE UNDER RCS, DO NOT EDIT WITHOUT CHECKING OUT!!!
ci -m"Kickstart: Secured SSH configuration, locked down to keys-only
config." -u /etc/ssh/sshd_config
Which doesn't work, Anaconda runs and starting prompting for input as
it would for a manual install. If I include everything pre-%post
(IYSWIM) in the main Kickstart file then everything works as expected
up till the %post %includes when Anaconda complains it can't find
blah.cfg, presumably because it's not local.
I could live with the body of Kickstart config in the main file and
then manually NFS mount and reference the modular configs, if I have
to, but I wondered is there a better method?
I've Googled around a bit and found these threads from '02...
Which clarify what's going on but not really how people deal with
%include and NFS.
More information about the CentOS