龙空技术网

centos7-cobbler批量部署linux系统

躺平老青年 948

前言:

此时小伙伴们对“centoskickstart”都比较注重,兄弟们都想要了解一些“centoskickstart”的相关资讯。那么小编同时在网摘上搜集了一些关于“centoskickstart””的相关资讯,希望同学们能喜欢,我们快快来学习一下吧!

一.cobbler部署

[root@cobbler ~]# systemctl stop firewalld

[root@cobbler ~]# systemctl disable firewalld

[root@cobbler ~]# setenforce 0

setenforce: SELinux is disabled

[root@cobbler ~]# sed -ri '/^SELINUX/c\SELINUX=disabled' /etc/selinux/config

二、cobbler安装

[root@cobbler ~]# yum -y install epel-release

[root@tianyun ~]# yum -y install cobbler cobbler-web tftp-server dhcp httpd xinetd

[root@tianyun ~]# systemctl start httpd cobblerd

[root@tianyun ~]# systemctl enable httpd cobblerd

三、配置cobbler

[root@tianyun ~]# cobbler check

[root@cobbler ~]# sed -ri '/allow_dynamic_settings:/c\allow_dynamic_settings: 1' /etc/cobbler/settings

[root@cobbler ~]# systemctl restart cobblerd

1. server

[root@cobbler ~]# cobbler setting edit --name=server --value=10.245.13.100 //配置cobbler服务器ip地址

2. next_server

[root@cobbler ~]# cobbler setting edit --name=next_server --value=10.245.13.100 //配置下个节点服务器ip地址

3. tftp-server

[root@cobbler ~]# sed -ri '/disable/c\disable = no' /etc/xinetd.d/tftp

[root@cobbler ~]# systemctl enable xinetd

[root@cobbler ~]# systemctl restart xinetd

4. boot-loaders (e.g. pxelinux.0)

[root@cobbler ~]# cobbler get-loaders

5. rsyncd

[root@cobbler ~]# systemctl start rsyncd

[root@cobbler ~]# systemctl enable rsyncd

6. debmirror [optional]

7. pykickstart

[root@cobbler ~]# yum -y install pykickstart

8. default password

[root@cobbler ~]# openssl passwd -1 -salt `openssl rand -hex 4` 'hk' (系统部署之后的密码)$1$9da8d30f$IzwrMCRrCDsnhp1WOAK5k.

[root@cobbler ~]# cobbler setting edit --name=default_password_crypted --value='$1$9da8d30f$IzwrMCRrCDsnhp1WOAK5k.'

9. fencing tools

[optional][root@cobbler ~]# yum -y install fence-agents

10. manage_dhcp

[root@cobbler ~]# cobbler setting edit --name=manage_dhcp --value=1

[root@cobbler ~]# vim /etc/cobbler/dhcp.template (配置dhcp服务器的地址范围)

11.[root@cobbler ~]# cobbler check (对cobbler服务器进行配置检查)

12.[root@cobbler ~]# cobbler sync (对cobbler服务器进行镜像导入的检测)

四.cobbler web==============================================================================认证

[root@cobbler ~]# useradd hk

[root@cobbler ~]# echo "123456" | passwd --stdin hk

[root@cobbler ~]# vim /etc/cobbler/modules.conf

[authentication]

module = authn_pam

[root@cobbler ~]# vim /etc/cobbler/users.conf

[admins]

admin = "hk"

[root@cobbler ~]# systemctl restart cobblerd

[root@cobbler ~]# cobbler sync

Web

五:镜像的导入

因为是使用虚拟机做的实验,所以直接将centos7的镜像导入cdrom中

1.mount /dev/cdrom /media/

2.cd /media

3.ls

4.cobbler import --path=/media --name=centos7

此时你就可以通过虚拟机新建一台linux,从网络启动,进行linux系统的安装了

1.针对导入的linux镜像一定要完整,如果不完整安装过程会产生错误,如ubuntu系统

2.部署客户机内存需要2G或者2G以上,不然部署会出现错误

标签: #centoskickstart #centoscaffeatlas