#install cobbler-server soft

#date 2013.08.07

#disabled iptables and selinux

/etc/init.d/iptables stop

setenforce 0

IP=`ifconfig eth0 |awk -F '[ :]+' 'NR==2 {print $4}'`

#yum epel

system_version=`cat /etc/issue|grep CentOS|awk -F '[ .]+' '{print $3}'`

if [ ${system_version} == 5 ]; then

rpm -ivh http://dl.fedoraproject.org/pub/epel/5/x86_64/epel-release-5-4.noarch.rpm

else

rpm -ivh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm

fi

yum -y install cobbler httpd rsync tftp-server xinetd dhcp python-ctypes debmirror pykickstart

#modify the file /etc/cobbler/settings,1.78 is cobbler-server's ip

sed -i 's/server: 127.0.0.1/server: '${IP}'/g' /etc/cobbler/settings

#modify the /etc/xinetd.d/tftp and /etc/xinetd.d/rsync

sed -i '/disable/c\\tdisable\t\t\t= no' /etc/xinetd.d/tftp

sed -i 's/\=\ yes/\=\ no/g' /etc/xinetd.d/rsync

#或者此处也可以这样写

#sed -i '/disable/s/yes/no/' /etc/xinetd.d/tftp

#sed -i '/disable/s/no/yes' /etc/xinetd.d/rsync

/etc/init.d/xinetd restart

#web_log_in and set web_log_in_user and password

sed -i 's/authn_denyall/authn_configfile/g' /etc/cobbler/modules.conf

#htdigest /etc/cobbler/users.digest "Cobbler" cobbler

#Avoiding repeated installations by close pxe

sed -i 's/pxe_just_once: 0/pxe_just_once: 1/g' /etc/cobbler/settings

#cobbler manage dhcp

sed -i 's/manage_dhcp: 0/manage_dhcp: 1/g' /etc/cobbler/settings

#set

sed -i 's/^#Load/Load/' /etc/httpd/conf.d/wsgi.conf

#start httpd,not nginx

sed -i 's/#ServerName www.example.com:80/ServerName '${IP}':80/g' /etc/httpd/conf/httpd.conf

/etc/init.d/httpd restart

#get the os's bootloader

cobbler get-loaders

#dedmirrors

yum -y install ed patch perl perl-Compress-Zlib perl-Cwd perl-Digest-MD5 \

perl-Digest-SHA1 perl-LockFile-Simple perl-libwww-perl

rpm -ivh ftp://fr2.rpmfind.net/linux/epel/5/ppc/debmirror-20090807-1.el5.noarch.rpm

sed -i 's/@dists/#&/g' /etc/debmirror.conf

sed -i 's/@arches/#&/g' /etc/debmirror.conf

#set the root's password

a=`openssl passwd -1 -salt 'random-phrase-here' '123456'`

echo $a

#sed -i 's/default_password_crypted:"/&'$a'"/g' /etc/cobbler/settings

sed -i '/default_password_crypted/s/^/&#/g' /etc/cobbler/settings

cat >> /etc/cobbler/settings << EOF

default_password_crypted: "$a"

EOF

#set dhcp

sed -i 's/192.168.1.[0-9]\;/192.168.1.1\;/g' /etc/cobbler/dhcp.template

#start services

/etc/init.d/cobblerd restart

/etc/init.d/xinetd restart

cobbler sync

#mount iso

wget http://192.168.1.78/test/CentOS-6.4-x86_64-bin-DVD1.iso

mount -t auto -o loop CentOS-6.4-x86_64-bin-DVD1.iso /mnt

cobbler import --path=/mnt --name=centos6.4

cobbler sync

自动化Cobbler安装的更多相关文章

  1. Cobbler自动化批量安装Linux操作系统 - 运维总结

    一.Cobbler简述 Cobbler是一个自动化和简化系统安装的工具,通过使用网络引导来控制和启动安装.Cobbler的特性包括存储库镜像.Kickstart模板和连接电源管理系统.Cobbler通 ...

  2. 自动化运维之cobbler安装centos7.3

    自动化运维之cobbler安装centos7.3 一.cobbler简介和服务 Cobbler是一款自动化操作系统安装的实现,与PXE安装系统的区别就是可以同时部署多个版本的系统,而PXE只能选择一种 ...

  3. 自动化运维之Cobbler自动化部署安装操作系统

    Cobbler概述: Cobbler可以用来快速建立 Linux 网络安装环境,它已将 Linux 网络安装的技术门槛,从大专以上文化水平,成功降低到初中以下,连补鞋匠都能学会. 在生产环境中,经常批 ...

  4. Cobbler自动化批量安装linux服务器的操作记录

    Cobbler为何物?Cobbler是一个快速网络安装linux的服务,而且在经过调整也可以支持网络安装windows.该工具使用python开发,小巧轻便(才15k行python代码),使用简单的命 ...

  5. Centos7 下cobbler安装及配置

    1.背景介绍 作为运维,在公司经常遇到一些机械性重复工作要做,例如:为新机器装系统,一台两台机器装系统,可以用光盘.U盘等介质安装,1小时也完成了,但是如果有成百台的服务器还要用光盘.U盘去安装,就显 ...

  6. Centos7.4 下cobbler安装及配置

    1.背景介绍 作为运维,在公司经常遇到一些机械性重复工作要做,例如:为新机器装系统,一台两台机器装系统,可以用光盘.U盘等介质安装,1小时也完成了,但是如果有成百台的服务器还要用光盘.U盘去安装,就显 ...

  7. 比Ansible更吊的自动化运维工具,自动化统一安装部署_自动化部署udeploy 1.0

    新增功能: 2015-03-11 除pass(备份与更新)与start(启动服务)外,实现一切自动化. 注:pass与start设为业务类,由于各类业务不同,所以无法实现自动化.同类业务除外,如更新的 ...

  8. 比Ansible更吊的自动化运维工具,自动化统一安装部署自动化部署udeploy 1.0 版本发布

    新增功能: 逻辑与业务分离,完美实现逻辑与业务分离,业务实现统一shell脚本开发,由框架统一调用. 并发多线程部署,不管多少台服务器,多少个服务,同时发起线程进行更新.部署.启动. 提高list规则 ...

  9. pxe+kickstart自动化批量安装系统详解-技术流ken

    前言 pxe+kickstart是一款可以实现自动化批量安装系统的服务,比较经典,下面将详细介绍此服务的安装和使用. 系统环境准备 系统版本:CentOS release 6.7 (Final) 内网 ...

随机推荐

  1. SDWebImage 在多线程下载图片时防止错乱的策略

    在我们使用sd的时候,对tableView  上cell得图片进行异步下载的时候会遇到这样一个问题: 由于cell的重用机制,在我们加载出一个cell的时候imageView数据源开启一个下载任务并返 ...

  2. [转]Mysql导入导出工具Mysqldump和Source命令用法详解

    Mysql本身提供了命令行导出工具Mysqldump和Mysql Source导入命令进行SQL数据导入导出工作,通过Mysql命令行导出工具Mysqldump命令能够将Mysql数据导出为文本格式( ...

  3. 【CF39E】【博弈论】What Has Dirichlet Got to Do with That?

    Description You all know the Dirichlet principle, the point of which is that if n boxes have no less ...

  4. 【清澄A1333】【整体二分+二维树状数组】矩阵乘法(梁盾)

    试题来源 2012中国国家集训队命题答辩 问题描述 给你一个N*N的矩阵,不用算矩阵乘法,但是每次询问一个子矩形的第K小数. 输入格式 第一行两个数N,Q,表示矩阵大小和询问组数: 接下来N行N列一共 ...

  5. iOS 获取项目名称及版本号

    可用于版本让用户手动检测是否有版本更新可用. NSDictionary *infoDictionary = [[NSBundle mainBundle] infoDictionary];  CFSho ...

  6. SQL中distinct的用法和left join查询的含义

    SQL中distinct的用法   1.作用于单列 2.作用于多列 3.COUNT统计 4.distinct必须放在开头 5.其他 在表中,可能会包含重复值.这并不成问题,不过,有时您也许希望仅仅列出 ...

  7. 基于Qt QGraphicsView的多点触摸绘图

    本应用于基于QGraphicsView框架,实现多点触摸. 工程仅仅演示了多点触摸绘图,源自我前段时间一款基于Qt的绘图软件. 工程结构: kmp.h 定义了枚举 slide.h/cpp 定义了派生于 ...

  8. TatukGIS-TGIS_Editor.CreateShape

    procedure CreateShape(const _layer: TObject; const _ptg: TGIS_Point3D; const _type: TGIS_ShapeType; ...

  9. iscc2016-basic-明察秋毫

    查看源代码,找到maybe not flag : Jr1p0zr2VfPp 移位密码,注意判断字母大小写,并且数字无变化 s = "Jr1p0zr2VfPp" p = list(s ...

  10. 使用模版引擎填充重复dom元素

    引入arttemplate,定义newajax发送跨域请求获得数据,将获得的数据用定义的格式渲染 <!DOCTYPE html><html lang="en"&g ...