设为首页 收藏本站
查看: 521|回复: 0

[经验分享] Cobbler+preseed自动化安装Ubuntu系统

[复制链接]

尚未签到

发表于 2018-4-29 09:53:45 | 显示全部楼层 |阅读模式
  Cobbler+preseed自动化安装Ubuntu 14.04系统:
  建议在Ubuntu 14.04系统上搭建,Ubuntu 16.04上会有apache2的python和mod_wsgi模块版本冲突
  安装apache2、tftpd-hpa、kickstart略
  apt-get install cobbler
  netstat -ntplu (查看服务端口,包括tcp和udp)
  curl -I http://127.0.0.1/cobbler (验证网页是否能打开)
  cobbler check
  apt-get install debmirror
  cp -rv /usr/share/doc/debmirror/examples/debmirror.conf /etc/
  vi /etc/debmirror.conf (注释掉下面2行)
  #@dists="precise";
  #@arches="i386";
:wq
  service cobbler restart
  cobbler sync
  echo "xxxx" | openssl passwd -1 -stdin (此次xxxx为客户端的root初始密码)
  vi /etc/cobbler/settings (将上补生成的乱码贴进去)
  default_password_crypted: "$1$cobbler$nBCRhq3fBRuMs35Rp4EUX/"
:wq
  cobbler sync
  导入iso镜像
  mount -t iso9660 -r -o ro,loop ubuntu-14.04.3-server-amd64.iso /root/iso/
  cobbler import --name=UBT14043 --arch=x86_64 --path=/root/iso
  cobbler list
  cobbler distro list
  cobbler profile list
  cobbler profile report --name=UBT14043-x86_64 #查看profile设置
  cobbler distro report --name=UBT14043-x86_64 #查看安装镜像文件信息
  cobbler profile remove --name=UBT14043-x86_64 #移除profile
  cobbler profile add --name=UBT14043-x86_64 --distro=UBT14043-x86_64 --kickstart=/var/lib/cobbler/kickstarts/ubt14043.seed #添加
  cobbler profile edit --name=UBT14043-x86_64 --distro=UBT14043-x86_64 --kickstart=/var/lib/cobbler/kickstarts/ubt14043.seed #编辑
  cobbler profile add --name=UBT14043-x86_64 --kickstart="/var/lib/cobbler/kickstarts/ubt14043.seed"
  cobbler profile report
  service cobbler restart
  cobbler sync
cat /var/lib/tftpboot/pxelinux.cfg/default内容:
  DEFAULT menu
PROMPT 0
MENU TITLE Cobbler | http://www.cobblerd.org/
TIMEOUT 0
#TOTALTIMEOUT 6000
#ONTIMEOUT local
  LABEL local
MENU LABEL (local)
MENU DEFAULT
LOCALBOOT -1
  LABEL UBT14043-x86_64
kernel /images/UBT14043-x86_64/linux
MENU LABEL UBT14043-x86_64
append initrd=/images/UBT14043-x86_64/initrd.gz ksdevice=bootif lang=  locale=en_US priority=critical text  auto-install/enable=true priority=critical url=http://10.0.0.2/cblr/svc/op/ks/profile/UBT14043-x86_64 hostname=aa domain=ming.com suite=trusty netcfg/choose_interface=em1 netcfg/dhcp_timeout=120
ipappend 2
  MENU end
  注:
1、指定网卡需写到default文件里,写到seed文件里不认
2、如果用的是AD的DHCP,一定要在default文件里写上dhcp_timeout时间,不然DHCP失败概率会很高
cat ubt14043.seed内容:
  d-i live-installer/net-image string http://10.0.0.2/cobbler/links/UBT14043-x86_64/install/filesystem.squashfs
d-i     debian-installer/locale string en_US.UTF-8
d-i     debian-installer/splash boolean false
d-i     console-setup/ask_detect        boolean false
d-i     console-setup/layoutcode        string us
d-i     console-setup/variantcode       string
d-i netcfg/choose_interface select auto
d-i     clock-setup/utc boolean true
d-i     partman-auto/method string regular
d-i partman-auto/disk string /dev/sda
d-i partman-auto/expert_recipe select \
boot-root ::                      \
100000 80 100000 ext4  \
$bootable{ } \
$primary{ }  \
method{ format } format{ } \
use_filesystem{ }  filesystem{ ext4 } \
mountpoint{ / }   \
.              \
102 60 1000 linux-swap  \
$primary{ }  \
method{ swap } format{ } \
.              
d-i  partman-auto/choose_recipe boot-root
  d-i     partman/confirm_write_new_label boolean true
d-i     partman/choose_partition        select Finish partitioning and write changes to disk
d-i     partman/confirm boolean true
d-i     partman/confirm_nooverwrite boolean true
d-i     partman/default_filesystem string ext4
d-i     clock-setup/utc boolean true
d-i     clock-setup/ntp boolean true
d-i     clock-setup/ntp-server  string 10.0.0.3
d-i     base-installer/kernel/image     string linux-server
d-i     passwd/root-login       boolean false
d-i     passwd/make-user        boolean true
d-i     passwd/user-fullname    string super
d-i     passwd/username string super
d-i     passwd/user-password    password xxxxxx
d-i     passwd/user-password-again    password xxxxx
d-i     user-setup/allow-password-weak  boolean true
d-i     user-setup/encrypt-home boolean false
d-i     passwd/user-default-groups      string sudo
d-i mirror/country string manual
d-i mirror/protocol string http
d-i mirror/http/hostname string 10.0.0.2
d-i mirror/http/directory string /cobbler/ks_mirror/UBT14043-x86_64
d-i     apt-setup/services-select       multiselect security
d-i     apt-setup/security_host string 10.0.0.2
d-i     apt-setup/security_path string /cobbler/ks_mirror/UBT14043-x86_64
d-i     debian-installer/allow_unauthenticated  string false
d-i     pkgsel/upgrade  select none
d-i     pkgsel/language-packs   multiselect
d-i     pkgsel/update-policy    select none
d-i     pkgsel/updatedb boolean true
d-i     grub-installer/skip     boolean false
d-i     lilo-installer/skip     boolean false
d-i     grub-installer/only_debian      boolean true
d-i     grub-installer/with_other_os    boolean true
d-i     finish-install/keep-consoles    boolean false
d-i     finish-install/reboot_in_progress       note
d-i     cdrom-detect/eject      boolean true
d-i     debian-installer/exit/halt      boolean false
d-i     debian-installer/exit/poweroff  boolean false
d-i     pkgsel/include string openssh-server

运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-453429-1-1.html 上篇帖子: Ubuntu 16.04 LTS 常用工具软件整理(陆续更新) 下篇帖子: Ubuntu 14.04 preseed配置示例
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表