1.cobbler介绍

Cobbler是一个快速网络安装linux的服务,而且在经过调整也可以支持网络安装windows。该工具使用python开发,小巧轻便(才15k行python代码),使用简单的命令即可完成PXE网络安装环境的配置,同时还可以管理DHCP、DNS、TFTP、RSYNC以及yum仓库、构造系统ISO镜像。Cobbler支持命令行管理,web界面管理,还提供了API接口,可以方便二次开发使用。Cobbler客户端Koan支持虚拟机安装和操作系统重新安装,使重装系统更便捷。

  Cobbler功能

     使用Cobbler,可以做到无需进行人工干预即可安装机器;Cobbler设置一个PXE引导环境(它还可使用yaboot支持PowerPC),并控制与安装相关的所有方面,比如网络引导服务     (DHCP和TFTP)与存储库镜像。当希望安装一台新机器时,Cobbler可以:使用一个以前定义的模板来配置DHCP服务(如果启用了管理 DHCP)将一个存储库(yum或rsync)建立镜像或解压缩一个媒介,以注册一个新操作系统在DHCP配置文件中为需要安装的机器创建一个条目,并使用您指定的参数(IP和MAC地址);在TFTFP服务目录下创建适当的PXE文件;重新启动DHCP服务以反映更改;重新启动机器以开始安装(如果电源管理已启用)。

2.cobbler部署

系统环境

  1. [root@cobbler-server ~]# cat /etc/redhat-release #系统版本
  2. CentOSLinux release 7.1.(Core)
  3. [root@cobbler-server ~]# uname r #内核版本
  4. 3.10.-.el7.x86_64
  5. [root@cobbler-server ~]# getenforce #检测selinux是否关闭(必须关闭)
  6. Disabled
  7. [root@cobbler-server ~]# systemctl stop firewalld #关闭防火墙
  8. [root@cobbler-server ~]# ifconfig eth0|awk -F '[ :]+''NR==2 {print $3}' #查看IP地址
  9. 10.0.0.101
  10. [root@cobbler-server ~]# hostname #查看主机名
  11. cobbler-server
  12. [root@cobbler-server ~]# wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo #cobbler安装必须使用到epel源

安装软件

  1. [root@cobbler-server ~]# yum install cobbler cobbler-web pykickstart httpd dhcp tftp xinetd

配置文件

  1. cobbler #cobbler程序包
  2. cobbler-web #cobbler的web服务包
  3. pykickstart #cobbler检查kickstart语法错误
  4. httpd #Apache web服务
  5. dhcp #Dhcp服务
  6. tftp #tftp服务
  7. /etc/cobbler #配置文件目录
  8. /etc/cobbler/settings #cobbler主配置文件
  9. /etc/cobbler/dhcp.template #DHCP服务的配置模板
  10. /etc/cobbler/tftpd.template #tftp服务的配置模板
  11. /etc/cobbler/rsync.template #rsync服务的配置模板
  12. /etc/cobbler/iso #iso模板配置文件目录
  13. /etc/cobbler/pxe #pxe模板文件目录
  14. /etc/cobbler/power #电源的配置文件目录
  15. /etc/cobbler/users.conf #web服务授权配置文件
  16. /etc/cobbler/users.digest #web访问的用户名密码配置文件
  17. /etc/cobbler/dnsmasq.template #DNS服务的配置模板
  18. /etc/cobbler/modules.conf #Cobbler模块配置文件
  19. /var/lib/cobbler #Cobbler数据目录
  20. /var/lib/cobbler/config #配置文件
  21. /var/lib/cobbler/kickstarts #默认存放kickstart文件
  22. /var/lib/cobbler/loaders #存放的各种引导程序
  23. /var/www/cobbler #系统安装镜像目录
  24. /var/www/cobbler/ks_mirror #导入的系统镜像列表
  25. /var/www/cobbler/images #导入的系统镜像启动文件
  26. /var/www/cobbler/repo_mirror #yum源存储目录
  27. /var/log/cobbler #日志目录
  28. /var/log/cobbler/install.log #客户端系统安装日志
  29. /var/log/cobbler/cobbler.log #cobbler日志

Cobbler的检测
     
cobbler的运行依赖于dhcp、tftp、rsync及dns服务,其中dhcp可由dhcpd(isc)提供,也可由dnsmasq提供;tftp可由tftp-server程序包提供,也可由cobbler功能提供,rsync有rsync程序包提供,dns可由bind提供,也可由dnsmasq提供cobbler可自行管理这些服务中的部分甚至是全部,但需要配置文件/etc/cobbler/settings中的“manange_dhcp”、“manager_tftpd”、“manager_rsync”、“manager_dns”分别来进行定义,另外,由于各种服务都有着不同的实现方式,如若需要进行自定义,需要通过修改/etc/cobbler/modules.conf配置文件中各服务的模块参数的值来实现。

 #启动apache服务

  1. [root@cobbler-server ~]# systemctl start httpd

  #启动cobbler程序

  1. [root@cobbler-server ~]# systemctl start cobblerd

查看检查

  1. [root@cobbler-server ~]# cobbler check #检查存在的问题,逐一解决

1)指定cobbler服务主机ip

  1. [root@cobbler-server ~]# sed -i 's/server: 127.0.0.1/server: 10.0.0.101/'/etc/cobbler/settings

2)提供PXE服务的主机ip

  1. [root@cobbler-server ~]# sed -i 's/next_server: 127.0.0.1/next_server: 10.0.0.101/'/etc/cobbler/settings

3)启用tftp服务

  1. [root@cobbler-server]#cat /etc/xinetd.d/tftp | grep disable
  2. disable = no

4)更新引导程序,如果不能下载可以在复制/usr/share/syslinux/{pxelinux.0,memu.c32}到/var/lib/cobbler/loaders/

  1. [root@cobbler-server ~]# cobbler get-loaders 下载引导程序

5)执行 systemctl enable rsyncd命令即可;

  1. [root@cobbler-server ~]# openssl passwd - -salt '$(openssl rand -hex 4)''cobbler'
  2. $$$(openss$.wbDUBV/STL0YaNuAcusK/
    [root@cobbler-server~]# grep "default_password_crypted"/etc/cobbler/settings   #替换/etc/cobbler/setting内的default_password_crypted为上个命令结果
    default_password_crypted:"$1$$(openss$.wbDUBV/STL0YaNuAcusK/"
  1. [root@cobbler-server~]# yum y install cman fence-agents

最后重启Cobbler:

  1. [root@cobbler-server~]# systemctl restart cobblerd

配置dhcp

  1. [root@cobbler-server~]# sed -i 's#manage_dhcp: 0#manage_dhcp: 1#g'/etc/cobbler/settings #使用cobbler管理dhcp
  2. [root@cobbler-server~]# vim /etc/cobbler/dhcp.template #修改cobbler的dhcp模版,因为cobbler会替换。
  3. subnet 10.0.0.0 netmask 255.255.255.0{
  4. option routers 10.0.0.2;
  5. option domain-name-servers 10.0.0.2;
  6. option subnet-mask 255.255.255.0;
  7. range dynamic-bootp 10.0.0.20010.0.0.;
  8. default-lease-time ;
  9. max-lease-time ;
  10. next-server $next_server;

同步cobbler

  1. [root@cobbler-server~]# systemctl restart xinetd #重启xinetd
  2. [root@cobbler-server~]# systemctl restart cobblerd #重启cobbler
  3. [root@cobbler-server~]# cobbler sync #同步最新cobbler配置,可以看具体做了哪些操作

3.管理cobbler服务

  1)上传系统镜像

  1. [root@cobbler-server ~]# mkdir /home/CentOS
    [root@cobbler-server ~]# mount /home/src/CentOS-6.7-i386-bin-DVD.iso /home/CentOS/ -o loop
  2. [root@cobbler-server ~]# cobbler import --mirror=/home/CentOS --name=CentOS-6.7
  3. [root@cobbler-server ~]# cobbler sync 应用配置模板
  4.  
  5. [root@cobbler-server ~]#cobbler import --path=/mnt/ --name=ubuntu-14.04.5

2)添加kickstart文件指定到系统列表

  1. [root@cobbler-server ~]#cobbler profile edit --name=CentOS-6.7.-x86_64-distro --kickstart=/var/lib/cobbler/kickstarts/Cobbler-CentOS-6.7-x86_64.cfg #指定ks路径
  1. [root@cobbler-server ~]#cobbler profile edit --name=CentOS-6.7.1-x86_64-distro --kickstart=/var/lib/cobbler/kickstarts/ubuntu.14.04.5.seed

3)添加system

  1. [root@cobbler kickstarts]#cobbler system add --name=vm01 --hostname=vm01 --mac=00:19:B9:E5:34:FE --interface=eth0 --ip-address=172.16.68.102 --subnet=255.255.255.0 --gateway=172.16.68.1 --static=1 --profile=centos5.8-x86_64

4)yum镜像

  1. [root@cobbler kickstarts]#cobbler repo edit --name=centos5.-x86_64-base --mirror=http://mirrors.163.com/centos/5/os/x86_64/ --arch=x86_64 --breed=yum
  1. [root@cobbler ~]# ln s /var/lib/cobbler/kickstarts/centos6.-ks.cfg /var/www/cobbler/pub/

指定无人看守安装

  1. [root@cobbler ~]# cat /var/lib/tftpboot/pxelinux.cfg/default
    DEFAULT menu
  2. PROMPT
  3. MENU TITLE Cobbler | http://cobbler.github.io
  4. TIMEOUT
  5. TOTALTIMEOUT
  6. ONTIMEOUT local
  7. LABEL local
  8. MENU LABEL (local)
  9. MENU DEFAULT
  10. LOCALBOOT -
  11. LABEL CentOS_6.-x86_64
  12. kernel /images/CentOS_6.-x86_64/vmlinuz
  13. MENU LABEL CentOS_6.-x86_64
  14. append initrd=/images/CentOS_6.-x86_64/initrd.img ksdevice=bootif lang= kssendmac text ks=http://172.16.68.61/cobbler/pub/centos6.5-ks.cfg
  15. ipappend
  16. MENU end
  17. ks文件
  1. [root@cobbler kickstarts]# cat CentOS_6..ks
  2. #version=DEVEL
  3. # Firewall configuration
  4. firewall --disabled
  5. # Install OS instead of upgrade
  6. install
  7. # Use CDROM installation media
  8. url --url=$tree
  9. # Root password
  10. rootpw --iscrypted $$78888O7t$XAdzFmSUXy7Ysqayh7IU/
  11. # System authorization information
  12. auth --useshadow --passalgo=sha512
  13. # Use graphical install
  14. graphical
  15. # System keyboard
  16. keyboard us
  17. # System language
  18. lang en_US
  19. # SELinux configuration
  20. selinux --disabled
  21. # Do not configure the X Window System
  22. skipx
  23. # Installation logging level
  24. logging --level=info
  25. # Reboot after installation
  26. reboot
  27. # Network information
  28. network --bootproto=dhcp --device=eth0 --onboot=on
  29. network --bootproto=dhcp --device=eth1 --onboot=on
  30. # System timezone
  31. timezone Africa/Abidjan
  32. # System bootloader configuration
  33. bootloader --location=mbr
  34. # Clear the Master Boot Record
  35. zerombr
  36. # Partition clearing information
  37. clearpart --all --initlabel
  38. ignoredisk --only-use=sda
  39. # Disk partitioning information
  40. part / --asprimary --fstype="ext4" --grow --size=
  41. part /boot --asprimary --fstype="ext4" --size=
  42. part swap --asprimary --fstype="swap" --size=
  43.  
  44. %packages --ignoremissing
  45. @additional-devel
  46. @chinese-support
  47. @development
  48. @server-platform-devel
  49.  
  50. %end
  51. %post --interpreter=/bin/bash --nochroot
  52. #sed -i s/ONBOOT=no/ONBOOT=yes/ /etc/sysconfig/network-scripts/ifcfg-eth0
  53. #service network restart | /bin/bash
  54. #dhclient -d | /bin/bash
  55. echo "install centos 6.5" > /root/install.txt
  56. %end
  1. ubuntu.seed 
  1. [root@cobbler kickstarts]# cat ubuntu.14.04..seed
  2. # Mostly based on the Ubuntu installation guide
  3. # https://help.ubuntu.com/12.04/installation-guide/
  4.  
  5. # Preseeding only locale sets language, country and locale.
  6. d-i debian-installer/locale string en_US
  7.  
  8. # Keyboard selection.
  9. # Disable automatic (interactive) keymap detection.
  10. d-i console-setup/ask_detect boolean false
  11. d-i keyboard-configuration/layoutcode string us
  12. d-i keyboard-configuration/variantcode string
  13.  
  14. # netcfg will choose an interface that has link if possible. This makes it
  15. # skip displaying a list if there is more than one interface.
  16.  
  17. d-i netcfg/enable boolean false
  18. d-i netcfg/choose_interface select auto
  19. #d-i netcfg/disable_dhcp boolean false
  20. #d-i netcfg/dhcp_timeout string
  21. d-i netcfg/disable_autoconfig boolean true
  22. d-i netcfg/dhcp_failed note
  23. d-i netcfg/dhcp_options select Do not configure the network at this time
  24. #set $myhostname = $getVar('hostname',$getVar('name','cobbler')).replace("_","-")
  25. d-i netcfg/get_hostname string $myhostname
  26. # If you have a slow dhcp server and the installer times out waiting for
  27. # it, this might be useful
  28. #d-i netcfg/dhcp_timeout string
  29.  
  30. #d-inetcfg/dhcp_failed note
  31. #d-inetcfg/dhcp_options select Configure network manually
  32.  
  33. # If non-free firmware is needed for the network or other hardware, you can
  34. # configure the installer to always try to load it, without prompting. Or
  35. # change to false to disable asking.
  36. #d-i hw-detect/load_firmware boolean true
  37.  
  38. # NTP/Time Setup
  39. d-i time/zone string Asia/Shanghai
  40. d-i clock-setup/utc boolean true
  41. d-i clock-setup/ntp boolean true
  42. d-i clock-setup/ntp-server string ntp.ubuntu.com
  43.  
  44. # Setup the installation source
  45. d-i mirror/country string manual
  46. d-i mirror/http/hostname string $http_server
  47. d-i mirror/http/directory string $install_source_directory
  48. d-i mirror/http/proxy string
  49.  
  50. #set $os_v = $getVar('os_version','')
  51. #if $os_v and $os_v.lower()[0] > 'p'
  52. # Required at least for 12.10+
  53. d-i live-installer/net-image string http://$http_server/cobbler/links/$distro_name/install/filesystem.squashfs
  54. #end if
  55.  
  56. # Suite to install.
  57. # d-i mirror/suite string precise
  58. # d-i mirror/udeb/suite string precise
  59.  
  60. # Components to use for loading installer components (optional).
  61. #d-i mirror/udeb/components multiselect main, restricted
  62.  
  63. # Disk Partitioning
  64. # Use LVM, and wipe out anything that already exists
  65. #d-i partman/choose_partition select finish
  66. #d-i partman/confirm boolean true
  67. #d-i partman/confirm_nooverwrite boolean true
  68. #d-i partman-auto/method string lvm
  69. #d-i partman-lvm/device_remove_lvm boolean true
  70. #d-i partman-lvm/confirm boolean true
  71. #d-i partman-lvm/confirm_nooverwrite boolean true
  72. #d-i partman-md/device_remove_md boolean true
  73. #d-i partman-partitioning/confirm_write_new_label boolean true
  74.  
  75. d-i partman-auto/disk string /dev/sda
  76. d-i partman-auto/method string regular
  77. d-i partman-lvm/device_remove_lvm boolean true
  78. d-i partman-md/device_remove_md boolean true
  79. d-i partman-lvm/confirm boolean true
  80. d-i partman-auto/expert_recipe string \
  81. boot-root :: \
  82. ext4 \
  83. $primary{ } \
  84. $bootable{ } \
  85. method{ format } \
  86. format{ } \
  87. use_filesystem{ } \
  88. filesystem{ ext4 } \
  89. mountpoint{ / } \
  90. . \
  91. linux-swap \
  92. method{ swap } \
  93. format{ } \
  94. . \
  95. max ext4 \
  96. method{ format } \
  97. format{ } \
  98. use_filesystem{ } \
  99. filesystem{ ext4 } \
  100. mountpoint{ /opt } \
  101. . \
  102. d-i partman/default_filesystem string ext4
  103.  
  104. d-i partman-partitioning/confirm_write_new_label boolean true
  105. d-i partman/choose_partition select finish
  106. d-i partman/confirm boolean true
  107. d-i partman/confirm_nooverwrite boolean true
  108. d-i partman/mount_style select uuid
  109.  
  110. # You can choose one of the three predefined partitioning recipes:
  111. # - atomic: all files in one partition
  112. # - home: separate /home partition
  113. # - multi: separate /home, /usr, /var, and /tmp partitions
  114. #d-i partman-auto/choose_recipe select
  115.  
  116. # If you just want to change the default filesystem from ext3 to something
  117. # else, you can do that without providing a full recipe.
  118. # d-i partman/default_filesystem string ext4
  119.  
  120. # root account and password
  121. d-i passwd/root-login boolean true
  122. d-i passwd/root-password-crypted password $$78888O7t$XAdzFmSUXy7Ysqayh7IU/
  123.  
  124. # skip creation of a normal user account.
  125. d-i passwd/make-user boolean false
  126.  
  127. # You can choose to install restricted and universe software, or to install
  128. # software from the backports repository.
  129. # d-i apt-setup/restricted boolean true
  130. # d-i apt-setup/universe boolean true
  131. # d-i apt-setup/backports boolean true
  132.  
  133. # Uncomment this if you don't want to use a network mirror.
  134. # d-i apt-setup/use_mirror boolean false
  135.  
  136. # Select which update services to use; define the mirrors to be used.
  137. # Values shown below are the normal defaults.
  138. # d-i apt-setup/services-select multiselect security
  139. # d-i apt-setup/security_host string security.ubuntu.com
  140. # d-i apt-setup/security_path string /ubuntu
  141.  
  142. $SNIPPET('preseed_apt_repo_config')
  143.  
  144. # Enable deb-src lines
  145. # d-i apt-setup/local0/source boolean true
  146.  
  147. # URL to the public key of the local repository; you must provide a key or
  148. # apt will complain about the unauthenticated repository and so the
  149. # sources.list line will be left commented out
  150. # d-i apt-setup/local0/key string http://local.server/key
  151.  
  152. # By default the installer requires that repositories be authenticated
  153. # using a known gpg key. This setting can be used to disable that
  154. # authentication. Warning: Insecure, not recommended.
  155. # d-i debian-installer/allow_unauthenticated boolean true
  156.  
  157. # Individual additional packages to install
  158. # wget is REQUIRED otherwise quite a few things won't work
  159. # later in the build (like late-command scripts)
  160. d-i pkgsel/include string ntp ssh wget
  161.  
  162. # Use the following option to add additional boot parameters for the
  163. # installed system (if supported by the bootloader installer).
  164. # Note: options passed to the installer will be added automatically.
  165. d-i debian-installer/add-kernel-opts string $kernel_options_post
  166.  
  167. # Avoid that last message about the install being complete.
  168. d-i finish-install/reboot_in_progress note
  169.  
  170. ## Figure out if we're kickstarting a system or a profile
  171. #if $getVar('system_name','') != ''
  172. #set $what = "system"
  173. #else
  174. #set $what = "profile"
  175. #end if
  176.  
  177. # This first command is run as early as possible, just after preseeding is read.
  178. # d-i preseed/early_command string [command]
  179. d-i preseed/early_command string wget -O- \
  180. http://$http_server/cblr/svc/op/script/$what/$name/?script=preseed_early_default | \
  181. /bin/sh -s
  182.  
  183. # This command is run immediately before the partitioner starts. It may be
  184. # useful to apply dynamic partitioner preseeding that depends on the state
  185. # of the disks (which may not be visible when preseed/early_command runs).
  186. # d-i partman/early_command \
  187. # string debconf-set partman-auto/disk "\$(list-devices disk | head -n1)"
  188.  
  189. # This command is run just before the install finishes, but when there is
  190. # still a usable /target directory. You can chroot to /target and use it
  191. # directly, or use the apt-install and in-target commands to easily install
  192. # packages and run commands in the target system.
  193. # d-i preseed/late_command string [command]
  194. d-i preseed/late_command string wget -O- \
  195. http://$http_server/cblr/svc/op/script/$what/$name/?script=preseed_late_default | \
  196. chroot /target /bin/sh -s

ubuntu有多网卡时需要设置profile

  1. [root@cobbler kickstarts]#cobbler profile edit --name=ubuntu-14.04.5-x86_64 --kopts="auto=true netcfg/choose_interface=auto"
  2.  
  3. ubuntu.seed模板
  1. #url:主要参考
  2. # : https://wiki.ubuntu.com/Enterprise/WorkstationAutoinstallPreseed
  3. # :https://wiki.ubuntu.com/Enterprise/WorkstationAutoinstallScripts
  4. # :https://help.ubuntu.com/12.04/installation-guide/example-preseed.txt
  5. # :https://wiki.ubuntu.com/QATeam/AutomatedTesting/
  6. # :https://www.debian.org/releases/wheezy/example-preseed.txt
  7. # :https://help.ubuntu.com/14.04/installation-guide/i386/apb.html
  8. # :http://www.startos.com/zhuanti/zt02/2010/1111/9391.html
  9. # :https://help.ubuntu.com/lts/installation-guide/i386/ch04s06.html#preseed(然后它)
  10. # :https://www.debian.org/releases/stable/i386/ch06s03.html.zh-cn(第一重要,有助于理解整个流程)
  11. preseed主要包括以下内容
  12. 、本地化
  13. 、网络设置
  14. 、镜像设置
  15. 、账号设置
  16. 、时钟与时区设置
  17. 、分区
  18. 、基本系统安装
  19. 、设置apt
  20. 、选择软件包
  21. 、安装bootloader
  22. 、完成安装
  23. 、预置其他的软件包
  24. #书写perseed时需要注意的点
  25. #preconfiguration 文件格式如下
  26. #<owner> <question name> <question type> <value>
  27. #确保type与value之间只有一个空格符或者tab
  28. #多行的话最好是在question name后添加\,而不应该在type与value之间
  29. #对于debconf 变量,owner前需要加d-i
  30. #其二,可以通过debconf-utils软件包里面的debconf-get-selections导出debconf数据库和安装程序的cdebconf数据库到另一文件
  31. #debconf-get-selections --installer > file
  32. #debconf-get-selections >> file
  33. #本地化 设置 language country and locale
  34. #如果预置locale为en_NL在安装后系统默认的locale将是en_US.UTF-,如果想要使用en_GB.UTF-,该值需要分别进行预置
  35. #d-i debian-installer/language srtring en
  36. #d-i debian-installer/country string CH
  37. d-i debain-install/locale string zh_CN.UTF-
  38. #键盘配置,安装时只提供基本keymap,高级的需要在安装好的系统下才能使用,使用dpkg-reconfigure keyboard-configuration配置
  39. d-i keyboard-configuration/xkb-keymap select us
  40. #d-i keyboard-configuration/toggle select No toggling
  41. #网络设置
  42. #如果需要禁用网络,则如下
  43. #d-i netcfg/enable boolean false
  44. #若网络可用,则netcfg将选择一网口,如果需要跳过显示选择网卡列表,则设置自动选择
  45. #d-i netcfg/choose_interface select auto
  46. #如果想直接指定某一网口,则设置如下
  47. #d-i netcfg/choose_interface select eth0
  48. #设置链接网口的检测时间,默认时间时3秒
  49. #d-i netcfg/link_wait_timeout string
  50. #如果DHCP服务器延迟较高,可以将安装过程中DHCP设置时延变长
  51. #d-i netcfg/dhcp_timeout string
  52. #如果需要手动配置网络,则如下配置
  53. #d-i netcfg/disable_autoconfig boolean true
  54. #d-i netcfg/dhcp_failed note
  55. #d-i netcfg/dhcp_options select Configure network manually
  56. #d-i netcfg/get_nameservers string 192.168.1.1
  57. #d-i netcfg/get_ipaddress string 192.168.1.42
  58. #d-i netcfg/get_netmask string 255.255.255.0
  59. #d-i netcfg/get_gateway string 192.168.1.1
  60. #d-i netcfg/confirm_static boolean true
  61. #设置hostname以及domain避免问答
  62. #d-i netcfg/get_hostname string unassigned-hostname
  63. #d-i netcfg/get_domain string unassigned-domain
  64. #手动预置hostname
  65. #d-i netcfg/hostname string abc
  66. #non-free需要网络,可以配置其直接连接网络而无需询问
  67. #d-i hw-detect/load_firmware boolean true
  68. #需要注意的是,如果netcfg/get_netmask没有预置,netcfg将自动侦测掩码,这种情况下,为了自动安装,变量需要标记为seen,
  69. #同样,如果netcfg/get_gateway没有设置,netcfg将自动选择一个合适的地址。特殊情况下,可以设置netcfg/get_gateway
  70. #为none确定不使用网关
  71. #网络控制台
  72. #如果需要通过SSH进行远程安装,就需要确保网络console
  73. #d-i anna/choose_modules string network-console
  74. #d-i network-console/authorized_keys_url string http://10.133.5.100/ubuntu/openssh-key
  75. #d-i network-console/password password r00tme
  76. #d-i network-console/password-again password r00tme
  77. #镜像设置
  78. #镜像可用于下载安装程序的额外组件、安装基本系统以及所安装的系统建立/etc/apt/source.list
  79. #参数mirror/suite决定了安装号的系统使用的套件。
  80. #参数mirror/udev/suite决定安装程序使用的额外组件的套件。它只在组件通过网络下载病与安装时使用的initrd建立套件相匹配时才有效。
  81. #通常安装程序会自动安装病使用正确的值,而无需手动设置
  82. #如果选择FTP,则mirror/country无需设置
  83. #d-i mirror/protocol string ftp 如果不指出所用协议,则默认为http
  84. d-i mirror/country string manual
  85. d-i mirror/http/hostname string http.us.debian.org
  86. d-i mirror/http/directory string /debian
  87. d-i mirror/http/proxy string
  88. #安装套件
  89. #d-i mirror/suite string testing
  90. #d-i mirror/udev/suite string testing
  91. #账号设置
  92. #root账号的密码和普通用户的用户名和密码都可以预置。可以使用纯文本或者MD5
  93. #如果需要跳过root用户的创建则
  94. #d-i passwd/root-login boolean false
  95. #同样也可以跳过创建普通用户
  96. #d-i passwd/make-user boolean false
  97. #设置root密码,负责为空
  98. #d-i passwd/root-password password 123456st
  99. #d-i passwd/root-password-again password 123456st
  100. #同样可以用加密的MD5哈希
  101. #d-i passwd/root-password-crtpted password [MD5 hash]
  102. #创建普通账户
  103. #d-i passwd/user-fullname string Debian User
  104. #d-i passwd/username string debian
  105. # 普通用户密码
  106. #d-i passwd/user-password password insecure
  107. #d-i passwd/user-password-again password insecure
  108. # 或者用MD5
  109. #d-i passwd/user-password-crypted password [MD5 hash]
  110. # 为第一个用户以指定UID进行创建
  111. #d-i passwd/user-uid string
  112. # 将第一用户加入某一group
  113. #d-i passwd/user-default-groups string audio cdrom video
  114. passwd/root-password-crypted passwd/user-password-crypted 值可以使用 “!” 作为他们的预置值。这种情况下,对应的帐号关闭。
  115. 它常用于 root 帐号,用其他替代方法允许管理或 root 登录(例如使用 SSH key 认证或 sudo).
  116. 下面的命令可用于生成密码的 MD5 值。
  117. mkpasswd -m sha-
  118. #时钟与时区设置
  119. #设置硬件时钟是否为UTC
  120. d-i clock-setup/utc boolean true
  121. #设置为某一时区
  122. # 可以参照/usr/share/zoneinfo里面的值
  123. d-i time/zone string Asia/Shanghai
  124. #设置在安装过程中是否以NTP为时间基准
  125. d-i clock-setup/ntp boolean true
  126. # 使用的NTP服务器
  127. #d-i clock-setup/ntp-server string xxx
  128. #分区设置
  129. 分区可以参考一下以下资料
  130. #http://www.cnblogs.com/silenceli/p/3472222.html
  131. #https://wiki.ubuntu.com/Enterprise/WorkstationAutoinstallPreseed
  132. #使用预置进行硬盘分区受限于 partman-auto 提供的支持。您可以选择使用磁盘上已有的空闲分区或者整个磁盘。磁盘的布局将取决于所使用的预定义方案,用户自定义的方案文件或预置文件包含的方案。
  133. #已经支持包括 RAID、LVM 和加密高级分区设置的预置,但对于非预置安装的分区仍然弹性不足。
  134. #下面的例子仅提供了使用方案的最基本信息。详细的内容清参考文件 partman-auto-recipe.txt 和 partman-auto-raid-recipe.txt,它们含在 debian-installer 软件包里。这两个文件也可以从 debian-installer source repository##获取。注意不同发布版支持的功能会有所改变。
  135. #http://anonscm.debian.org/gitweb/?p=d-i/debian-installer.git;a=tree;f=doc/devel
  136. # If the system has free space you can choose to only partition that space.
  137. # This is only honoured if partman-auto/method (below) is not set.
  138. #d-i partman-auto/init_automatically_partition select biggest_free
  139. # Alternatively, you may specify a disk to partition. If the system has only
  140. # one disk the installer will default to using that, but otherwise the device
  141. # name must be given in traditional, non-devfs format (so e.g. /dev/hda or
  142. # /dev/sda, and not e.g. /dev/discs/disc0/disc).
  143. # For example, to use the first SCSI/SATA hard disk:
  144. #d-i partman-auto/disk string /dev/sda
  145. # In addition, you'll need to specify the method to use.
  146. # The presently available methods are:
  147. # - regular: use the usual partition types for your architecture
  148. # - lvm: use LVM to partition the disk
  149. # - crypto: use LVM within an encrypted partition
  150. d-i partman-auto/method string lvm
  151. # If one of the disks that are going to be automatically partitioned
  152. # contains an old LVM configuration, the user will normally receive a
  153. # warning. This can be preseeded away...
  154. d-i partman-lvm/device_remove_lvm boolean true
  155. # The same applies to pre-existing software RAID array:
  156. d-i partman-md/device_remove_md boolean true
  157. # And the same goes for the confirmation to write the lvm partitions.
  158. d-i partman-lvm/confirm boolean true
  159. d-i partman-lvm/confirm_nooverwrite boolean true
  160. # You can choose one of the three predefined partitioning recipes:
  161. # - atomic: all files in one partition
  162. # - home: separate /home partition
  163. # - multi: separate /home, /usr, /var, and /tmp partitions
  164. d-i partman-auto/choose_recipe select atomic
  165. # Or provide a recipe of your own...
  166. # If you have a way to get a recipe file into the d-i environment, you can
  167. # just point at it.
  168. #d-i partman-auto/expert_recipe_file string /hd-media/recipe
  169. # If not, you can put an entire recipe into the preconfiguration file in one
  170. # (logical) line. This example creates a small /boot partition, suitable
  171. # swap, and uses the rest of the space for the root partition:
  172. #d-i partman-auto/expert_recipe string \
  173. # boot-root :: \
  174. # ext3 \
  175. # $primary{ } $bootable{ } \
  176. # method{ format } format{ } \
  177. # use_filesystem{ } filesystem{ ext3 } \
  178. # mountpoint{ /boot } \
  179. # . \
  180. # ext3 \
  181. # method{ format } format{ } \
  182. # use_filesystem{ } filesystem{ ext3 } \
  183. # mountpoint{ / } \
  184. # . \
  185. # % linux-swap \
  186. # method{ swap } format{ } \
  187. # .
  188. # The full recipe format is documented in the file partman-auto-recipe.txt
  189. # included in the 'debian-installer' package or available from D-I source
  190. # repository. This also documents how to specify settings such as file
  191. # system labels, volume group names and which physical devices to include
  192. # in a volume group.
  193. # This makes partman automatically partition without confirmation, provided
  194. # that you told it what to do using one of the methods above.
  195. d-i partman-partitioning/confirm_write_new_label boolean true
  196. d-i partman/choose_partition select finish
  197. d-i partman/confirm boolean true
  198. d-i partman/confirm_nooverwrite boolean true
  199. #其他分区方式可以查看
  200. #https://www.debian.org/releases/stable/i386/apbs04.html.zh-cn#ftn.idp56652848
  201. #分区挂载控制
  202. #文件系统一般使用 UUID 作为关键字挂载; 这使得在设备名变更的情况下仍然可以正常挂载。UUID
  203. #本身很长不容易阅读,因此,安装程序也可以依照您的意愿使用传统设备名或者指定标签(label)挂载文件系统。假如安装程序使用标签方式,那些没有标签
  204. #的文件系统仍然使用 UUID 方式挂载。
  205. #具有固定名称的设备,比如 LVM 逻辑卷,将继续使用它们自己的名字而不是 UUID 方式挂载。
  206. #传统设备名会根据内核在引导时发现的次序进行调整,这将导致挂载错误的文件系统。与此类似,假如您插入一个新磁盘或 USB 设备,标签也可能有冲突发生。这样系统启动后会出现一些随机的情况。
  207. # The default is to mount by UUID, but you can also choose "traditional" to
  208. # use traditional device names, or "label" to try filesystem labels before
  209. # falling back to UUIDs.
  210. #d-i partman/mount_style select uuid
  211. #基本系统的安装
  212. #本阶段的安装并没有多少东西需要预置。仅有一个与内核安装相关的问题。
  213. #配置apt使得其不安装默认推荐软件包,这将致使系统不完整,非专业人士不推荐
  214. #内核镜像安装,none将致使其不安装
  215. #d-i base-installer/kernel/image string linux-generic
  216. #设置apt
  217. #设置 /etc/apt/sources.list 和其他的基本配置选项,将自动地基于您使用的安装方式以及前面问题的回答。您也可以选择性地安装其他(或本地)的仓库
  218. # 可以选择安装 non-free和 contrib 软件
  219. #d-i apt-setup/non-free boolean true
  220. #d-i apt-setup/contrib boolean true
  221. # 配置是否使用网络镜像
  222. #d-i apt-setup/use_mirror boolean false
  223. # 定义使用镜像
  224. #d-i apt-setup/services-select multiselect security
  225. #d-i apt-setup/security_host string security.ubuntu.com
  226. #d-i apt-setup/security_path string /ubuntu
  227. # 另外的repo local[-] 可用
  228. #d-i apt-setup/local0/repository string \
  229. # http://local.server/debian stable main
  230. #d-i apt-setup/local0/comment string local server
  231. # Enable deb-src lines
  232. #d-i apt-setup/local0/source boolean true
  233. # URL to the public key of the local repository; you must provide a key or
  234. # apt will complain about the unauthenticated repository and so the
  235. # sources.list line will be left commented out
  236. #d-i apt-setup/local0/key string http://local.server/key
  237. # 无需key认证
  238. #d-i debian-installer/allow_unauthenticated boolean true
  239. #选择软件包
  240. #主要看tasksel所包含的软件集
  241. #如果打算安装一些安装任务之外的独立软件包,可以使用参数pksel/includ,该参数的值可以用逗号或者空格分开的软件包列表,便于在内核命令行上使用
  242. #tasksel tasksel/first multiselect standard, web-server, kde-desktop
  243. # 另外一些packages
  244. #d-i pkgsel/include string openssh-server build-essential
  245. # Whether to upgrade packages after debootstrap.
  246. # Allowed values: none, safe-upgrade, full-upgrade
  247. #d-i pkgsel/upgrade select none
  248. # 安装反馈报告
  249. #popularity-contest popularity-contest/participate boolean false
  250. #安装bootloader
  251. # Grub 时默认 boot loader (for x86).如果想使用lilo则
  252. #d-i grub-installer/skip boolean true
  253. # 跳过bootloader安装,则使用下面的
  254. #d-i lilo-installer/skip boolean true
  255. # 下述选项将使得GRUB自动安装到MBR,如果没侦测到OS
  256. d-i grub-installer/only_debian boolean true
  257. d-i grub-installer/with_other_os boolean true
  258. # 如果想装到其他地方,而不是本地MBR
  259. #d-i grub-installer/only_debian boolean false
  260. #d-i grub-installer/with_other_os boolean false
  261. #d-i grub-installer/bootdev string (hd0,)
  262. # To install grub to multiple disks:
  263. #d-i grub-installer/bootdev string (hd0,) (hd1,) (hd2,)
  264. # To install to a particular device:
  265. #d-i grub-installer/bootdev string /dev/sda
  266. # 可选,设置grub密码
  267. #d-i grub-installer/password password r00tme
  268. #d-i grub-installer/password-again password r00tme
  269. #MD5密码
  270. #d-i grub-installer/password-crypted password [MD5 hash]
  271. # Use the following option to add additional boot parameters for the
  272. # installed system (if supported by the bootloader installer).
  273. # Note: options passed to the installer will be added automatically.
  274. #d-i debian-installer/add-kernel-opts string nousb
  275. #完成安装
  276. # 保持console有效
  277. #d-i finish-install/keep-consoles boolean true
  278. # 避免安装最后信息弹出
  279. d-i finish-install/reboot_in_progress note
  280. # 阻止CD弹出
  281. #d-i cdrom-detect/eject boolean false
  282. # 完成后shutdown,但不重启
  283. #d-i debian-installer/exit/halt boolean true
  284. # poweroff
  285. #d-i debian-installer/exit/poweroff boolean true
  286. #预置其他的软件包
  287. # debconf-get-selections --installer
  288. > file
  289. # debconf-get-selections
  290. >
  291. > file
  292. #安装过程中运行用户命令
  293. #预置工具提供了一个非常强大和灵活的选项,可以在安装过程的一些环节运行命令或脚本。
  294. # d-i preseeding is inherently not secure. Nothing in the installer checks
  295. # for attempts at buffer overflows or other exploits of the values of a
  296. # preconfiguration file like this one. Only use preconfiguration files from
  297. # trusted locations! To drive that home, and because it's generally useful,
  298. # here's a way to run any shell command you'd like inside the installer,
  299. # automatically.
  300. # preseed被读取之后,第一个命令将尽可能快的被执行#d-i preseed/early_command string anna-install some-udeb
  301. # 开始分区开始前命令执行. It may be
  302. # useful to apply dynamic partitioner preseeding that depends on the state
  303. # of the disks (which may not be visible when preseed/early_command runs).
  304. #d-i partman/early_command \
  305. # string debconf-set partman-auto/disk "$(list-devices disk | head -n1)"
  306. # 完成安装前命令执行 but when there is
  307. # still a usable /target directory. You can chroot to /target and use it
  308. # directly, or use the apt-install and in-target commands to easily install
  309. # packages and run commands in the target system.
  310. #d-i preseed/late_command string apt-install zsh; in-target chsh -s /bin/zsh
  311. d-i preseed/late_command string \
  312. in-target wget -O /root/desktop-bootstrap.sh "http://example.com/ubuntu-desktop-bootstrap.sh"; \
  313. in-target chmod +x /root/desktop-bootstrap.sh; \
  314. in-target /root/desktop-bootstrap.sh; \
  315. cp /var/log/syslog /target/root/log/install-syslog;
  316. # No boot splash screen.
  317. #d-i debian-installer/splash boolean false
  318. #预置文件链
  319. #可以在一个预置文件里面包含另外的预置文件。这些文件里面的任何设置将覆盖前面加载的设置。有一种用法,例如,通用的网络设置放在一个文件,其他规格的设置放在另外的文件里面。
  320. #d-i preseed/include string x.cfg
  321. # The installer can optionally verify checksums of preconfiguration files
  322. # before using them. Currently only md5sums are supported, list the md5sums
  323. # in the same order as the list of files to include.
  324. #d-i preseed/include/checksum string 5da499872becccfeda2c4872f9171c3d
  325. # More flexibly, this runs a shell command and if it outputs the names of
  326. # preconfiguration files, includes those files.
  327. #d-i preseed/include_command \
  328. # string if [ "`hostname`" = bob ]; then echo bob.cfg; fi
  329. # Most flexibly of all, this downloads a program and runs it. The program
  330. # can use commands such as debconf-set to manipulate the debconf database.
  331. # More than one script can be listed, separated by spaces.
  332. # Note that if the filenames are relative, they are taken from the same
  333. # directory as the preconfiguration file that runs them.
  334. #d-i preseed/run string foo.sh
  1.  

测试ks文件下载

  1. http://172.16.68.61/cblr/svc/op/ks/system/vm01

命令

yum更新

cobbler reposync

检查配置文件

cobbler check

详细信息

cobbler report

描述信息

cobbler distro list

系统信息

cobbler system list

测试开ks文件下载

cobbler profile getks --name=CentOS_6.5-x86_64

cobbler部署的更多相关文章

  1. cobbler部署centos6与centos7系列

    cobbler部署centos6与centos7系列 转载自:http://www.jianshu.com/p/a4bed77bf40d 版权声明:完全抄自 http://www.jianshu.co ...

  2. Cobbler部署之FAQ处理

    Cobbler报错处理 通过cobbler check检查出现的报错 红色标注为报错关键信息 9.1 报错一 # cobbler check httpd does not appear to be r ...

  3. cobbler部署机器的默认密码

    修改cobbler的默认密码: 用 openssl 生成一串密码后加入到 cobbler 的配置文件(/etc/cobbler/settings)里,替换 default_password_crypt ...

  4. cobbler部署安装CentOS6.8

    Linux运维:cobbler : 矮哥linux运维群:93324526 学习cobbler的话,必须先搞懂kickstart,原理不是,不懂如何排错. kickstart部署请点击这里 1. Co ...

  5. Cobbler 部署

    环境介绍 Cobbler 操作系统: Centos-7.2-x86_64 Cobbler服务器地址: 10.90.0.10 部署 Cobbler 安装 Centos epel 原 [root@node ...

  6. cobbler部署以及使用

    常用软件安装及使用目录 资源链接:https://pan.baidu.com/s/1yfVnuSgY5vOTh-B74tpVyw   网盘分享的文件在此 cobbler第一次操作history. ec ...

  7. cobbler部署安装

    挂载光驱 # mount /dev/cdrom /mnt/ 安装cobbler所需软件 # yum install cobbler cobbler-web dhcp tftp-server pykic ...

  8. cobbler部署错误总结

    web 报错500 Internal Server Error解决方案 在安装使用Cobbler web界面的时候提示HTTP 500错误,也就是服务器内部错误,检查防火墙和selinux都是为关闭状 ...

  9. cobbler安装、部署、测试

    cobbler功能介绍 官网:http://cobbler.github.io 安装 yum install -y httpd tftp dhcp cobbler cobbler-web pykick ...

随机推荐

  1. PHP ‘asn1_time_to_time_t’函数内存损坏漏洞

    漏洞名称: PHP ‘asn1_time_to_time_t’函数内存损坏漏洞 CNNVD编号: CNNVD-201312-348 发布时间: 2013-12-18 更新时间: 2013-12-18 ...

  2. UpdatePanel 无刷新弹出窗口

    UpdatePanel下解决提示框不弹出的方法 用户体验上既想页面不刷新,也希望同时能够看到操作的效果(弹出提示框)! ①不刷新,我们可以使用UpdatePanel ②弹出消息框,这个有很多的方式:我 ...

  3. 【转】Java 类的生命周期详解

    一. 引 言 最近有位细心的朋友在阅读笔者的文章时,对java类的生命周期问题有一些疑惑,笔者打开百度搜了一下相关的问题,看到网上的资料很少有把这个问题讲明白的,主要是因为目前国内java方面的教材大 ...

  4. 原生APP与移动Web App的比较

    中国手机网民已超4.5亿,智能机用户超过3.8亿,中国移动互联网市场产值已超过712.5亿元,手机营销是未来必然趋势,而App恰恰是这个趋势下的一个强有力的营销工具: App已有两个主要的方向:原生A ...

  5. Android PagerAdapter

    本基类是ViewPager提供填充页面内容的适配器(数据与显示内容之间桥梁).通常,人们不是直接使用本基类的,而是使用这个基类的实现:FragmentPagerAdapter   或者Fragment ...

  6. 使用 Visual Studio 分析器找出应用程序瓶颈(转)

    使用 Visual Studio 分析器找出应用程序瓶颈 Hari Pulapaka and Boris Vidolov 本文讨论: 以性能瓶颈为目标 应用程序代码分析 比较分析数据 性能报告 本文使 ...

  7. HDU 4622 Reincarnation(SAM)

    Problem Description Now you are back,and have a task to do:Given you a string s consist of lower-cas ...

  8. Log Parser 微软强大的日志分析工具

    Log Parser(微软网站下载)是微软公司出品的日志分析工具,它功能强大,使用简单,可以分析基于文本的日志文件.XML 文件.CSV(逗号分隔符)文件,以及操作系统的事件日志.注册表.文件系统.A ...

  9. 【荐】Redis学习资料汇总

    Redis学习手册(目录) - Stephen_Liu - 博客园 Redis 命令参考 — Redis 命令参考 Redis_php 学习 - 简单--生活 - 博客园

  10. What does enumerable mean?

    I was directed to MDN's for..in page when it said, "for..in Iterates over the enumerable proper ...