buzzdeee / buzzdeee-dhcpd

Puppet Module to manage OpenBSD dhcpd
1 stars 1 forks source link

Multiple subenet resources result in an invalid configuration. #6

Closed zachfi closed 1 year ago

zachfi commented 10 years ago

Due to the way the templates are handled, the block inside the resource leaves each of the subents open ended, and all of the '}' are closed together at the end.

buzzdeee commented 10 years ago

I know that this is still not supported, for that reason, grouping hosts is also not (yet) supported.

zachfi commented 10 years ago

After reading the manpage for dhcpd.conf on OpenBSD 5.6, I'm not sure how we can compensate for the nested behavior of the config file without making the code difficult to work with. An include directive in the config would help, but I don't think concat is going to be the right choice. It might be worth writing an augeas lense or something to help here.

buzzdeee commented 10 years ago

I was also already thinking about it, and I thought about two things here:

However, the augeas lense, my skills are not yet enough, to write one. I once looked at augeas, but it was only fairly quickly, and my up to now still limited ruby skills, prevented me to start right away ;)

The second option, iterating over the large hash, with a lot of if/else or case statements in multiple levels. Could likely be done with future parser in the manifests, or via ERB code in the templates. But I fear either way would be a lot of code, likely error prone and maybe hard to maintain.