Conditional File Include

Matthew Kassawara matthew.kassawara at blinker.com
Mon Aug 7 14:51:00 UTC 2017


Norman,

Did you consider using some sort of configuration management or dynamic
templating tool (such as consul-template) to change configuration
directives on the fly depending on the role (primary/secondary) of the
particular DHCP server?

Matt

On Mon, Aug 7, 2017 at 7:53 AM, Norman Elton <normelton at gmail.com> wrote:

> Bob,
>
> Sorry, I'm actually .gitignoring the symlink already. I was hoping to
> figure out a way to avoid needing the symlink to begin with. It's not
> a huge deal, just a little kludgey. My fear is that someone restoring
> the server after some sort of catastrophe might not be checking my
> readme file, and struggling to get the server back online.
>
> Thanks!
>
> Norman
>
> On Mon, Aug 7, 2017 at 9:36 AM, Bob Harold <rharolde at umich.edu> wrote:
> >
> > On Mon, Aug 7, 2017 at 8:34 AM, Norman Elton <normelton at gmail.com>
> wrote:
> >>
> >> We keep our DHCP configuration in a git repository. In the case of
> >> failover pairs, they share a repository. This works great, since the
> >> vast majority of the configuration is identical.
> >>
> >> Of course, the failover configuration is different between the two
> >> servers. To solve this, my dhcpd.conf file does an include on
> >> "dhcp-failover.conf", which doesn't actually exist in the repository.
> >> Instead, it's a symlink to either "dhcp-failover-01.conf" or
> >> "dhcp-failover-02.conf". This works, but I have to manually create the
> >> symlink when we check out the repository.
> >>
> >> Not the end of the world, but it would be much smoother to say:
> >>
> >> include "dhcp-failover-${HOSTNAME}"
> >>
> >> So that the dhcpd.conf file automatically points to the correct
> >> failover config file.
> >>
> >> Is there any way to include a variable in an included path name? Or
> >> conditionally include a file?
> >>
> >> Thanks!
> >>
> >> Norman Elton
> >
> >
> > git has a ".gitignore" file where you can list files and directories to
> be
> > ignored.  Try listing the symlink file in .gitignore.
> >
> > Otherwise, I would just put the symlink somewhere outside the directories
> > controlled by git.
> >
> > --
> > Bob Harold
> >
> >
> > _______________________________________________
> > dhcp-users mailing list
> > dhcp-users at lists.isc.org
> > https://lists.isc.org/mailman/listinfo/dhcp-users
> _______________________________________________
> dhcp-users mailing list
> dhcp-users at lists.isc.org
> https://lists.isc.org/mailman/listinfo/dhcp-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.isc.org/pipermail/dhcp-users/attachments/20170807/bf1390e9/attachment.html>


More information about the dhcp-users mailing list