码迷,mamicode.com
首页 > 其他好文 > 详细

部署centos6

时间:2018-05-08 21:05:57      阅读:103      评论:0      收藏:0      [点我收藏+]

标签:work   ber   network   def   文件   查看   reboot   lis   size   

  • 挂载镜像和导入镜像

    mount /dev/cdrom /media
    ll /media/
    cobbler import --path=/media --name=centos6.5--arch=x86_64
    cobbler distro list 
    说明:cobber把镜像导入到该目录下:/var/www/cobbler/ks_mirror/
  • 配置centos6的ks文件

    cd /var/lib/cobbler/kickstarts
    vim centos6.ks

    centos6.ks文件内容如下

    install
    text
    keyboard us
    lang en_US
    timezone Asia/ShangHai
    rootpw --iscrypted $default_password_crypted
    auth --useshadow --enablemd5firewall --disabled
    selinux --disabled
    url --url=$tree
    zerombr
    bootloader --location=mbr
    clearpart --all --initlabel
    part /boot --fstype=ext4 --size=500
    part swap --size=1024
    part / --fstype=ext4 --grow --size=200
    $yum_repo_stanza
    $SNIPPET(‘network_config‘)
    skipx
    firstboot --disable
    reboot
    %pre
    $SNIPPET(‘log_ks_pre‘)
    $SNIPPET(‘kickstart_start‘)
    $SNIPPET(‘pre_install_network_config‘)
    # Enable installation monitoring
    $SNIPPET(‘pre_anamon‘)
    %end
    %packages
    $SNIPPET(‘func_install_if_enabled‘)
    @core
    @base
    wget
    lftp
    %end
    %post --nochroot
    $SNIPPET(‘log_ks_post_nochroot‘)
    %end
    %post
    $SNIPPET(‘log_ks_post‘)
    # Start yum configuration
    $yum_config_stanza
    # End yum configuration
    $SNIPPET(‘post_install_kernel_options‘)$SNIPPET(‘post_install_network_config‘)
    $SNIPPET(‘func_register_if_enabled‘)
    $SNIPPET(‘download_config_files‘)
    $SNIPPET(‘koan_environment‘)
    $SNIPPET(‘redhat_register‘)
    $SNIPPET(‘cobbler_register‘)
    # Enable post-install boot notification
    $SNIPPET(‘post_anamon‘)
    # Start final steps
    $SNIPPET(‘kickstart_done‘)
    # End final steps
    sed -ri "/^#UseDNS/c\UseDNS no" /etc/ssh/sshd_config
    sed -ri "/^GSSAPIAuthentication/c\GSSAPIAuthentication no" /etc/ssh/sshd_config
    %end
  • 镜像和ks文件关联

    cobbler profile list                    //查看导入的镜像名称,profile包含ks文件和镜像
    cobbler profile edit --name=centos6.5-x86_64 --kickstart=/var/lib/cobbler/kickstarts/centos6.ks 
    cobbler profile report
  • 检测ks文件语法

    cobbler validateks

部署centos6

标签:work   ber   network   def   文件   查看   reboot   lis   size   

原文地址:https://www.cnblogs.com/lovelinux199075/p/9010619.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!