自动化Cobbler安装
#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安装的更多相关文章
- Cobbler自动化批量安装Linux操作系统 - 运维总结
一.Cobbler简述 Cobbler是一个自动化和简化系统安装的工具,通过使用网络引导来控制和启动安装.Cobbler的特性包括存储库镜像.Kickstart模板和连接电源管理系统.Cobbler通 ...
- 自动化运维之cobbler安装centos7.3
自动化运维之cobbler安装centos7.3 一.cobbler简介和服务 Cobbler是一款自动化操作系统安装的实现,与PXE安装系统的区别就是可以同时部署多个版本的系统,而PXE只能选择一种 ...
- 自动化运维之Cobbler自动化部署安装操作系统
Cobbler概述: Cobbler可以用来快速建立 Linux 网络安装环境,它已将 Linux 网络安装的技术门槛,从大专以上文化水平,成功降低到初中以下,连补鞋匠都能学会. 在生产环境中,经常批 ...
- Cobbler自动化批量安装linux服务器的操作记录
Cobbler为何物?Cobbler是一个快速网络安装linux的服务,而且在经过调整也可以支持网络安装windows.该工具使用python开发,小巧轻便(才15k行python代码),使用简单的命 ...
- Centos7 下cobbler安装及配置
1.背景介绍 作为运维,在公司经常遇到一些机械性重复工作要做,例如:为新机器装系统,一台两台机器装系统,可以用光盘.U盘等介质安装,1小时也完成了,但是如果有成百台的服务器还要用光盘.U盘去安装,就显 ...
- Centos7.4 下cobbler安装及配置
1.背景介绍 作为运维,在公司经常遇到一些机械性重复工作要做,例如:为新机器装系统,一台两台机器装系统,可以用光盘.U盘等介质安装,1小时也完成了,但是如果有成百台的服务器还要用光盘.U盘去安装,就显 ...
- 比Ansible更吊的自动化运维工具,自动化统一安装部署_自动化部署udeploy 1.0
新增功能: 2015-03-11 除pass(备份与更新)与start(启动服务)外,实现一切自动化. 注:pass与start设为业务类,由于各类业务不同,所以无法实现自动化.同类业务除外,如更新的 ...
- 比Ansible更吊的自动化运维工具,自动化统一安装部署自动化部署udeploy 1.0 版本发布
新增功能: 逻辑与业务分离,完美实现逻辑与业务分离,业务实现统一shell脚本开发,由框架统一调用. 并发多线程部署,不管多少台服务器,多少个服务,同时发起线程进行更新.部署.启动. 提高list规则 ...
- pxe+kickstart自动化批量安装系统详解-技术流ken
前言 pxe+kickstart是一款可以实现自动化批量安装系统的服务,比较经典,下面将详细介绍此服务的安装和使用. 系统环境准备 系统版本:CentOS release 6.7 (Final) 内网 ...
随机推荐
- hdoj 2191(多重背包)
悼念512汶川大地震遇难同胞——珍惜现在,感恩生活 Time Limit : 1000/1000ms (Java/Other) Memory Limit : 32768/32768K (Java/ ...
- SGU 142.Keyword
时间限制:0.5s 空间限制:16M 题意 给出一个仅由'a',‘b’组成的字符串S,长度小于500 000,求一个由‘a’,‘b’组成的不是S子串的字符串T. 输出T的长度和T. Sample In ...
- confluence的权限管理
上一篇解讲如何破解,安装confluence5.8.10,这次主要是看权限管理的实现.因为公司对知识的管理不仅是简单的分享,还要求不同权限的人看到不同的内容,所以在一开始就需要对权限这一块有所了解,以 ...
- Java compile时,提示 DeadCode的原因
在工程编译时,编译器发现部分代码是无用代码,则会提示:某一行代码是DeadCode.今天compile工程的时候发现某一个循环出现这个问题,如下: public void mouseOver(fina ...
- java 多线程sleep和wait的区别
对于sleep()方法,我们首先要知道该方法是属于Thread类中的.而wait()方法,则是属于Object类中的. sleep()方法导致了程序暂停执行指定的时间,让出cpu该其他线程,但是他的监 ...
- javascript深入理解js闭包[转]
一.变量的作用域 要理解闭包,首先必须理解Javascript特殊的变量作用域. 变量的作用域无非就是两种:全局变量和局部变量. Javascript语言的特殊之处,就在于函数内部可以直接读取全局变量 ...
- 单个ViewController支持横屏,其他全竖屏方法-b
如果项目中用了navigationViewController, 那么就应该新建一个uinavigationViewController的子类,然后在这个类里面写上下面的代码,在使用的时候就用自定义的 ...
- WSGI规格说明书
PEP 333 这应该是WSGI最权威的文档了 http://www.python.org/dev/peps/pep-3333/ 值翻译了最重要的前面部分,后面读者可以参考 当然文档有些生硬,欢迎 ...
- smtp协议
一.smtp命令 1.HELO 向服务器标识用户身份 2.MAIL 初始化邮件传输mail from: <xxx> 3.RCPT 标识单个的邮件接收人:常在MAIL命令后面可有多个rcpt ...
- Eclipse 代码自动补全
使用Eclipse开发Android时,发现代码补全功能太差,完全不像VS似的,输入一个字母就出现代码提示. 下面是在Eclipse中实现类似VS代码补全的方法: ①打开Eclipse->Win ...