cobbler安装报错——Exceptionoccured:<class'cobbler.ce

研究自动化安装cobbler,在进行同步cobbler配置时出现报错

成都创新互联公司成立于2013年,是专业互联网技术服务公司,拥有项目成都做网站、成都网站建设网站策划,项目实施与项目整合能力。我们以让每一个梦想脱颖而出为使命,1280元广河做网站,已为上家服务,为广河各地企业和个人服务,联系电话:18980820575

cobbler sync               //同步生成dhcp配置文件
dhcpd -t failed
Exception occured: 
Exception value: 'cobbler trigger failed: cobbler.modules.sync_post_restart_services'
Exception Info:
  File "/usr/lib/python2.7/site-packages/cobbler/remote.py", line 82, in run
    rc = self._run(self)
   File "/usr/lib/python2.7/site-packages/cobbler/remote.py", line 181, in runner
    return self.remote.api.sync(self.options.get("verbose",False),logger=self.logger)
   File "/usr/lib/python2.7/site-packages/cobbler/api.py", line 763, in sync
    return sync.run()
   File "/usr/lib/python2.7/site-packages/cobbler/action_sync.py", line 144, in run
    utils.run_triggers(self.api, None, "/var/lib/cobbler/triggers/sync/post/*", logger=self.logger)
   File "/usr/lib/python2.7/site-packages/cobbler/utils.py", line 928, in run_triggers
    raise CX("cobbler trigger failed: %s" % m.__name__)

看报错是与dhcp服务有关,说明可能是dhcp模板配置错误,进入配置文件中查看,看到果然是地址池配置错误

vi /etc/cobbler/dhcp.template
subnet 192.168.109.0 netmask 255.255.255.0 {
     option routers             192.168.109.1;
     option domain-name-servers 8.8.8.8;
     option subnet-mask         255.255.255.0;
     range dynamic-bootp        192.168.1.100 192.168.1.254;       //地址池未进行修改
     default-lease-time         21600;
     max-lease-time             43200;
     next-server                $next_server;
subnet 192.168.109.0 netmask 255.255.255.0 {
     option routers             192.168.109.1;
     option domain-name-servers 8.8.8.8;
     option subnet-mask         255.255.255.0;
     range dynamic-bootp        192.168.109.100 192.168.109.254;               //将地址池做修改
     default-lease-time         21600;
     max-lease-time             43200;
     next-server                $next_server;

注意dhcp模板中要修改的地方:subnet、option routers、DNS、range dynamic-bootp

修改后重新加载服务,服务成功!

cobbler sync
task started: 2019-11-05_011754_sync
task started (id=Sync, time=Tue Nov  5 01:17:54 2019)
......
running shell triggers from /var/lib/cobbler/triggers/change/*
*** TASK COMPLETE ***             //任务完成

文章标题:cobbler安装报错——Exceptionoccured:<class'cobbler.ce
当前路径:http://pwwzsj.com/article/gocdos.html