Conditional File Include

Norman Elton normelton at gmail.com
Mon Aug 7 13:53:22 UTC 2017


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


More information about the dhcp-users mailing list