• 部署centos6


    • 挂载镜像和导入镜像
    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/cUseDNS no" /etc/ssh/sshd_config
    sed -ri "/^GSSAPIAuthentication/cGSSAPIAuthentication 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
    
  • 相关阅读:
    openlayers跨域设置后出现http status 500错误
    myeclipse 2014 闪退问题解决
    html跨域获取数据
    centos的nginx支持ssl
    Hadoop学习笔记---HDFS
    Nginx Web服务器配置
    用ReentrantLock和Condition实现线程间通信
    Android绘图机制和处理技巧
    自定义ViewPagerIndicator-视图指示器
    Docker学习笔记
  • 原文地址:https://www.cnblogs.com/lovelinux199075/p/9010619.html
Copyright © 2020-2023  润新知