ServerName 127.0.0.1:80/etc/init.d/httpd restart设置目标系统root密码,这个设置只对CentOS/RHEL有效
PASSWORD="echo "admin123" | openssl passwd -1 -salt 'root' –stdin"
sed -i s@"^default_password_crypted.*$"@"default_password_crypted: \"$PASSWORD\""@g /etc/cobbler/settings
--------------------------------------------------------------------------------
default_password_crypted: "$1$cobbler$k/5ITeQUOffuOujzEvhjY."
--------------------------------------------------------------------------------
下载启动菜单,启动报错请尝试service cobblerd restart
cobbler get-loaders
cobbler@root#cobbler get-loaderstask started: 2016-04-11_092911_get_loaders
task started (id=Download Bootloader Content, time=Mon Apr 11 09:29:11 2016)
downloading to /var/lib/cobbler/loaders/README
downloading to /var/lib/cobbler/loaders/COPYING.elilo
downloading to /var/lib/cobbler/loaders/COPYING.yaboot
downloading to /var/lib/cobbler/loaders/COPYING.syslinux
downloading to /var/lib/cobbler/loaders/elilo-ia64.efi
downloading to /var/lib/cobbler/loaders/yaboot
downloading to /var/lib/cobbler/loaders/pxelinux.0downloading
to /var/lib/cobbler/loaders/menu.c32
downloading to /var/lib/cobbler/loaders/grub-x86.efi
downloading to /var/lib/cobbler/loaders/grub-x86_64.efi
*** TASK COMPLETE ***#重启相关服务并配置自动启动chkconfig cobblerd on
chkconfig httpd on
chkconfig xinetd on
chkconfig dnsmasq on
service httpd restart
service xinetd restart
service dnsmasq restart
service cobblerd restart
#检查并同步cobbler配置,如果有如下报错确认文件存在可以忽略cobbler@ZJ/etc/cobbler#cobbler checkThe following are potential configuration items that you may want to fix:1 : file /etc/xinetd.d/rsync does not exist
Restart cobblerd and then run 'cobbler sync' to apply changes.
cobbler@ZJ/etc/cobbler#cobbler synctask started: 2016-04-11_170138_sync
task started (id=Sync, time=Mon Apr 11 17:01:38 2016)
running pre-sync triggers
cleaning trees
removing: /var/lib/tftpboot/grub/images
copying bootloaders
trying hardlink /var/lib/cobbler/loaders/pxelinux.0 ->
/var/lib/tftpboot/pxelinux.0trying hardlink /var/lib/cobbler/loaders/menu.c32 -> /var/lib/tftpboot/menu.c32
trying hardlink /var/lib/cobbler/loaders/yaboot -> /var/lib/tftpboot/yaboot
trying hardlink /usr/share/syslinux/memdisk -> /var/lib/tftpboot/memdisk
trying hardlink /var/lib/cobbler/loaders/grub-x86_64.efi -> /var/lib/tftpboot/grub/grub-x86_64.efi
trying hardlink /var/lib/cobbler/loaders/grub-x86.efi -> /var/lib/tftpboot/grub/grub-x86.efi
copying distros to tftpboot
copying images
generating PXE configuration files
generating PXE menu structure
rendering DHCP files
rendering DNS files
rendering TFTPD files
generating /etc/xinetd.d/tftp
cleaning link caches
rendering Rsync files
running post-sync triggers
running python triggers from /var/lib/cobbler/triggers/sync/post/*
running python trigger cobbler.modules.sync_post_restart_services
running: service dnsmasq restart
received on stdout: Shutting down dnsmasq: [ OK ]
Starting dnsmasq: [ 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 ***#开启动态编辑后的效果cobbler setting report
cobbler setting report [--name=option]
allow_duplicate_hostnames : 0allow_duplicate_ips : 0allow_duplicate_macs : 0allow_dynamic_settings : 1always_write_dhcp_entries : 0anamon_enabled : 0auth_token_expiration : 3600authn_pam_service : loginbind_chroot_path :
bind_master : 127.0.0.1build_reporting_email : ['root@localhost']
build_reporting_enabled : 0build_reporting_ignorelist : ['']
build_reporting_sender :
build_reporting_smtp_server : localhost
build_reporting_subject :
build_reporting_to_address :
buildisodir : /var/cache/cobbler/buildiso
cheetah_import_whitelist : ['random', 're', 'time']
client_use_https : 0client_use_localhost : 0cobbler_master :
consoles : /var/consoles
createrepo_flags : -c cache -s sha
default_deployment_method : ssh
default_kickstart : /var/lib/cobbler/kickstarts/default.ks
default_name_servers : []
default_name_servers_search : []
default_ownership : ['admin']
default_password_crypted : $1$root$JX8M6OcOn.pjk0pHdnG0y0
default_template_type : cheetah
default_virt_bridge : xenbr0
default_virt_disk_driver : raw
default_virt_file_size : 5default_virt_ram : 512default_virt_type : xenpvenable_gpxe : 0enable_menu : 1func_auto_setup : 0func_master : overlord.example.org
http_port : 80isc_set_host_name : 0iso_template_dir : /etc/cobbler/iso
kerberos_realm : EXAMPLE.COM
kernel_options : {'ksdevice': 'bootif', 'lang': ' ', 'text': '~'}
kernel_options_s390x : {'vnc': '~', 'ip': False, 'RUNKS': 1,
'ramdisk_size': 40000, 'ro': '~', 'root': '/dev/ram0'}
ldap_anonymous_bind : 1ldap_base_dn : DC=example,DC=com
ldap_management_default_type : authconfig
ldap_port : 389ldap_search_bind_dn :
ldap_search_passwd :
ldap_search_prefix : uid=
ldap_server : ldap.example.com
ldap_tls : 1ldap_tls_cacertfile :
ldap_tls_certfile :
ldap_tls_keyfile :
manage_dhcp : 1manage_dns : 1manage_forward_zones : []
manage_reverse_zones : []
manage_rsync : 1manage_tftp : 1manage_tftpd : 1mgmt_classes : []
mgmt_parameters : {'from_cobbler': 1}
next_server : 172.28.70.245power_management_default_type : ipmitool
power_template_dir : /etc/cobbler/power
proxy_url_ext :
proxy_url_int :
puppet_auto_setup : 0puppet_parameterized_classes : 1puppet_server : puppet
puppet_version : 2puppetca_path : /usr/bin/puppet
pxe_just_once : 1pxe_template_dir : /etc/cobbler/pxe
RedHat_management_key :
redhat_management_permissive : 0redhat_management_server : xmlrpc.rhn.redhat.com
redhat_management_type : off
register_new_installs : 0remove_old_puppet_certs_automatically : 0replicate_repo_rsync_options : -avzH
replicate_rsync_options : -avzH
reposync_flags : -l -n -drestart_dhcp : 1restart_dns : 1restart_xinetd : 1run_install_triggers : 1scm_track_enabled : 0scm_track_mode : git
serializer_pretty_json : 0server : 172.28.70.245sign_puppet_certs_automatically : 0signature_path : /var/lib/cobbler/distro_signatures.json
signature_url :
snippetsdir : /var/lib/cobbler/snippets
template_remote_kickstarts : 0virt_auto_boot : 1webdir : /var/www/cobbler
xmlrpc_port : 25151yum_distro_priority : 1yum_post_install_mirror : 1yumdownloader_flags : --resolve#修改seting文件cobbler登陆服务器地址cobbler setting edit --name=server --value=172.28.0.1#ks脚本关闭pxe,这样就不会重复安装cobbler setting edit --name=pxe_just_once --value=1#TFTP服务器 IP地址cobbler setting edit --name=next_server --value=172.28.0.1#cobbler管理rsync,dhcp,dnscobbler setting edit --name=manage_rsync --value=1cobbler setting edit --name=manage_dhcp --value=1cobbler setting edit --name=manage_dns --value=1cobbler导入镜像#使用镜像文件mount -o loop /tmp/rhel-server-6.3-x86_64-dvd.iso /mnt/rhel63#使用光盘mount /dev/sr0 /mnt/rhel63#执行镜像导入,并关联自定义的自动安装配置ks脚本,这个地方我们可以为不同的系统版本指定不同的自动安装ks脚本(这个过程实际比较长,cobbler
会把软件整个复制一份到本地,在这之前,务必确认硬盘空间足够装下镜
像)
cobbler import --path=/tmp/rhel63 --name=rhel63 --kickstart=/var/lib/cobbler/kickstarts/rhel63.cfg