使用 cobbler 安装工具批量安装服务器

  • 生成加密的密码

[root@localhost ~]# openssl passwd -1 -salt "$RANDOM" '123456'

14083$9jFt/kdeFNmOe4QlSuV4D.

  • 将新生成的加密密码加入到配置文件

[root@localhost ~]# vim /etc/cobbler/settings

.... //此处为省略内容

default_password_crypted: "128958$sq1sJFDX0bZo.H8Q.8NLg0"

..... //此处为省略内容

  • 重启 cobbler

[root@localhost ~]# systemctl restart cobblerd

[root@localhost ~]# ss -antl

State Recv-Q Send-Q Local Address:Port Peer Address:Port

LISTEN 0 128 *:22 :

LISTEN 0 100 127.0.0.1:25 :

LISTEN 0 5 127.0.0.1:25151 :

LISTEN 0 5 *:873 :

LISTEN 0 128 :::80 :::*

LISTEN 0 128 :::22 :::*

LISTEN 0 100 ::1:25 :::*

LISTEN 0 128 :::443 :::*

LISTEN 0 5 :::873 :::*

  • 通过 cobbler check 核对当前设置是否有问题

[root@localhost ~]# cobbler check

The following are potential configuration items that you may want to fix:

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

2 : fencing tools were not found, and are required to use the (optional) power management features. install cman or fence-agents to use them

以上两个是关于 debian 系统的错误,请忽略

  • 配置 cobbler dhcp

  • 修改 cobbler 配置文件,让 cobbler 控制 dhcp

[root@localhost ~]# vim /etc/cobbler/dhcp.template

.... //此处为省略内容

subnet 192.168.170.0 netmask 255.255.255.0 {

option routers 192.168.170.2; //服务器端的网关

option domain-name-servers 8.8.8.8; //此处为系统安装好后指定的 dns 地址

option subnet-mask 255.255.255.0;

range dynamic-bootp 192.168.170.100 192.168.170.200; 分配的地址池

default-lease-time 21600;

max-lease-time 43200;

next-server $next_server;

.... //此处为省略内容

  • 重启服务并同步配置,改完 dhcp 必须要 sync 同步配置

[root@localhost ~]# cobbler sync

task started: 2019-08-29_184616_sync

task started (id=Sync, time=Thu Aug 29 18:46:16 2019)

running pre-sync triggers

cleaning trees

removing: /var/www/cobbler/images/rhel-7-x86_64

removing: /var/lib/tftpboot/pxelinux.cfg/01-00-50-56-27-5d-16

removing: /var/lib/tftpboot/pxelinux.cfg/default

removing: /var/lib/tftpboot/pxelinux.cfg/01-00-50-56-3a-17-d2

removing: /var/lib/tftpboot/grub/images

removing: /var/lib/tftpboot/grub/grub-x86.efi

removing: /var/lib/tftpboot/grub/grub-x86_64.efi

removing: /var/lib/tftpboot/grub/01-00-50-56-27-5D-16

removing: /var/lib/tftpboot/grub/efidefault

removing: /var/lib/tftpboot/grub/01-00-50-56-3A-17-D2

removing: /var/lib/tftpboot/images/rhel-7-x86_64

removing: /var/lib/tftpboot/s390x/profile_list

copying bootloaders

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 files for distro: rhel-7-x86_64

trying hardlink /var/www/cobbler/ks_mirror/rhel-7/images/pxeboot/vmlinuz -> /var/lib/tftpboot/images/rhel-7-x86_64/vmlinuz

trying hardlink /var/www/cobbler/ks_mirror/rhel-7/images/pxeboot/initrd.img -> /var/lib/tftpboot/images/rhel-7-x86_64/initrd.img

copying images

generating PXE configuration files

generating: /var/lib/tftpboot/pxelinux.cfg/01-00-50-56-3a-17-d2

generating: /var/lib/tftpboot/grub/01-00-50-56-3A-17-D2

generating PXE menu structure

copying files for distro: rhel-7-x86_64

trying hardlink /var/www/cobbler/ks_mirror/rhel-7/images/pxeboot/vmlinuz -> /var/www/cobbler/images/rhel-7-x86_64/vmlinuz

trying hardlink /var/www/cobbler/ks_mirror/rhel-7/images/pxeboot/initrd.img -> /var/www/cobbler/images/rhel-7-x86_64/initrd.img

Writing template files for rhel-7-x86_64

rendering DHCP files

generating /etc/dhcp/dhcpd.conf

rendering TFTPD files

generating /etc/xinetd.d/tftp

processing boot_files for distro: rhel-7-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: dhcpd -t -q

received on stdout:

received on stderr:

running: service dhcpd restart

received on stdout:

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值