以前在没有kickstart的时候,安装系统都是通过光盘来安装,如果数量大的话,就会很浪费时间,有了kickstart,通过pxe+dhcp+tftp配合kickstart,这样安装系统就方便了很多,现在开源社区里的cobbler工具,使用后觉得比kickstart更方便,Cobbler支持命令行管理,web界面管理,还提供了API接口,可以方便二次开发使用。
一、安装epel源
二、安装与配置cobbler
三、使用koan来实现cobbler重新安装系统
四、cobbler的图形化管理
- wget http://dl.fedoraproject.org/pub/epel/5/x86_64/epel-release-5-4.noarch.rpm
- rpm -ivh epel-release-5-4.noarch.rpm
- yum install cobbler httpd rsync tftp-server xinetd dhcp python-ctypes
- [root@cobbler ~]# cobbler check
- The following are potential configuration items that you may want to fix:
- 1 : The 'server' field in /etc/cobbler/settings must be set to something other than localhost,or kickstarting features will not work. This should be a resolvable hostname or IP for the boot server as reachable by all machines that will use it.
- 2 : For PXE to be functional, the 'next_server' field in /etc/cobbler/settings must be set to something other than 127.0.0.1, and should match the IP of the boot server on the PXE network.
- 3 : you need to set some SELinux content rules to ensure cobbler works correctly in your SELinux environment, run the following:
- /usr/sbin/semanage fcontext -a -t public_content_t "/tftpboot/.*" && \
- /usr/sbin/semanage fcontext -a -t public_content_t "/var/www/cobbler/images/.*"
- 4 : some network boot-loaders are missing from /var/lib/cobbler/loaders, you may run 'cobbler get-loaders' to download them, or, if you only want to handle x86/x86_64 netbooting, you may ensure that you have installed a *recent* version of the syslinux package installed and can ignore this message entirely. Files in this directory, should you want to support all architectures, should include pxelinux.0, menu.c32, elilo.efi, and yaboot.The 'cobbler get-loaders' command is the easiest way to resolve these requirements.
- 5 : change 'disable' to 'no' in /etc/xinetd.d/tftp
- 6 : change 'disable' to 'no' in /etc/xinetd.d/rsync
- 7 : since iptables may be running, ensure 69, 80, and 25151 are unblocked
- 8 : debmirror package is not installed, it will be required to manage debian deployments and repositories
- 9 : The default password used by the sample templates for newly installed machines
- (default_password_crypted in /etc/cobbler/settings) is still set to 'cobbler' and should be changed,
- try: "openssl passwd -1 -salt 'random-phrase-here' 'your-password-here'" to generate new one
- Restart cobblerd and then run 'cobbler sync' to apply changes.
- sed -i '/disable/c\\tdisable\t\t\t= no' /etc/xinetd.d/tftp
- sed -i -e 's/\=\ yes/\=\ no/g' /etc/xinetd.d/rsync
- service xinetd restart
- chkconfig ip6tables off
- chkconfig iptables off
- /etc/init.d/ip6tables stop
- /etc/init.d/iptables stop
- sed -i 's/next_server: 127.0.0.1/next_server: 192.168.1.225/g' /etc/cobbler/settings
- sed -i 's/manage_rsync: 0/manage_rsync: 1/g' /etc/cobbler/settings
- sed -i 's/manage_dhcp: 0/manage_dhcp: 1/g' /etc/cobbler/settings
- subnet 192.168.1.0 netmask 255.255.255.0 {
- option routers 192.168.1.1;
- option domain-name-servers 202.106.0.20;
- option subnet-mask 255.255.255.0;
- range dynamic-bootp 192.168.1.10 192.168.1.50;
- filename "/pxelinux.0";
- default-lease-time 21600;
- max-lease-time 43200;
- next-server $next_server;
- }
- cobbler get-loaders
- [root@cobbler mnt]# mount -o loop /root/rhel-server-5.3-i386-dvd.iso /mnt/rhel/
- [root@cobbler mnt]# cobbler import --path=/mnt/rhel/ --name=rhel-server-5.3-i386
- task started: 2012-09-11_225453_import
- task started (id=Media import, time=Tue Sep 11 22:54:53 2012)
- Found a redhat compatible signature: Server
- adding distros
- creating new distro: rhel-server-5.3-i386
- creating new profile: rhel-server-5.3-i386
- creating new distro: rhel-server-5.3-xen-i386
- creating new profile: rhel-server-5.3-xen-i386
- associating repos
- traversing distro rhel-server-5.3-i386
- descent into /var/www/cobbler/ks_mirror/rhel-server-5.3-i386
- processing repo at : /var/www/cobbler/ks_mirror/rhel-server-5.3-i386/ClusterStorage
- need to process repo/comps: /var/www/cobbler/ks_mirror/rhel-server-5.3-i386/ClusterStorage
- looking for /var/www/cobbler/ks_mirror/rhel-server-5.3-i386/ClusterStorage/repodata/*comps*.xml
- running: createrepo -c cache -s sha --groupfile /var/www/cobbler/ks_mirror/rhel-server-5.3-i386/ClusterStorage/repodata/comps-rhel5-cluster-st.xml /var/www/cobbler/ks_mirror/rhel-server-5.3-i386/ClusterStorage
- 39/39 - Global_File_System-mr-IN-5.2-1.noarch.rpm
- Saving Primary metadata
- Saving file lists metadata
- Saving other metadata
- received on stderr: This option is deprecated
- processing repo at : /var/www/cobbler/ks_mirror/rhel-server-5.3-i386/Server
- need to process repo/comps: /var/www/cobbler/ks_mirror/rhel-server-5.3-i386/Server
- looking for /var/www/cobbler/ks_mirror/rhel-server-5.3-i386/Server/repodata/*comps*.xml
- running: createrepo -c cache -s sha --groupfile /var/www/cobbler/ks_mirror/rhel-server-5.3-i386/Server/repodata/comps-rhel5-server-core.xml /var/www/cobbler/ks_mirror/rhel-server-5.3-i386/Server
- 2216/2216 - m17n-db-kazakh-1.3.3-48.el5.noarch.rpm m
- Saving Primary metadata
- Saving file lists metadata
- Saving other metadata
- received on stderr: This option is deprecated
- processing repo at : /var/www/cobbler/ks_mirror/rhel-server-5.3-i386/VT
- need to process repo/comps: /var/www/cobbler/ks_mirror/rhel-server-5.3-i386/VT
- looking for /var/www/cobbler/ks_mirror/rhel-server-5.3-i386/VT/repodata/*comps*.xml
- running: createrepo -c cache -s sha --groupfile /var/www/cobbler/ks_mirror/rhel-server-5.3-i386/VT/repodata/comps-rhel5-vt.xml /var/www/cobbler/ks_mirror/rhel-server-5.3-i386/VT
- 35/35 - xen-3.0.3-80.el5.i386.rpm
- Saving Primary metadata
- Saving file lists metadata
- Saving other metadata
- received on stderr: This option is deprecated
- processing repo at : /var/www/cobbler/ks_mirror/rhel-server-5.3-i386/Cluster
- need to process repo/comps: /var/www/cobbler/ks_mirror/rhel-server-5.3-i386/Cluster
- looking for /var/www/cobbler/ks_mirror/rhel-server-5.3-i386/Cluster/repodata/*comps*.xml
- running: createrepo -c cache -s sha --groupfile /var/www/cobbler/ks_mirror/rhel-server-5.3-i386/Cluster/repodata/comps-rhel5-cluster.xml /var/www/cobbler/ks_mirror/rhel-server-5.3-i386/Cluster
- 32/32 - Cluster_Administration-es-ES-5.2-1.noarch.rpm
- Saving Primary metadata
- Saving file lists metadata
- Saving other metadata
- received on stderr: This option is deprecated
- traversing distro rhel-server-5.3-xen-i386
- descent into /var/www/cobbler/ks_mirror/rhel-server-5.3-i386
- processing repo at : /var/www/cobbler/ks_mirror/rhel-server-5.3-i386/ClusterStorage
- need to process repo/comps: /var/www/cobbler/ks_mirror/rhel-server-5.3-i386/ClusterStorage
- looking for /var/www/cobbler/ks_mirror/rhel-server-5.3-i386/ClusterStorage/repodata/*comps*.xml
- running: createrepo -c cache -s sha --groupfile /var/www/cobbler/ks_mirror/rhel-server-5.3-i386/ClusterStorage/repodata/comps-rhel5-cluster-st.xml /var/www/cobbler/ks_mirror/rhel-server-5.3-i386/ClusterStorage
- 39/39 - Global_File_System-mr-IN-5.2-1.noarch.rpm
- Saving Primary metadata
- Saving file lists metadata
- Saving other metadata
- received on stderr: This option is deprecated
- processing repo at : /var/www/cobbler/ks_mirror/rhel-server-5.3-i386/Server
- need to process repo/comps: /var/www/cobbler/ks_mirror/rhel-server-5.3-i386/Server
- looking for /var/www/cobbler/ks_mirror/rhel-server-5.3-i386/Server/repodata/*comps*.xml
- running: createrepo -c cache -s sha --groupfile /var/www/cobbler/ks_mirror/rhel-server-5.3-i386/Server/repodata/comps-rhel5-server-core.xml /var/www/cobbler/ks_mirror/rhel-server-5.3-i386/Server
- 2216/2216 - m17n-db-kazakh-1.3.3-48.el5.noarch.rpm m
- Saving Primary metadata
- Saving file lists metadata
- Saving other metadata
- received on stderr: This option is deprecated
- processing repo at : /var/www/cobbler/ks_mirror/rhel-server-5.3-i386/VT
- need to process repo/comps: /var/www/cobbler/ks_mirror/rhel-server-5.3-i386/VT
- looking for /var/www/cobbler/ks_mirror/rhel-server-5.3-i386/VT/repodata/*comps*.xml
- running: createrepo -c cache -s sha --groupfile /var/www/cobbler/ks_mirror/rhel-server-5.3-i386/VT/repodata/comps-rhel5-vt.xml /var/www/cobbler/ks_mirror/rhel-server-5.3-i386/VT
- 35/35 - xen-3.0.3-80.el5.i386.rpm
- Saving Primary metadata
- Saving file lists metadata
- Saving other metadata
- received on stderr: This option is deprecated
- processing repo at : /var/www/cobbler/ks_mirror/rhel-server-5.3-i386/Cluster
- need to process repo/comps: /var/www/cobbler/ks_mirror/rhel-server-5.3-i386/Cluster
- looking for /var/www/cobbler/ks_mirror/rhel-server-5.3-i386/Cluster/repodata/*comps*.xml
- running: createrepo -c cache -s sha --groupfile /var/www/cobbler/ks_mirror/rhel-server-5.3-i386/Cluster/repodata/comps-rhel5-cluster.xml /var/www/cobbler/ks_mirror/rhel-server-5.3-i386/Cluster
- 32/32 - Cluster_Administration-es-ES-5.2-1.noarch.rpm
- Saving Primary metadata
- Saving file lists metadata
- Saving other metadata
- received on stderr: This option is deprecated
- associating kickstarts
- *** TASK COMPLETE ***
- [root@cobbler ~]# cobbler sync
- task started: 2012-09-11_233141_sync
- task started (id=Sync, time=Tue Sep 11 23:31:41 2012)
- running pre-sync triggers
- cleaning trees
- removing: /var/www/cobbler/images/rhel-server-5.3-xen-i386
- removing: /var/www/cobbler/images/rhel-server-5.3-i386
- removing: /tftpboot/pxelinux.cfg/default
- removing: /tftpboot/grub/images
- removing: /tftpboot/grub/efidefault
- removing: /tftpboot/s390x/profile_list
- copying bootloaders
- copying: /var/lib/cobbler/loaders/pxelinux.0 -> /tftpboot/pxelinux.0
- copying: /usr/lib/syslinux/pxelinux.0 -> /tftpboot/pxelinux.0
- copying: /usr/lib/syslinux/menu.c32 -> /tftpboot/menu.c32
- copying: /var/lib/cobbler/loaders/yaboot -> /tftpboot/yaboot
- copying: /usr/lib/syslinux/memdisk -> /tftpboot/memdisk
- copying distros to tftpboot
- copying files for distro: rhel-server-5.3-xen-i386
- trying hardlink /var/www/cobbler/ks_mirror/rhel-server-5.3-i386/images/xen/vmlinuz -> /tftpboot/images/rhel-server-5.3-xen-i386/vmlinuz
- trying hardlink /var/www/cobbler/ks_mirror/rhel-server-5.3-i386/images/xen/initrd.img -> /tftpboot/images/rhel-server-5.3-xen-i386/initrd.img
- copying files for distro: rhel-server-5.3-i386
- trying hardlink /var/www/cobbler/ks_mirror/rhel-server-5.3-i386/images/pxeboot/vmlinuz -> /tftpboot/images/rhel-server-5.3-i386/vmlinuz
- trying hardlink /var/www/cobbler/ks_mirror/rhel-server-5.3-i386/images/pxeboot/initrd.img -> /tftpboot/images/rhel-server-5.3-i386/initrd.img
- copying images
- generating PXE configuration files
- generating PXE menu structure
- copying files for distro: rhel-server-5.3-xen-i386
- trying hardlink /var/www/cobbler/ks_mirror/rhel-server-5.3-i386/images/xen/vmlinuz -> /var/www/cobbler/images/rhel-server-5.3-xen-i386/vmlinuz
- trying hardlink /var/www/cobbler/ks_mirror/rhel-server-5.3-i386/images/xen/initrd.img -> /var/www/cobbler/images/rhel-server-5.3-xen-i386/initrd.img
- copying files for distro: rhel-server-5.3-i386
- trying hardlink /var/www/cobbler/ks_mirror/rhel-server-5.3-i386/images/pxeboot/vmlinuz -> /var/www/cobbler/images/rhel-server-5.3-i386/vmlinuz
- trying hardlink /var/www/cobbler/ks_mirror/rhel-server-5.3-i386/images/pxeboot/initrd.img -> /var/www/cobbler/images/rhel-server-5.3-i386/initrd.img
- rendering DHCP files
- generating /etc/dhcpd.conf
- rendering TFTPD files
- generating /etc/xinetd.d/tftp
- cleaning link caches
- running post-sync triggers
- running python triggers from /var/lib/cobbler/triggers/sync/post/*
- running python trigger cobbler.modules.sync_post_restart_services
- running: dhcpd -t -q
- received on stdout:
- received on stderr:
- running: service dhcpd restart
- received on stdout: Starting dhcpd: [ OK ]
- received on stderr:
- running shell triggers from /var/lib/cobbler/triggers/sync/post/*
- running python triggers from /var/lib/cobbler/triggers/change/*
- running python trigger cobbler.modules.scm_track
- running shell triggers from /var/lib/cobbler/triggers/change/*
- *** TASK COMPLETE ***
- 看到以下内容即成功:
- running shell triggers from /var/lib/cobbler/triggers/change/*
- *** TASK COMPLETE ***
- 若看到以下内容:
- dhcpd -t failed
- Exception occured: cobbler.cexceptions.CX
- Exception value: 'cobbler trigger failed: cobbler.modules.sync_post_restart_services'
- ......................................................................
- [root@cobbler kickstarts]# cat sample.ks
- #platform=x86, AMD64, or Intel EM64T
- # System authorization information
- auth --useshadow --enablemd5
- # System bootloader configuration
- bootloader --location=mbr
- # Partition clearing information
- clearpart --all --initlabel
- # Use text mode install
- lang zh_CN.UTF-8
- #langsupport zh_CN.UTF-8 en_US --default=en_US
- keyboard us
- #mouse generic3ps/2
- timezone Asia/Shanghai
- install
- url --url=$tree
- text
- #zerombr yes
- #Partition clearing information
- part /boot --fstype ext3 --size=100
- part swap --size=2048
- part / --fstype ext3 --size=10000
- network --bootproto static --device eth0 --ip 192.168.1.55 --netmask 255.255.255.0 --gateway=192.168.1.1 --noipv6 --hostname test
- firewall --disabled
- selinux --disabled
- skipx
- # Network information
- #--- Reboot the host after installation is done
- reboot
- #Root password
- rootpw 123456
- %pre
- $SNIPPET('log_ks_pre')
- $SNIPPET('kickstart_start')
- $SNIPPET('pre_install_network_config')
- %packages
- @base
- @core
- @development
- device-mapper-multipath
- imake
- %post
- $SNIPPET('log_ks_post')
- # Start yum configuration
- $yum_config_stanza
- # End yum configuration
- $SNIPPET('post_install_kernel_options')
- #$SNIPPET('post_install_network_config')
- echo "NETWORKING=yes" >/etc/sysconfig/network
- echo "NETWORKING_IPV6=no" >>/etc/sysconfig/network
- echo "HOSTNAME=cobbler" >>/etc/sysconfig/network
- echo "GATEWAY=192.168.1.1">>/etc/sysconfig/network
- echo "nameserver 192.168.1.1" >/etc/resolv.conf
- echo "nameserver 202.106.0.20" >>/etc/resolv.conf
- for service in `chkconfig --list|awk '{print $1}'|egrep -v "^$"|awk -F ":" '{print $1}'`; do chkconfig $service off;done
- for service in crond sshd syslog network; do chkconfig $service on;done
- ulimit -HSn 65535
- echo "this is cobber">/etc/motd
- # Start final steps
- $SNIPPET('kickstart_done')
- # End final steps
- [root@cobbler CentOS]# cd /var/www/cobbler/repo_mirror/rhel-5.3/CentOS/
- [root@cobbler CentOS]# ll|wc -l
- 2726
- cobbler repo add --name=rhel-5.3 --mirror=http://mirrors.163.com/centos/5/os/i386/
- cobbler reposync
11、设置profile和system:
- cobbler profile --name=rhel6 --distro=RHEL6_X86_64-x86_64 --kickstart=/var/lib/cobbler/kickstarts/rhel6.ks
- yum install cobbler-web
2、设置用户名密码:
为已存在的用户重置密码:
- htdigest /etc/cobbler/users.digest "Cobbler" cobbler
- 添加新用户:
- htdigest /etc/cobbler/users.digest "Cobbler" your_newname
- sed -i 's/authn_denyall/authn_configfile/g' /etc/cobbler/modules.conf
- service cobblerd restart
- /etc/init.d/httpd restart
5、Cobbler web界面访问地址:
- [root@cobbler centos-6.3]# cobbler list
- distros:
- rhel-5.3-i386
- rhel-5.3-xen-i386
- profiles:
- rhel-5.3-i386
- rhel-5.3-xen-i386
- systems:
- repos:
- rhel-5.3
- images:
- mgmtclasses:
- packages:
- files:
- [root@cobbler centos-6.3]# cobbler import --path=/mnt/centos-6.3/ --name=centos6.3
- task started: 2012-09-23_074339_import
- task started (id=Media import, time=Sun Sep 23 07:43:39 2012)
- Found a redhat compatible signature: Packages
- adding distros
- creating new distro: centos-6.3-i386
- creating new profile: centos-6.3-i386
- associating repos
- traversing distro centos-6.3-i386
- descent into /var/www/cobbler/ks_mirror/centos-6.3
- processing repo at : /var/www/cobbler/ks_mirror/centos-6.3
- need to process repo/comps: /var/www/cobbler/ks_mirror/centos-6.3
- looking for /var/www/cobbler/ks_mirror/centos-6.3/repodata/*comps*.xml
- running: createrepo -c cache -s sha --groupfile /var/www/cobbler/ks_mirror/centos-6.3/repodata/151ad5b0a3056212a6012b429192adcabba8b37571ff12453d6a29bc5199c943-c6-i386-comps.xml /var/www/cobbler/ks_mirror/centos-6.3
- 3024/3024 - Packages/git-1.7.1-2.el6_0.1.i686.rpm mpm
- Saving Primary metadata
- Saving file lists metadata
- Saving other metadata
- received on stderr: This option is deprecated
- associating kickstarts
- *** TASK COMPLETE ***
- [root@cobbler images]# cobbler list
- distros:
- centos6.3-i386
- rhel-5.3-i386
- rhel-5.3-xen-i386
- profiles:
- centos6.3-i386
- rhel-5.3-i386
- rhel-5.3-xen-i386
- systems:
- repos:
- rhel-5.3
- images:
- mgmtclasses:
- packages:
- files:
- [root@cobbler images]# cobbler profile edit --name=centos6.3-i386 --distro=centos6.3-i386 --kickstart=/var/lib/cobbler/kickstarts/centos-6.3.ks
- [root@cobbler images]# cobbler list
- distros:
- centos6.3-i386
- rhel-5.3-i386
- rhel-5.3-xen-i386
- profiles:
- centos6.3-i386
- rhel-5.3-i386
- rhel-5.3-xen-i386
- systems:
- repos:
- rhel-5.3
- images:
- mgmtclasses:
- packages:
- files:
- [root@cobbler images]# cobbler sync
- task started: 2012-09-23_104034_sync
- task started (id=Sync, time=Sun Sep 23 10:40:34 2012)
- running pre-sync triggers
- cleaning trees
- removing: /var/www/cobbler/images/rhel-5.3-xen-i386
- removing: /var/www/cobbler/images/rhel-5.3-i386
- removing: /var/www/cobbler/images/centos6.3-i386
- removing: /tftpboot/pxelinux.cfg/default
- removing: /tftpboot/grub/grub-x86_64.efi
- removing: /tftpboot/grub/grub-x86.efi
- removing: /tftpboot/grub/efidefault
- removing: /tftpboot/grub/images
- removing: /tftpboot/s390x/profile_list
- copying bootloaders
- trying hardlink /var/lib/cobbler/loaders/grub-x86_64.efi -> /tftpboot/grub/grub-x86_64.efi
- trying hardlink /var/lib/cobbler/loaders/grub-x86.efi -> /tftpboot/grub/grub-x86.efi
- copying distros to tftpboot
- copying files for distro: rhel-5.3-i386
- trying hardlink /var/www/cobbler/ks_mirror/rhel-5.3/images/pxeboot/vmlinuz -> /tftpboot/images/rhel-5.3-i386/vmlinuz
- trying hardlink /var/www/cobbler/ks_mirror/rhel-5.3/images/pxeboot/initrd.img -> /tftpboot/images/rhel-5.3-i386/initrd.img
- copying files for distro: centos6.3-i386
- trying hardlink /var/www/cobbler/ks_mirror/centos6.3/images/pxeboot/vmlinuz -> /tftpboot/images/centos6.3-i386/vmlinuz
- trying hardlink /var/www/cobbler/ks_mirror/centos6.3/images/pxeboot/initrd.img -> /tftpboot/images/centos6.3-i386/initrd.img
- copying files for distro: rhel-5.3-xen-i386
- trying hardlink /var/www/cobbler/ks_mirror/rhel-5.3/images/xen/vmlinuz -> /tftpboot/images/rhel-5.3-xen-i386/vmlinuz
- trying hardlink /var/www/cobbler/ks_mirror/rhel-5.3/images/xen/initrd.img -> /tftpboot/images/rhel-5.3-xen-i386/initrd.img
- copying images
- generating PXE configuration files
- generating PXE menu structure
- copying files for distro: rhel-5.3-i386
- trying hardlink /var/www/cobbler/ks_mirror/rhel-5.3/images/pxeboot/vmlinuz -> /var/www/cobbler/images/rhel-5.3-i386/vmlinuz
- trying hardlink /var/www/cobbler/ks_mirror/rhel-5.3/images/pxeboot/initrd.img -> /var/www/cobbler/images/rhel-5.3-i386/initrd.img
- copying files for distro: centos6.3-i386
- trying hardlink /var/www/cobbler/ks_mirror/centos6.3/images/pxeboot/vmlinuz -> /var/www/cobbler/images/centos6.3-i386/vmlinuz
- trying hardlink /var/www/cobbler/ks_mirror/centos6.3/images/pxeboot/initrd.img -> /var/www/cobbler/images/centos6.3-i386/initrd.img
- copying files for distro: rhel-5.3-xen-i386
- trying hardlink /var/www/cobbler/ks_mirror/rhel-5.3/images/xen/vmlinuz -> /var/www/cobbler/images/rhel-5.3-xen-i386/vmlinuz
- trying hardlink /var/www/cobbler/ks_mirror/rhel-5.3/images/xen/initrd.img -> /var/www/cobbler/images/rhel-5.3-xen-i386/initrd.img
- rendering DHCP files
- generating /etc/dhcpd.conf
- rendering TFTPD files
- generating /etc/xinetd.d/tftp
- cleaning link caches
- running post-sync triggers
- running python triggers from /var/lib/cobbler/triggers/sync/post/*
- running python trigger cobbler.modules.sync_post_restart_services
- running: dhcpd -t -q
- received on stdout:
- received on stderr:
- running: service dhcpd restart
- received on stdout: Shutting down dhcpd: [ OK ]
- Starting dhcpd: [ OK ]
- received on stderr:
- running shell triggers from /var/lib/cobbler/triggers/sync/post/*
- running python triggers from /var/lib/cobbler/triggers/change/*
- running python trigger cobbler.modules.scm_track
- running shell triggers from /var/lib/cobbler/triggers/change/*
- *** TASK COMPLETE ***
- [root@cobbler kickstarts]# cat centos-6.3.ks
- #platform=x86, AMD64, or Intel EM64T
- # System authorization information
- auth --useshadow --enablemd5
- # System bootloader configuration
- bootloader --location=mbr
- # Use text mode install
- lang zh_CN.UTF-8
- #langsupport zh_CN.UTF-8 en_US --default=en_US
- keyboard us
- #mouse generic3ps/2
- timezone Asia/Shanghai
- install
- url --url=http://192.168.1.225/cobbler/ks_mirror/centos6.3
- text
- #zerombr yes
- # Partition clearing information
- clearpart --all --initlabel
- #Partition clearing information
- part /boot --fstype ext4 --size=100
- part swap --size=2048
- part / --fstype ext4 --size=10000
- network --bootproto static --device eth0 --ip 192.168.1.30 --netmask 255.255.255.0 --gateway=192.168.1.1 --noipv6 --hostname cobbler
- firewall --disabled
- selinux --disabled
- skipx
- # Network information
- #--- Reboot the host after installation is done
- reboot
- #Root password
- rootpw 111111
- %pre
- $SNIPPET('log_ks_pre')
- $SNIPPET('kickstart_start')
- $SNIPPET('pre_install_network_config')
- %packages
- @base
- @core
- %post
- $SNIPPET('log_ks_post')
- # Start yum configuration
- $yum_config_stanza
- # End yum configuration
- $SNIPPET('post_install_kernel_options')
- #$SNIPPET('post_install_network_config')
- echo "NETWORKING=yes" >/etc/sysconfig/network
- echo "NETWORKING_IPV6=no" >>/etc/sysconfig/network
- echo "HOSTNAME=cobbler" >>/etc/sysconfig/network
- echo "nameserver 192.168.1.1" >/etc/resolv.conf
- echo "nameserver 202.106.0.20" >>/etc/resolv.conf
- for service in `chkconfig --list|awk '{print $1}'|egrep -v "^$"|awk -F ":" '{print $1}'`; do chkconfig $service off;done
- for service in crond sshd syslog network; do chkconfig $service on;done
- ulimit -HSn 65535
- # Start final steps
- $SNIPPET('kickstart_done')
- # End final steps
- [root@cobbler images]# cobbler system add --name=centos6.3-i386 --mac=00:0C:29:A0:26:7F --ip-address=192.168.1.30 --subnet=255.255.255.0 --gateway=192.168.1.1 --interface=eth0 --static=1 --dns-name=202.106.0.20 --profile=centos6.3-i386
- [root@cobbler images]# cobbler list
- distros:
- centos6.3-i386
- rhel-5.3-i386
- rhel-5.3-xen-i386
- profiles:
- centos6.3-i386
- rhel-5.3-i386
- rhel-5.3-xen-i386
- systems:
- centos6.3-i386
- repos:
- rhel-5.3
- images:
- mgmtclasses:
- packages:
- files:
- [root@cobbler images]# cobbler sync
- task started: 2012-09-23_104149_sync
- task started (id=Sync, time=Sun Sep 23 10:41:49 2012)
- running pre-sync triggers
- cleaning trees
- removing: /var/www/cobbler/images/rhel-5.3-xen-i386
- removing: /var/www/cobbler/images/rhel-5.3-i386
- removing: /var/www/cobbler/images/centos6.3-i386
- removing: /tftpboot/pxelinux.cfg/01-00-0c-29-a0-26-7f
- removing: /tftpboot/pxelinux.cfg/default
- removing: /tftpboot/grub/grub-x86_64.efi
- removing: /tftpboot/grub/grub-x86.efi
- removing: /tftpboot/grub/efidefault
- removing: /tftpboot/grub/images
- removing: /tftpboot/grub/01-00-0C-29-A0-26-7F
- removing: /tftpboot/s390x/profile_list
- copying bootloaders
- trying hardlink /var/lib/cobbler/loaders/grub-x86_64.efi -> /tftpboot/grub/grub-x86_64.efi
- trying hardlink /var/lib/cobbler/loaders/grub-x86.efi -> /tftpboot/grub/grub-x86.efi
- copying distros to tftpboot
- copying files for distro: rhel-5.3-i386
- trying hardlink /var/www/cobbler/ks_mirror/rhel-5.3/images/pxeboot/vmlinuz -> /tftpboot/images/rhel-5.3-i386/vmlinuz
- trying hardlink /var/www/cobbler/ks_mirror/rhel-5.3/images/pxeboot/initrd.img -> /tftpboot/images/rhel-5.3-i386/initrd.img
- copying files for distro: centos6.3-i386
- trying hardlink /var/www/cobbler/ks_mirror/centos6.3/images/pxeboot/vmlinuz -> /tftpboot/images/centos6.3-i386/vmlinuz
- trying hardlink /var/www/cobbler/ks_mirror/centos6.3/images/pxeboot/initrd.img -> /tftpboot/images/centos6.3-i386/initrd.img
- copying files for distro: rhel-5.3-xen-i386
- trying hardlink /var/www/cobbler/ks_mirror/rhel-5.3/images/xen/vmlinuz -> /tftpboot/images/rhel-5.3-xen-i386/vmlinuz
- trying hardlink /var/www/cobbler/ks_mirror/rhel-5.3/images/xen/initrd.img -> /tftpboot/images/rhel-5.3-xen-i386/initrd.img
- copying images
- generating PXE configuration files
- generating: /tftpboot/pxelinux.cfg/01-00-0c-29-a0-26-7f
- generating: /tftpboot/grub/01-00-0C-29-A0-26-7F
- generating PXE menu structure
- copying files for distro: rhel-5.3-i386
- trying hardlink /var/www/cobbler/ks_mirror/rhel-5.3/images/pxeboot/vmlinuz -> /var/www/cobbler/images/rhel-5.3-i386/vmlinuz
- trying hardlink /var/www/cobbler/ks_mirror/rhel-5.3/images/pxeboot/initrd.img -> /var/www/cobbler/images/rhel-5.3-i386/initrd.img
- copying files for distro: centos6.3-i386
- trying hardlink /var/www/cobbler/ks_mirror/centos6.3/images/pxeboot/vmlinuz -> /var/www/cobbler/images/centos6.3-i386/vmlinuz
- trying hardlink /var/www/cobbler/ks_mirror/centos6.3/images/pxeboot/initrd.img -> /var/www/cobbler/images/centos6.3-i386/initrd.img
- copying files for distro: rhel-5.3-xen-i386
- trying hardlink /var/www/cobbler/ks_mirror/rhel-5.3/images/xen/vmlinuz -> /var/www/cobbler/images/rhel-5.3-xen-i386/vmlinuz
- trying hardlink /var/www/cobbler/ks_mirror/rhel-5.3/images/xen/initrd.img -> /var/www/cobbler/images/rhel-5.3-xen-i386/initrd.img
- rendering DHCP files
- generating /etc/dhcpd.conf
- rendering TFTPD files
- generating /etc/xinetd.d/tftp
- cleaning link caches
- running post-sync triggers
- running python triggers from /var/lib/cobbler/triggers/sync/post/*
- running python trigger cobbler.modules.sync_post_restart_services
- running: dhcpd -t -q
- received on stdout:
- received on stderr:
- running: service dhcpd restart
- received on stdout: Shutting down dhcpd: [ OK ]
- Starting dhcpd: [ OK ]
- received on stderr:
- running shell triggers from /var/lib/cobbler/triggers/sync/post/*
- running python triggers from /var/lib/cobbler/triggers/change/*
- running python trigger cobbler.modules.scm_track
- running shell triggers from /var/lib/cobbler/triggers/change/*
- *** TASK COMPLETE ***
- [root@cobbler cobbler]# service httpd start
- Starting httpd: Syntax error on line 10 of /etc/httpd/conf.d/cobbler.conf:
- Invalid command 'WSGIScriptAliasMatch', perhaps misspelled or defined by a module not included in the server configuration
- [FAILED]
- [root@cobbler cobbler]# cat /etc/httpd/conf.d/wsgi.conf
- #################################################################################
- # mod_python and mod_wsgi compatibility note
- #################################################################################
- # mod_wsgi will deadlock if run in daemon mode while mod_python is enabled
- # do not enable both mod_python and mod_wsgi if you are going to use the
- # WSGIDaemonProcess directive
- # In previous version of mod_wsgi, apache would segfault when both mod_wsgi
- # and mod_python were enabled. This update does not guarantee that will not
- # happen.
- #################################################################################
- # Do not enable mod_python and mod_wsgi in the same apache process.
- #################################################################################
- LoadModule wsgi_module modules/mod_wsgi.so
- [root@cobbler cobbler]# service httpd restart
- Stopping httpd: [FAILED]
- Starting httpd: [Mon Sep 10 02:34:26 2012] [warn] The Alias directive in /etc/httpd/conf/httpd.conf at line 995 will probably never match because it overlaps an earlier Alias.
- [ OK ]
- [root@cobbler cobbler]# lsof -i:80
- COMMAND PID USER FD TYPE DEVICE SIZE NODE NAME
- httpd 3128 root 3u IPv6 437066 TCP *:http (LISTEN)
- httpd 3130 apache 3u IPv6 437066 TCP *:http (LISTEN)
- httpd 3131 apache 3u IPv6 437066 TCP *:http (LISTEN)
- httpd 3132 apache 3u IPv6 437066 TCP *:http (LISTEN)
- httpd 3133 apache 3u IPv6 437066 TCP *:http (LISTEN)
- httpd 3134 apache 3u IPv6 437066 TCP *:http (LISTEN)
- httpd 3135 apache 3u IPv6 437066 TCP *:http (LISTEN)
- httpd 3136 apache 3u IPv6 437066 TCP *:http (LISTEN)
- httpd 3137 apache 3u IPv6 437066 TCP *:http (LISTEN)
- [root@cobbler ~]# /etc/init.d/cobblerd start
- Starting cobbler daemon: No module named ctypes
- Traceback (most recent call last):
- File "/usr/bin/cobblerd", line 76, in main
- api = cobbler_api.BootAPI(is_cobblerd=True)
- File "/usr/lib/python2.4/site-packages/cobbler/api.py", line 127, in __init__
- module_loader.load_modules()
- File "/usr/lib/python2.4/site-packages/cobbler/module_loader.py", line 62, in load_modules
- blip = __import__("modules.%s" % ( modname), globals(), locals(), [modname])
- File "/usr/lib/python2.4/site-packages/cobbler/modules/authn_pam.py", line 53, in ?
- from ctypes import CDLL, POINTER, Structure, CFUNCTYPE, cast, pointer, sizeof
- ImportError: No module named ctypes
- [ OK ]
- [root@cobbler ~]# /etc/init.d/cobblerd status
- cobblerd dead but subsys locked
- [root@cobbler ~]# /etc/init.d/cobblerd start
- Starting cobbler daemon: [ OK ]
- [root@cobbler ~]# /etc/init.d/cobblerd status
- cobblerd (pid 30812) is running...
- [root@cobbler tmp]# /etc/init.d/httpd restart
- Stopping httpd: [ OK ]
- Starting httpd: httpd: apr_sockaddr_info_get() failed for cobbler
- httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName
- [ OK ]
- [root@cobbler tmp]# cat /etc/hosts
- # Do not remove the following line, or various programs
- # that require network functionality will fail.
- 127.0.0.1 localhost.localdomain localhost
- ::1 localhost6.localdomain6 localhost6
- 192.168.1.205 cobbler
- [root@cobbler tmp]# /etc/init.d/httpd restart
- Stopping httpd: [ OK ]
- Starting httpd: httpd: Could not reliably determine the server's fully qualified domain name, using 192.168.1.205 for ServerName
- [ OK ]
- [root@centos-6 centos-6.3]# cobbler get-loaders
- task started: 2012-09-21_004402_get_loaders
- task started (id=Download Bootloader Content, time=Fri Sep 21 00:44:02 2012)
- path /var/lib/cobbler/loaders/README already exists, not overwriting existing content, use --force if you wish to update
- path /var/lib/cobbler/loaders/COPYING.elilo already exists, not overwriting existing content, use --force if you wish to update
- downloading http://dgoodwin.fedorapeople.org/loaders/COPYING.yaboot to /var/lib/cobbler/loaders/COPYING.yaboot
- Exception occured: <class 'urlgrabber.grabber.URLGrabError'>
- Exception value: [Errno 14] PYCURL ERROR 6 - "Couldn't resolve host 'dgoodwin.fedorapeople.org'"
- Exception Info:
- File "/usr/lib/python2.6/site-packages/cobbler/remote.py", line 89, in run
- rc = self._run(self)
- File "/usr/lib/python2.6/site-packages/cobbler/remote.py", line 183, in runner
- return self.remote.api.dlcontent(self.options.get("force",False), self.logger)
- File "/usr/lib/python2.6/site-packages/cobbler/api.py", line 689, in dlcontent
- return grabber.run(force)
- File "/usr/lib/python2.6/site-packages/cobbler/action_dlcontent.py", line 80, in run
- urlgrabber.grabber.urlgrab(src, filename=dst, proxiesproxies=proxies)
- File "/usr/lib/python2.6/site-packages/urlgrabber/grabber.py", line 618, in urlgrab
- return default_grabber.urlgrab(url, filename, **kwargs)
- File "/usr/lib/python2.6/site-packages/urlgrabber/grabber.py", line 985, in urlgrab
- return self._retry(opts, retryfunc, url, filename)
- File "/usr/lib/python2.6/site-packages/urlgrabber/grabber.py", line 886, in _retry
- r = apply(func, (opts,) + args, {})
- File "/usr/lib/python2.6/site-packages/urlgrabber/grabber.py", line 971, in retryfunc
- fo = PyCurlFileObject(url, filename, opts)
- File "/usr/lib/python2.6/site-packages/urlgrabber/grabber.py", line 1066, in __init__
- self._do_open()
- File "/usr/lib/python2.6/site-packages/urlgrabber/grabber.py", line 1360, in _do_open
- self._do_grab()
- File "/usr/lib/python2.6/site-packages/urlgrabber/grabber.py", line 1490, in _do_grab
- self._do_perform()
- File "/usr/lib/python2.6/site-packages/urlgrabber/grabber.py", line 1347, in _do_perform
- raise err
- !!! TASK FAILED !!!
- [root@centos-6 yum.repos.d]# cat /etc/resolv.conf
- # Generated by NetworkManager
- #search 3
- # No nameservers found; try putting DNS servers into your
- # ifcfg files in /etc/sysconfig/network-scripts like so:
- #
- # DNS1=xxx.xxx.xxx.xxx
- # DNS2=xxx.xxx.xxx.xxx
- # DOMAIN=lab.foo.com bar.foo.com
- nameserver 8.8.8.8
- nameserver 202.106.0.20