Hi,
I work aroun a little bit more now I have,
# ******************************************************************
# Cobbler managed dhcpd.conf file
#
# generated from cobbler dhcp.conf template ($date)
# Do NOT make changes to /etc/dhcpd.conf. Instead, make your changes
# in /etc/cobbler/dhcp.template, as /etc/dhcpd.conf will be
# overwritten.
#
# ******************************************************************
ddns-update-style interim;
allow booting;
allow bootp;
ignore client-updates;
set vendorclass = option vendor-class-identifier;
#for dhcp_tag in $dhcp_tags.keys():
#class for Cobbler DHCP tag: $dhcp_tag
#if $dhcp_tags == "pxeclient"
class "pxeclient" {
match if option user-class = "pxeclient";
}
#end if
#if $dhcp_tags = "mysql"
class "mysql" {
match if option user-class = "mysql";
}
#end if
#if $dhcp_tags = "others"
class "others" {
match if option user-class = "others";
}
#end if
subnet 192.168.57.0 netmask 255.255.255.0 {
pool {
allow members of "pxeclient";
option routers 192.168.57.111;
option domain-name-servers 8.8.8.8;
option subnet-mask 255.255.255.0;
range dynamic-bootp 192.168.57.200 192.168.57.254;
filename "/pxelinux.0";
default-lease-time 21600;
max-lease-time 43200;
next-server $next_server;
}
pool {
allow members of "mysql";
range 192.168.57.30 192.168.57.40;
option routers 192.168.57.102;
}
pool {
allow members of "others";
range 192.168.57.50 192.168.57.100;
}
}
#end for
I am having this error when I run "cobbler sync";
rendering DHCP files
generating /etc/dhcp/dhcpd.conf
Exception occured: <class 'Cheetah.Parser.ParseError'>
Exception value:
Error in the Python code which Cheetah generated for this template:
================================================================================
invalid syntax (cheetah_DynamicallyCompiledCheetahTemplate_1371569049_44_94545.py, line 187)
Line|Python Code
----|-------------------------------------------------------------
\t}
186 |''')
if VFFSL(SL,"dhcp_tags",True) = "mysql": # generated from line 70, col 2
^
\tmatch if option user-class = "mysql";
\t}
190 |''')
================================================================================
Here is the corresponding Cheetah code:
Line 70, column 2
Line|Cheetah Code
----|-------------------------------------------------------------
match if option user-class = "pxeclient";
}
#end if
#if $dhcp_tags = "mysql"
^
class "mysql" {
match if option user-class = "mysql";
}
Exception Info:
File "/usr/lib/python2.7/dist-packages/cobbler/remote.py", line 89, in run
rc = self._run(self)
File "/usr/lib/python2.7/dist-packages/cobbler/remote.py", line 184, in runner
return self.remote.api.sync(self.options.get("verbose",False),logger=self.logger)
File "/usr/lib/python2.7/dist-packages/cobbler/api.py", line 699, in sync
return sync.run()
File "/usr/lib/python2.7/dist-packages/cobbler/action_sync.py", line 132, in run
self.dhcp.write_dhcp_file()
File "/usr/lib/python2.7/dist-packages/cobbler/modules/manage_isc.py", line 197, in write_dhcp_file
self.templar.render(template_data, metadata, self.settings_file, None)
File "/usr/lib/python2.7/dist-packages/cobbler/templar.py", line 128, in render
t = Template(source=raw_data, errorCatcher="Echo", searchList=[search_table], compilerSettings={'useStackFrame':False})
File "DynamicallyCompiledCheetahTemplate.py", line 58, in __init__
File "_etc_cobbler_cheetah_macros.py", line 58, in __init__
File "/usr/lib/python2.7/dist-packages/Cheetah/Template.py", line 1259, in __init__
self._compile(source, file, compilerSettings=compilerSettings)
File "/usr/lib/python2.7/dist-packages/Cheetah/Template.py", line 1553, in _compile
keepRefToGeneratedCode=True)
File "/usr/lib/python2.7/dist-packages/cobbler/template_api.py", line 127, in compile
return Cheetah.Template.Template.compile(*args, **kwargs)
File "/usr/lib/python2.7/dist-packages/Cheetah/Template.py", line 798, in compile
raise parseError
!!! TASK FAILED !!!