您好,登錄后才能下訂單哦!
研究自動化安裝cobbler,在進行同步cobbler配置時出現報錯
cobbler?sync???????????????//同步生成dhcp配置文件
dhcpd?-t?failed Exception?occured:?<class?'cobbler.cexceptions.CX'> 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?***?????????????//任務完成
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。