Linux运营自动化学工业具,4下Cobbler安装详解韦德

2019-08-24 02:46 来源:未知

Linux运维自动化工具 Cobbler

简介:

关于操作系统安装方面的自动化,早前我们使用 RedHat 推出的 Kickstart 来批量安装操作系统,近年来 RedHat 又推出一个 Cobbler 。

Cobbler 使用 Python 开发,小巧轻便,能够完成系统安装、甚至一些服务的管理。( 号称是补鞋匠都能学会的工具 )

Cobbler 支持命令行管理、web 界面管理、还提供了 API 接口,以便二次开法。

## 关闭 SELinux 、iptables !!!

一、支撑环境安装

shell > yum -y install epel-release ## 安装 epel 源

shell > yum -y install cobbler httpd rsync tftp-server xinetd dhcp pykickstart fence-agents

二、配置 Tftp 、Rsync

 

shell > vim /etc/xinetd.d/tftp

service tftp
{
socket_type = dgram
protocol = udp
wait = yes
user = root
server = /usr/sbin/in.tftpd
server_args = -s /var/lib/tftpboot
disable = no ## 原为 yes
per_source = 11
cps = 100 2
flags = IPv4
}

shell > vim /etc/xinetd.d/rsync

service rsync
{
disable = no ## 原为 yes
flags = IPv6
socket_type = stream
wait = no
user = root
server = /usr/bin/rsync
server_args = --daemon
log_on_failure = USERID
}

shell > vim /etc/httpd/conf

ServerName 127.0.0.1:80

 

## 这个东西大家都知道。

二、配置 Cobbler

shell > openssl passwd -1 -salt 'random-phrase-here' '123456'
$1$random-p$mzxQ/Sx848sXgvfwJCoZM0

## 生成 root 密码( 此密码为新安装的客户机 root 密码 )

 

shell > vim /etc/cobbler/settings

manage_dhcp: 1 ## 原为 0

manage_tftpd: 1

manage_rsync: 1 ## 原为 0

next_server: 192.168.214.10 ## 本机 IP

server: 192.168.214.10 ## 本机 IP

default_password_crypted: "$1$random-p$mzxQ/Sx848sXgvfwJCoZM0" ## 生成的 root 密码

 

三、配置 DHCP

 

shell > vim /etc/cobbler/dhcp.template ## 直接修改这个文件即可

subnet 192.168.214.0 netmask 255.255.255.0 {
option routers 192.168.214.2;
option subnet-mask 255.255.255.0;
range dynamic-bootp 192.168.214.100 192.168.214.120;
default-lease-time 21600;
max-lease-time 43200;
next-server $next_server;

 

## 只修改这个区域的 IP 为合适的 IP 即可

 

shell > chkconfig --add httpd
shell > chkconfig --add xinetd
shell > chkconfig --add dhcpd
shell > chkconfig --add cobblerd
shell > service httpd start
正在启动 httpd:
shell > service xinetd start
正在启动 xinetd: [确定]
shell > service dhcpd start
正在启动 dhcpd: [失败]
shell > service cobblerd start
Starting cobbler daemon: [确定]

shell > cobbler check ## 检查配置
Traceback (most recent call last):
File "/usr/bin/cobbler", line 36, in <module>
sys.exit(app.main())
File "/usr/lib/python2.6/site-packages/cobbler/cli.py", line 655, in main
rc = cli.run(sys.argv)
File "/usr/lib/python2.6/site-packages/cobbler/cli.py", line 270, in run
self.token = self.remote.login("", self.shared_secret)
File "/usr/lib64/python2.6/xmlrpclib.py", line 1199, in __call__
return self.__send(self.__name, args)
File "/usr/lib64/python2.6/xmlrpclib.py", line 1489, in __request
verbose=self.__verbose
File "/usr/lib64/python2.6/xmlrpclib.py", line 1253, in request
return self._parse_response(h.getfile(), sock)
File "/usr/lib64/python2.6/xmlrpclib.py", line 1392, in _parse_response
return u.close()
File "/usr/lib64/python2.6/xmlrpclib.py", line 838, in close
raise Fault(**self._stack[0])
xmlrpclib.Fault: <Fault 1: "<class 'cobbler.cexceptions.CX'>:'login failed'">

shell > cobbler get-loaders ( 解决方法 )

[shell > cobbler check ## 再次检查
The following are potential configuration items that you may want to fix:

1 : service dhcpd is not running
2 : debmirror package is not installed, it will be required to manage debian deployments and repositories

Restart cobblerd and then run 'cobbler sync' to apply changes.

## 1 :提示 dhcpd 没有运行,先不管
## 2 :提示 debmirror 没有安装。如果不是安装 debian 之类的系统,可以忽略此提示。
(如需安装,下载地址为:

shell > cobbler sync ## 同步操作
task started: 2015-05-27_010456_sync
task started (id=Sync, time=Wed May 27 01:04:56 2015)
running pre-sync triggers
cleaning trees
mkdir: /var/lib/tftpboot/pxelinux.cfg
mkdir: /var/lib/tftpboot/grub
mkdir: /var/lib/tftpboot/s390x
mkdir: /var/lib/tftpboot/ppc
mkdir: /var/lib/tftpboot/etc
removing: /var/lib/tftpboot/grub/images
copying bootloaders
trying hardlink /var/lib/cobbler/loaders/pxelinux.0 -> /var/lib/tftpboot/pxelinux.0
trying hardlink /var/lib/cobbler/loaders/menu.c32 -> /var/lib/tftpboot/menu.c32
trying hardlink /var/lib/cobbler/loaders/yaboot -> /var/lib/tftpboot/yaboot
trying hardlink /var/lib/cobbler/loaders/grub-x86.efi -> /var/lib/tftpboot/grub/grub-x86.efi
trying hardlink /var/lib/cobbler/loaders/grub-x86_64.efi -> /var/lib/tftpboot/grub/grub-x86_64.efi
copying distros to tftpboot
copying images
generating PXE configuration files
generating PXE menu structure
rendering DHCP files
generating /etc/dhcp/dhcpd.conf
rendering TFTPD files
generating /etc/xinetd.d/tftp
cleaning link caches
rendering Rsync files
running post-sync triggers
running python triggers from /var/lib/cobbler/triggers/sync/post/*
running python trigger cobbler.modules.sync_post_restart_services
running: dhcpd -t -q
received on stdout:
received on stderr:
running: service dhcpd restart
received on stdout: 正在启动 dhcpd:[确定]

received on stderr:
running shell triggers from /var/lib/cobbler/triggers/sync/post/*
running python triggers from /var/lib/cobbler/triggers/change/*
running python trigger cobbler.modules.scm_track
running shell triggers from /var/lib/cobbler/triggers/change/*
*** TASK COMPLETE ***

shell > service xinetd restart
停止 xinetd: [确定]
正在启动 xinetd: [确定]
shell > service cobblerd restart
Stopping cobbler daemon: [确定]
Starting cobbler daemon: [确定]

 

三、导入安装源

shell > mount /dev/cdrom /mnt/

shell > cobbler import --path=/mnt/ --arch=x86_64 --name=CentOS-6.6-minimal

## 输出信息略(Cobbler 将镜像拷贝一份放在 /var/www/cobbler/ks_mirror/Centos-6.6-minimal-x86_64 目录下)
 (同时会创建一个名为 Centos-6.6-minimal-x86_64 的发布版本及 profile 文件)

 

shell > cobbler list
distros:
Centos-6.6-minimal-x86_64

profiles:
Centos-6.6-minimal-x86_64

systems:

repos:

images:

mgmtclasses:

packages:

files:

 

四、创建 ks 文件

 

shell > vim /var/lib/cobbler/kickstarts/Centos-6.6_minimal-x86_64.ks

# platform=x86, AMD64, 或 Intel EM64T
# version=DEVEL
# Firewall configuration
firewall --disabled
# Install OS instead of upgrade
install
# Use network installation
url --url=""
# Root password
rootpw --iscrypted $1$hk0MvN4A$Dz.sYvyDjac1.cMVTk9270
# System authorization information
auth --useshadow --passalgo=sha512
# Use text mode install
text
# System keyboard
keyboard us
# System language
lang zh_CN
# SELinux configuration
selinux --disabled
# Do not configure the X Window System
skipx
# Installation logging level
logging --level=info
# Reboot after installation
reboot
# System timezone
timezone --isUtc Asia/Shanghai
# Network information
network --bootproto=dhcp --device=eth0 --onboot=on
# System bootloader configuration
bootloader --location=mbr
# Clear the Master Boot Record
zerombr
# Partition clearing information
clearpart --all --initlabel
# Disk partitioning information
part /boot --fstype="ext4" --size=200
part swap --fstype="swap" --size=1024
part / --fstype="ext4" --grow --size=1

 

## 这是我安装了 system-config-kickstart 在图形界面生成的 ks 文件。
## 看到第一行注释行中有一个汉字了吗?就是这个汉字让我卡了两天...( 文件中不要有汉字 )

五、关联 ks 文件

shell > cobbler distro list
Centos-6.6-minimal-x86_64

## 有一个镜像

 

shell > cobbler profile report --name Centos-6.6-minimal-x86_64
Name : Centos-6.6-minimal-x86_64
TFTP Boot Files : {}
Comment :
DHCP Tag : default
Distribution : Centos-6.6-minimal-x86_64
Enable gPXE? : 0
Enable PXE Menu? : 1
Fetchable Files : {}
Kernel Options : {}
Kernel Options (Post Install) : {}
Kickstart : /var/lib/cobbler/kickstarts/sample_end.ks
Kickstart Metadata : {}
Management Classes : []
Management Parameters : <<inherit>>
Name Servers : []
Name Servers Search Path : []
Owners : ['admin']
Parent Profile :
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 : kvm

 

## 看到这个镜像默认使用的 ks 文件为 /var/lib/cobbler/kickstarts/sample_end.ks

shell > cobbler profile add --name=Centos-6.6-minimal --distro=Centos-6.6-minimal-x86_64 --kickstart=/var/lib/cobbler/kickstarts/Centos-6.6_minimal-x86_64.ks

## 关联后,再次查看是否关联成功

 

shell > cobbler profile report --name Centos-6.6-minimal
Name : Centos-6.6-minimal
TFTP Boot Files : {}
Comment :
DHCP Tag : default
Distribution : Centos-6.6-minimal-x86_64
Enable gPXE? : 0
Enable PXE Menu? : 1
Fetchable Files : {}
Kernel Options : {}
Kernel Options (Post Install) : {}
Kickstart : /var/lib/cobbler/kickstarts/Centos-6.6_minimal-x86_64.ks
Kickstart Metadata : {}
Management Classes : []
Management Parameters : <<inherit>>
Name Servers : []
Name Servers Search Path : []
Owners : ['admin']
Parent Profile :
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

 

## 已经关联成功 !

 

shell > cobbler --help

CentOS 7.4下Cobbler安装详解

系统:
[[email protected] ~]# more /etc/RedHat-release
CentOS Linux release 7.4.1708 (Core)

一、安装基础软件:
yum -y install wget net-tools curl epel-release
更新:
yum -y update
关闭iptables与selinux:
[[email protected] ~]# vim /etc/selinux/config
SELINUX=disabled
重启后查看:
[[email protected] ~]# sestatus
SELinux status: disabled

二、安装基础服务:
yum -y install dhcp httpd xinetd tftp-server rsync fence-agents pykickstart
设置开机启动
systemctl enable xinetd dhcpd httpd rsyncd
systemctl start xinetd dhcpd httpd rsyncd
1、安装cobbler
[[email protected] ~]# yum -y install cobbler-web
设置开机启动:
systemctl enable cobblerd
systemctl start cobblerd

2、效验cobbler安装条件
[[email protected] ~]# cobbler check
The following are potential configuration items that you may want to fix:

1 : comment out 'dists' on /etc/debmirror.conf for proper debian support
2 : comment out 'arches' on /etc/debmirror.conf for proper debian support

Restart cobblerd and then run 'cobbler sync' to apply changes

3、随机生成一个密码
[[email protected] ~]# openssl passwd -1 -salt "cobbler" "huangzai"
$1$cobbler$zPOuqy9SLOb87DIQb3RbQ.

4、更改cobbler配置文件
[[email protected] ~]# vim /etc/cobbler/settings
..........
default_password_crypted: "$1$cobbler$zPOuqy9SLOb87DIQb3RbQ." #第三步生成的密码
manage_dhcp: 1 #dhcp服务
manage_tftpd: 1 #xinetd服务
manage_rsync: 1 #rsyncd服务
next_server: 192.168.3.222 #替换成本机IP地址,dhcp服务地址
server: 192.168.3.222 #替换为本机IP地址,cobber服务地址
..........

5、更新load信息:
[[email protected] ~]# cobbler get-loaders
task started: 2018-03-06_051434_get_loaders
task started (id=Download Bootloader Content, time=Tue Mar 6 05:14:34 2018)
downloading to /var/lib/cobbler/loaders/README
downloading to /var/lib/cobbler/loaders/COPYING.elilo
downloading to /var/lib/cobbler/loaders/COPYING.yaboot
downloading to /var/lib/cobbler/loaders/COPYING.syslinux
downloading to /var/lib/cobbler/loaders/elilo-ia64.efi
downloading to /var/lib/cobbler/loaders/yaboot
downloading to /var/lib/cobbler/loaders/pxelinux.0
downloading to /var/lib/cobbler/loaders/menu.c32
downloading to /var/lib/cobbler/loaders/grub-x86.efi
downloading to /var/lib/cobbler/loaders/grub-x86_64.efi
 TASK COMPLETE

6、设置tftp配置文件,‘disable'为'no'
[[email protected] ~]# cat /etc/xinetd.d/tftp | grep -v '^#'
service tftp
{
disable = no
socket_type = dgram
protocol = udp
wait = yes
user = root
server = /usr/sbin/in.tftpd
server_args = -B 1380 -v -s /var/lib/tftpboot
per_source = 11
cps = 100 2
flags = IPv4
}

7、修改dhcp配置文件
[[email protected] ~]# vim /etc/cobbler/dhcp.template
ddns-update-style interim;
allow booting;
allow bootp;
ignore client-updates;
set vendorclass = option vendor-class-identifier;
option pxe-system-type code 93 = unsigned integer 16;
subnet 192.168.3.0 netmask 255.255.255.0 {
option routers 192.168.3.222;
option domain-name-servers 202.96.209.5,202.96.209.133;
option subnet-mask 255.255.255.0;
range dynamic-bootp 192.168.3.60 192.168.3.100;
default-lease-time 21600;
max-lease-time 43200;
next-server $next_server;
class "pxeclients" {
match if substring (option vendor-class-identifier, 0, 9) = "PXEClient";
if option pxe-system-type = 00:02 {
filename "ia64/elilo.efi";
} else if option pxe-system-type = 00:06 {
filename "grub/grub-x86.efi";
} else if option pxe-system-type = 00:07 {
filename "grub/grub-x86_64.efi";
} else if option pxe-system-type = 00:09 {
filename "grub/grub-x86_64.efi";
} else {
filename "pxelinux.0";
}
}

}
.........

三、导入镜像进行配置
1、上传iso镜像到服务器
2、创建文件夹
mkdir -p /data/centos7.0
3、将镜像文件挂载或copy到文件夹
[[email protected] ~]# mount /dev/cdrom /data/centos7.0/

4、把挂载光盘镜像的mnt目录中的内容导入到cobbler
[[email protected] ~]# cobbler import --path=/data/centos7.0/ --name=cent7.0
task started: 2018-03-06_055628_import
task started (id=Media import, time=Tue Mar 6 05:56:28 2018)
Found a candidate signature: breed=redhat, version=rhel6
Found a candidate signature: breed=redhat, version=rhel7
Found a matching signature: breed=redhat, version=rhel7
Adding distros from path /var/www/cobbler/ks_mirror/cent7.0:
creating new distro: cent7.0-x86_64
trying symlink: /var/www/cobbler/ks_mirror/cent7.0 -> /var/www/cobbler/links/cent7.0-x86_64
creating new profile: cent7.0-x86_64
associating repos
checking for rsync repo(s)
checking for rhn repo(s)
checking for yum repo(s)
starting descent into /var/www/cobbler/ks_mirror/cent7.0 for cent7.0-x86_64
processing repo at : /var/www/cobbler/ks_mirror/cent7.0
need to process repo/comps: /var/www/cobbler/ks_mirror/cent7.0
looking for /var/www/cobbler/ks_mirror/cent7.0/repodata/comps.xml
Keeping repodata as-is :/var/www/cobbler/ks_mirror/cent7.0/repodata
 TASK COMPLETE

5、cobber report查看导入信息
[[email protected] ~]# cobbler report
distros:

Name : cent7.0-x86_64
Architecture : x86_64
TFTP Boot Files : {}
Breed : redhat
Comment :
Fetchable Files : {}
Initrd : /var/www/cobbler/ks_mirror/cent7.0/images/pxeboot/initrd.img
Kernel : /var/www/cobbler/ks_mirror/cent7.0/images/pxeboot/vmlinuz
Kernel Options : {}
Kernel Options (Post Install) : {}
Kickstart Metadata : {'tree': ' protected]](
Management Classes : []
OS Version : rhel7
Owners : ['admin']
Red Hat Management Key : <<inherit>>
Red Hat Management Server : <<inherit>>
Template Files : {}

Name : rhel7.0-x86_64
Architecture : x86_64
TFTP Boot Files : {}
Breed : redhat
Comment :
Fetchable Files : {}
Initrd : /var/www/cobbler/ks_mirror/rhel7.0/images/pxeboot/initrd.img
Kernel : /var/www/cobbler/ks_mirror/rhel7.0/images/pxeboot/vmlinuz
Kernel Options : {}
Kernel Options (Post Install) : {}
Kickstart Metadata : {'tree': ' protected]](
Management Classes : []
OS Version : rhel7
Owners : ['admin']
Red Hat Management Key : <<inherit>>
Red Hat Management Server : <<inherit>>
Template Files : {}

profiles:

Name : cent7.0-x86_64
TFTP Boot Files : {}
Comment :
DHCP Tag : default
Distribution : cent7.0-x86_64
Enable gPXE? : 0
Enable PXE Menu? : 1
Fetchable Files : {}
Kernel Options : {}
Kernel Options (Post Install) : {}
Kickstart : /var/lib/cobbler/kickstarts/sample_end.ks
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 : kvm

Name : rhel7.0-x86_64
TFTP Boot Files : {}
Comment :
DHCP Tag : default
Distribution : rhel7.0-x86_64
Enable gPXE? : 0
Enable PXE Menu? : 1
Fetchable Files : {}
Kernel Options : {}
Kernel Options (Post Install) : {}
Kickstart : /var/lib/cobbler/kickstarts/sample_end.ks
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 : kvm

6、查看导入列表
[[email protected] ~]# cobbler distro list
cent7.0-x86_64
rhel7.0-x86_64

7、同步所有cobber配置
[[email protected] ~]# cobbler sync
task started: 2018-03-06_061140_sync
task started (id=Sync, time=Tue Mar 6 06:11:40 2018)
running pre-sync triggers
cleaning trees
removing: /var/www/cobbler/images/cent7.0-x86_64
removing: /var/lib/tftpboot/pxelinux.cfg/default
removing: /var/lib/tftpboot/grub/images
removing: /var/lib/tftpboot/grub/efidefault
removing: /var/lib/tftpboot/images/cent7.0-x86_64
removing: /var/lib/tftpboot/s390x/profile_list
copying bootloaders
copying: /var/lib/cobbler/loaders/pxelinux.0 -> /var/lib/tftpboot/pxelinux.0
copying: /var/lib/cobbler/loaders/menu.c32 -> /var/lib/tftpboot/menu.c32
copying: /var/lib/cobbler/loaders/yaboot -> /var/lib/tftpboot/yaboot
copying: /usr/share/syslinux/memdisk -> /var/lib/tftpboot/memdisk
copying: /var/lib/cobbler/loaders/grub-x86.efi -> /var/lib/tftpboot/grub/grub-x86.efi
copying: /var/lib/cobbler/loaders/grub-x86_64.efi -> /var/lib/tftpboot/grub/grub-x86_64.efi
copying distros to tftpboot
copying files for distro: cent7.0-x86_64
trying hardlink /var/www/cobbler/ks_mirror/cent7.0/images/pxeboot/vmlinuz -> /var/lib/tftpboot/images/cent7.0-x86_64/vmlinuz
trying hardlink /var/www/cobbler/ks_mirror/cent7.0/images/pxeboot/initrd.img -> /var/lib/tftpboot/images/cent7.0-x86_64/initrd.img
copying images
generating PXE configuration files
generating PXE menu structure
copying files for distro: cent7.0-x86_64
trying hardlink /var/www/cobbler/ks_mirror/cent7.0/images/pxeboot/vmlinuz -> /var/www/cobbler/images/cent7.0-x86_韦德国际1946官网,64/vmlinuz
trying hardlink /var/www/cobbler/ks_mirror/cent7.0/images/pxeboot/initrd.img -> /var/www/cobbler/images/cent7.0-x86_64/initrd.img
Writing template files for cent7.0-x86_64
rendering TFTPD files
generating /etc/xinetd.d/tftp
processing boot_files for distro: cent7.0-x86_64
cleaning link caches
running post-sync triggers
running python triggers from /var/lib/cobbler/triggers/sync/post/
running python trigger cobbler.modules.sync_post_restart_services
running shell triggers from /var/lib/cobbler/triggers/sync/post/
running python triggers from /var/lib/cobbler/triggers/change/
running python trigger cobbler.modules.scm_track
running shell triggers from /var/lib/cobbler/triggers/change/
 TASK COMPLETE

8、重启所有服务

9、安装成功,客户端启动:

韦德国际1946官网 1

10、修改cobber登录密码:
[[email protected] ~]# htdigest /etc/cobbler/users.digest "Cobbler" cobbler
Changing password for user cobbler in realm Cobbler
New password:
Re-type new password:

11、打开cobber web

韦德国际1946官网 2

cobblerd启动报错
[[email protected] conf.d]# systemctl status cobblerd
● cobblerd.service - Cobbler Helper Daemon
Loaded: loaded (/usr/lib/systemd/system/cobblerd.service; enabled; vendor preset: disabled)
Active: inactive (dead) since Mon 2018-03-12 07:09:51 EDT; 18s ago
Process: 1644 ExecStartPost=/usr/bin/touch /usr/share/cobbler/web/cobbler.wsgi (code=exited, status=0/SUCCESS)
Process: 1643 ExecStart=/usr/bin/cobblerd -F (code=exited, status=0/SUCCESS)
Main PID: 1643 (code=exited, status=0/SUCCESS)

Mar 12 07:09:51 cobbler cobblerd[1643]: Traceback (most recent call last):
Mar 12 07:09:51 cobbler cobblerd[1643]: File "/usr/bin/cobblerd", line 75, in main
Mar 12 07:09:51 cobbler cobblerd[1643]: api = cobbler_api.BootAPI(is_cobblerd=True)
Mar 12 07:09:51 cobbler cobblerd[1643]: File "/usr/lib/python2.7/site-packages/cobbler/api.py", ...it__
Mar 12 07:09:51 cobbler cobblerd[1643]: "authn_configfile"
Mar 12 07:09:51 cobbler cobblerd[1643]: File "/usr/lib/python2.7/site-packages/cobbler/api.py", ...file
Mar 12 07:09:51 cobbler cobblerd[1643]: return module_loader.get_module_from_file(section,name,f...ack)
Mar 12 07:09:51 cobbler cobblerd[1643]: File "/usr/lib/python2.7/site-packages/cobbler/modulelo...file
Mar 12 07:09:51 cobbler cobblerd[1643]: raise CX(("Failed to load module for %s/%s") % (categor...ld))
Mar 12 07:09:51 cobbler cobblerd[1643]: CX: 'Failed to load module for authentication/module'
Hint: Some lines were ellipsized, use -l to show in full.
解决方法:
[[email protected] ~]# vim /etc/cobbler/modules.conf
[authentication]
module = authn_configfile
重启cobber服务
systemctl restart cobblerd

效验报错:
[[email protected] ~]# cobbler check
httpd does not appear to be running and proxying cobbler, or SELinux is in the way. Original traceback:
Traceback (most recent call last):
File "/usr/lib/python2.7/site-packages/cobbler/cli.py", line 251, in check_setup
s.ping()
File "/usr/lib64/python2.7/xmlrpclib.py", line 1233, in call
return self.send(self.name, args)
File "/usr/lib64/python2.7/xmlrpclib.py", line 1587, in request
verbose=self.verbose
File "/usr/lib64/python2.7/xmlrpclib.py", line 1273, in request
return self.single_request(host, handler, request_body, verbose)
File "/usr/lib64/python2.7/xmlrpclib.py", line 1321, in single_request
response.msg,
ProtocolError: <ProtocolError for 127.0.0.1:80/cobbler_api: 503 Service Unavailable>

解决方法:
关闭selinux:
[[email protected] ~]# vim /etc/selinux/config
SELINUX=disabled
重启服务器

本文永久更新链接地址:

7.4下Cobbler安装详解 系统: [[email protected] ~]# more /etc/RedHat-release CentOS Linux release 7.4.1708 (Core) 一、安装基础软件: yum -y install wget net-tools...

usage

cobbler <distro|profile|system|repo|image|mgmtclass|package|file> ...
[add|edit|copy|getks*|list|remove|rename|report] [options|--help]
cobbler <aclsetup|buildiso|import|list|replicate|report|reposync|sync|validateks|version|signature|get-loaders|hardlink> [options|--help]

shell > cobbler profile --help

usage

cobbler profile add
cobbler profile copy
cobbler profile dumpvars
cobbler profile edit
cobbler profile find
cobbler profile getks
cobbler profile list
cobbler profile remove
cobbler profile rename
cobbler profile report

 

## 它有多种方法,添加、编辑、移除等等( 用到时,请自己琢磨 )。

shell > cobbler sync

## 同步一下配置,客户端开机测试

## 从网络引导进入后,会有一个选择列表,选择要安装 profile ,就可以自动完成安装。

## 修改 ks.cfg 文件后,不需要 sync 就可以直接生效!

## 如果不想关闭防火墙,那么请打开 TCP ( 69、80、25151 ) 端口。

## 遇到问题仔细观察,ks.cfg 中一定不能有中文,注释行也不可以!

Linux运维自动化之Cobbler安装部署RHEL7.0 

Cobbler自动批量部署CentOS 6和CentOS 7   

自动化安装工具Cobbler简易安装配置

Cobbler批量安装Ubuntu/CentOS系统 

运维自动化之Cobbler安装配置

RHEL5.5下Cobbler的配置

运维自动化部署Cobbler之服务安装篇

利用Cobbler批量快速网络安装CentOS

CentOS 6.3上安装部署 Cobbler

Cobbler批量部署Linux系统

本文永久更新链接地址:

Cobbler 简介: 关于操作系统安装方面的自动化,早前我们使用 RedHat 推出的 Kickstart 来批量安装操作系统,近年来 RedH...

TAG标签: 韦德娱乐1946
版权声明:本文由韦德娱乐1946_韦德娱乐1946网页版|韦德国际1946官网发布于韦德国际1946官网,转载请注明出处:Linux运营自动化学工业具,4下Cobbler安装详解韦德