#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. 详解SQL Server 2005 Express下的事件探查器

    安装Visual Studio 2008会有附带的SQL Server 2005 Express版 我们开发一般都用那个都不单独安装SQL Server的 大家都知道express版的sql是没有 事 ...

  2. 对xml操作

    已知有一个XML文件(bookshop.xml)如下: <?xml version="1.0" encoding="gb2312" ?> <b ...

  3. windows 20003 扩展安装后不成功的原因

    windows扩展如果安装不成功(PHP扩展)很大的可能就是那个DLL的权限不够.需要分配:AdministratorAuthenticater UsersIIS_WPGSYSTEMUsers

  4. 用java写bp神经网络(四)

    接上篇. 在(一)和(二)中,程序的体系是Net,Propagation,Trainer,Learner,DataProvider.这篇重构这个体系. Net 首先是Net,在上篇重新定义了激活函数和 ...

  5. iOS 小知识 - #if , #ifdef , #ifndef.

    Q : 在项目的 .h 文件中, #ifndef XXX_h #define XXX_h //程序段1 #endif  /* XXX_h */ 的作用? A : 如果 XXX.h 不存在,就引入 XX ...

  6. 关于ios8斯坦福公开课第二课

    在这个课程中,我们遇到了这样的代码 @IBAction func oprate(sender: UIButton) { let opration = sender.currentTitle! if u ...

  7. WPF 自定义滚动条样式

    先看一下效果: 先分析一下滚动条有哪儿几部分组成: 滚动条总共有五部分组成: 两端的箭头按钮,实际类型为RepeatButton Thumb 两端的空白,实际也是RepeatButton 最后就是Th ...

  8. C# winform DataGridView操作 (转)

    C# DataGridView控件动态添加新行 DataGridView控件在实际应用中非常实用,特别需要表格显示数据时.可以静态绑定数据源,这样就自动为DataGridView控件添加相应的行.假如 ...

  9. win7访问windows server 2003服务器出现未知的用户名或者错误的密码(转载)

    直接放答案,感谢网友提供答案,否则自已还一直在纳闷,为什么? win7系统的安全机制限制了登陆.只要系统时间和win2003服务器的系统时间相差很多,系统就会阻止其登陆,并显示错误信息:"未 ...

  10. JQUERY1.9学习笔记 之可见性过滤器(一) 隐藏选择器

    描述:选择所有隐藏的元素. jQuery( ":hidden" ) 例:显示出所有隐藏的div元素,并对隐藏的input元素计数. <!doctype html>< ...