CentOS7安装Cobbler并自动部署Ubuntu

一、简介

二、安装CentOS 7 调整配置及安装相关软件

1、调整配置

2、安装 epel

3、安装cobblercobbler-web 以及相关依赖软件

4、设置开机启动

三、Cobblertftpdhcprsync配置

1TFTP配置

2、配置rsync

3、配置/etc/cobbler/settings

4、修改/etc/cobbler/modules.conf

5、修改/etc/cobbler/dhcp.template

6、重启cobbler httpd服务

四、检查cobbler配置

五、导入镜像并查看导入情况

1、导入镜像

2、查看

六、编辑seed文件

1、普通分区配置

2lvm分区配置

七、注意事项

八、截图

一、简介

二、安装CentOS 7 调整配置及安装相关软件

1、调整配置

安装完成后关闭selinux或参照cobbler官方文档设置selinuxhttp://cobbler.github.io/manuals/2.6.0/4/2_-_SELinux.html

[root@cobbler-server ~]# sed -i ‘/SELINUX/s/enforcing/disabled/’ /etc/selinux/config  

重启服务器

关闭iptables以及取消开机启动,centos7 minimal没有安装ipables

关闭firewall或放行80 67 68 69 443 端口

80 443cobbler web管理界面端口

67 68 DHCP端口

69TFTP端口

[root@cobbler-server ~]# systemctl stop firewalld

[root@cobbler-server ~]# systemctl disable firewalld

2、安装 epel

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

[root@cobbler-server ~]# yum makecache

3、安装cobblercobbler-web 以及相关依赖软件

[root@cobbler-server ~]# yum install cobbler cobbler-web xinetd pykickstart cman dhcp -y

4、设置开机启动

[root@cobbler-server ~]# systemctl enable httpd

[root@cobbler-server ~]# systemctl enable dhcpd 

[root@cobbler-server ~]# systemctl enable cobblerd

三、Cobblertftpdhcprsync配置

1TFTP配置

配置tftp绿色着色为修改后的值

[root@cobbler-server ~]# vim /etc/xinetd.d/tftp

# default: off

# description: The tftp server serves files using the trivial file transfer \

#       protocol.  The tftp protocol is often used to boot diskless \

#       workstations, download configuration files to network-aware printers, \

#       and to start the installation process for some operating systems.

service tftp

{

        socket_type             = dgram

        protocol                = udp

        wait                    = yes

        user                    = root

        server                  = /usr/sbin/in.tftpd

        server_args             = -s /var/lib/tftpboot

        disable                 = no

        per_source              = 11

        cps                     = 100 2

        flags                   = IPv4

}

2、配置rsync

[root@cobbler-server ~]# systemctl enable rsyncd

CentOS7上安装cobbler 对于rsync无需额外配置

3、配置/etc/cobbler/settings

[root@cobbler-server ~]# cat /etc/cobbler/settings |grep ‘^[^#]’

allow_duplicate_hostnames: 0

allow_duplicate_ips: 0

allow_duplicate_macs: 0

allow_dynamic_settings: 0

anamon_enabled: 0

authn_pam_service: “login”

auth_token_expiration: 3600

build_reporting_enabled: 0

build_reporting_sender: “”

build_reporting_email: [ ‘root@localhost’ ]

build_reporting_smtp_server: “localhost”

build_reporting_subject: “”

build_reporting_ignorelist: [ “” ]

cheetah_import_whitelist:

 – “random”

 – “re”

 – “time”

createrepo_flags: “-c cache -s sha”

default_kickstart: /var/lib/cobbler/kickstarts/default.ks

default_name_servers: []

default_ownership:

 – “admin”

default_password_crypted: “$1$mF86/UHC$WvcIcX2t6crBz2onWxyac.”

default_template_type: “cheetah”

default_virt_bridge: xenbr0

default_virt_file_size: 5

default_virt_ram: 512

default_virt_type: xenpv

enable_gpxe: 0

enable_menu: 1

func_auto_setup: 0

func_master: overlord.example.org

http_port: 80

kernel_options:

 ksdevice: bootif

 lang: ‘ ‘

 text: ~

kernel_options_s390x:

 RUNKS: 1

 ramdisk_size: 40000

 root: /dev/ram0

 ro: ~

 ip: off

 vnc: ~

ldap_server: “ldap.example.com”

ldap_base_dn: “DC=example,DC=com”

ldap_port: 389

ldap_tls: 1

ldap_anonymous_bind: 1

ldap_search_bind_dn: ”

ldap_search_passwd: ”

ldap_search_prefix: ‘uid=’

ldap_tls_cacertfile: ”

ldap_tls_keyfile: ”

ldap_tls_certfile: ”

mgmt_classes: []

mgmt_parameters:

 from_cobbler: 1

puppet_auto_setup: 0

sign_puppet_certs_automatically: 0

puppetca_path: “/usr/bin/puppet”

remove_old_puppet_certs_automatically: 0

manage_dhcp: 1

#cobbler接管DHCP,默认为0,此处修改以后需要修改对应/etc/cobbler/dhcp.template模板

manage_dns: 0

bind_chroot_path: “”

bind_master: 127.0.0.1

manage_tftpd: 1

manage_rsync: 1 #接管rsync,无需额外配置rsync

manage_forward_zones: []

manage_reverse_zones: []

next_server: 192.168.11.252 #本机ip地址

power_management_default_type: ‘ipmitool’

power_template_dir: “/etc/cobbler/power”

pxe_just_once: 0

pxe_template_dir: “/etc/cobbler/pxe”

consoles: “/var/consoles”

RedHat_management_type: “off”

redhat_management_server: “xmlrpc.rhn.redhat.com”

redhat_management_key: “”

redhat_management_permissive: 0

register_new_installs: 0

reposync_flags: “-l -n -d”

restart_dns: 1

restart_dhcp: 1

run_install_triggers: 1

scm_track_enabled: 0

scm_track_mode: “git”

server: 192.168.11.252 #本机ip地址

client_use_localhost: 0

client_use_https: 0

snippetsdir: /var/lib/cobbler/snippets

template_remote_kickstarts: 0

virt_auto_boot: 1

webdir: /var/www/cobbler

xmlrpc_port: 25151

yum_post_install_mirror: 1

yum_distro_priority: 1

yumdownloader_flags: “–resolve”

serializer_pretty_json: 0

replicate_rsync_options: “-avzH”

replicate_repo_rsync_options: “-avzH”

always_write_dhcp_entries: 0

proxy_url_ext: “”

proxy_url_int: “”

 

4、修改/etc/cobbler/modules.conf

[root@cobbler-server ~]# cat /etc/cobbler/modules.conf |grep ‘^[^#]’

 

[authentication]

module = authn_configfile

[authorization]

module = authz_allowall

[dns]

module = manage_bind

[dhcp]

module = manage_isc #如果是dnsmasq就应该为manage_dnsmasq

[tftpd]

module = manage_in_tftpd

 

5、修改/etc/cobbler/dhcp.template

[root@localhost cobbler]# cat /etc/cobbler/dhcp.template |grep ‘^[^#]’

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.11.0 netmask 255.255.255.0 {

     option routers             192.168.11.252;

     option domain-name-servers 192.168.11.252;

     option subnet-mask         255.255.255.0;

     range dynamic-bootp        192.168.11.100 192.168.11.200;

     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 {

                  filename “pxelinux.0”;

          }

     }

}

    ## group could be subnet if your dhcp tags line up with your subnets

    ## or really any valid dhcpd.conf construct … if you only use the

    ## default dhcp tag in cobbler, the group block can be deleted for a

    ## flat configuration

group {

        #for mac in $dhcp_tags[$dhcp_tag].keys():

            #set iface = $dhcp_tags[$dhcp_tag][$mac]

    host $iface.name {

        hardware ethernet $mac;

        #if $iface.ip_address:

        fixed-address $iface.ip_address;

        #end if

        #if $iface.hostname:

        option host-name “$iface.hostname”;

        #end if

        #if $iface.netmask:

        option subnet-mask $iface.netmask;

        #end if

        #if $iface.gateway:

        option routers $iface.gateway;

        #end if

        #if $iface.enable_gpxe:

        if exists user-class and option user-class = “gPXE” {

            filename “http://$cobbler_server/cblr/svc/op/gpxe/system/$iface.owner”;

        } else if exists user-class and option user-class = “iPXE” {

            filename “http://$cobbler_server/cblr/svc/op/gpxe/system/$iface.owner”;

        } else {

            filename “undionly.kpxe”;

        }

        #else

        filename “$iface.filename”;

        #end if

        ## Cobbler defaults to $next_server, but some users

        ## may like to use $iface.system.server for proxied setups

        next-server $next_server;

        ## next-server $iface.next_server;

    }

        #end for

}

6、重启cobbler httpd服务

[root@cobbler-server ~]# systemctl restart cobblerd

[root@cobbler-server ~]# systemctl restart httpd

文章来源网络,作者:运维,如若转载,请注明出处:https://shuyeidc.com/wp/220269.html<

(0)
运维的头像运维
上一篇2025-04-14 12:05
下一篇 2025-04-14 12:06

相关推荐

  • 个人主题怎么制作?

    制作个人主题是一个将个人风格、兴趣或专业领域转化为视觉化或结构化内容的过程,无论是用于个人博客、作品集、社交媒体账号还是品牌形象,核心都是围绕“个人特色”展开,以下从定位、内容规划、视觉设计、技术实现四个维度,详细拆解制作个人主题的完整流程,明确主题定位:找到个人特色的核心主题定位是所有工作的起点,需要先回答……

    2025-11-20
    0
  • 社群营销管理关键是什么?

    社群营销的核心在于通过建立有温度、有价值、有归属感的社群,实现用户留存、转化和品牌传播,其管理需贯穿“目标定位-内容运营-用户互动-数据驱动-风险控制”全流程,以下从五个维度展开详细说明:明确社群定位与目标社群管理的首要任务是精准定位,需明确社群的核心价值(如行业交流、产品使用指导、兴趣分享等)、目标用户画像……

    2025-11-20
    0
  • 香港公司网站备案需要什么材料?

    香港公司进行网站备案是一个涉及多部门协调、流程相对严谨的过程,尤其需兼顾中国内地与香港两地的监管要求,由于香港公司注册地与中国内地不同,其网站若主要服务内地用户或使用内地服务器,需根据服务器位置、网站内容性质等,选择对应的备案路径(如工信部ICP备案或公安备案),以下从备案主体资格、流程步骤、材料准备、注意事项……

    2025-11-20
    0
  • 如何企业上云推广

    企业上云已成为数字化转型的核心战略,但推广过程中需结合行业特性、企业痛点与市场需求,构建系统性、多维度的推广体系,以下从市场定位、策略设计、执行落地及效果优化四个维度,详细拆解企业上云推广的实践路径,精准定位:明确目标企业与核心价值企业上云并非“一刀切”的方案,需先锁定目标客户群体,提炼差异化价值主张,客户分层……

    2025-11-20
    0
  • PS设计搜索框的实用技巧有哪些?

    在PS中设计一个美观且功能性的搜索框需要结合创意构思、视觉设计和用户体验考量,以下从设计思路、制作步骤、细节优化及交互预览等方面详细说明,帮助打造符合需求的搜索框,设计前的规划明确使用场景:根据网站或APP的整体风格确定搜索框的调性,例如极简风适合细线条和纯色,科技感适合渐变和发光效果,电商类则可能需要突出搜索……

    2025-11-20
    0

发表回复

您的邮箱地址不会被公开。必填项已用 * 标注