网络运营

Cobbler环境部署

挂载镜像

mount /dev/cdrom /mnt

导入镜像

cobbler import –name=CentOS_7.3_x86_64 –path=/mnt/

查看distro

cobbler distro list

制作Centos7的kickstarts文件

cat <<EOF >centos7-basic.ks

#version=RHEL7

# Install OS instead of upgrade

install

# Keyboard layouts

keyboard ‘us’

# Reboot after installation

reboot

 

# Root password

rootpw –iscrypted $default_password_crypted

 

# System timezone

timezone Asia/Shanghai –isUtc

 

# Network information

network  –bootproto=dhcp –device=eth0 –onboot=yes –ipv6=auto

network  –hostname=localhost.localdomain

 

# Use network installation

url –url=$tree

# System language

lang en_US.UTF-8

 

# Firewall configuration

firewall enabled

 

# System authorization information

auth  –useshadow  –passalgo=sha512

 

# Use graphical install

graphical

firstboot –enable

ignoredisk –only-use=sda

 

# SELinux configuration

setenforce 0

 

# System bootloader configuration

bootloader –location=mbr –boot-drive=sda

 

# Clear the Master Boot Record

zerombr

 

#autopart –type=lvm

# Partition clearing information

clearpart –all –initlabel –drives=sda

 

#Allow partition the system as needed

part /boot –fstype=”xfs” –ondisk=sda –size=500

part pv.10 –fstype=”lvmpv” –ondisk=sda –size=82087

volgroup centos –pesize=4096 pv.10

logvol /var  –fstype=”xfs” –size=40000 –name=var –vgname=centos

logvol /  –fstype=”xfs” –size=20000 –name=root –vgname=centos

logvol swap  –fstype=”swap” –size=2080 –name=swap –vgname=centos

logvol /usr  –fstype=”xfs” –size=20000 –name=usr –vgname=centos

 

%packages

@base

@core

@development

%end

 

%post

echo “nameserver 223.5.5.5” >> /etc/resolv.conf

%end

EOF

添加Cobbler Profile

获取distro

#cobbler distro list

CentOS_7.3-x86_64

添加centos7-basic配置

cobbler profile add \

–name=centos7-basic \

–distro=CentOS_7.3-x86_64 \

–kickstart=/var/lib/cobbler/kickstarts/centos7-basic.ks

获取配置列表

#cobbler profile list

CentOS_7.3-x86_64

centos7-basic

同步

Cobbler sync

验证配置

cobbler profile report –name=centos7-basic

Name                           : centos7-basic

TFTP Boot Files                : {}

Comment                        :

DHCP Tag                       : default

Distribution                   : CentOS_7.3-x86_64

Enable gPXE?                   : 0

Enable PXE Menu?               : 1

Fetchable Files                : {}

Kernel Options                 : {}

Kernel Options (Post Install)  : {}

Kickstart                      :

Kickstart Metadata             : {}

Management Classes             : []

Management Parameters          : <<inherit>>

Name Servers                   : []

Name Servers Search Path       : []

Owners                         : [‘admin’]

Parent Profile                 :

Internal proxy                 :

Red Hat Management Key         : <<inherit>>

Red Hat Management Server      : <<inherit>>

Repos                          : []

Server Override                : <<inherit>>

Template Files                 : {}

Virt Auto Boot                 : 1

Virt Bridge                    : xenbr0

Virt CPUs                      : 1

Virt Disk Driver Type          : raw

Virt File Size(GB)             : 5

Virt Path                      :

Virt RAM (MB)                  : 512

Virt Type                      : xenpv

添加需要部署的设备

cobbler system add \

–name=WEBSERVER \

–profile= centos7-basic \

–interface=eth0 \

–mac=ee:2b:e9:c6:74:60 \

–ip-address=192.168.1.100

启动需要部署的设备,开始部署

 

Be the First to comment.

Leave a Comment

电子邮件地址不会被公开。 必填项已用*标注