Send dhcp-users mailing list submissions to
        dhcp-users@lists.isc.org

To subscribe or unsubscribe via the World Wide Web, visit
        https://lists.isc.org/mailman/listinfo/dhcp-users
or, via email, send a message with subject or body 'help' to
        dhcp-users-requ...@lists.isc.org

You can reach the person managing the list at
        dhcp-users-ow...@lists.isc.org

When replying, please edit your Subject line so it is more specific
than "Re: Contents of dhcp-users digest..."


Today's Topics:

   1. Conditional File Include (Norman Elton)
   2. Re: Conditional File Include (Bob Harold)
   3. Re: Conditional File Include (Norman Elton)
   4. Re: Conditional File Include (Matthew Kassawara)
   5. Re: Conditional File Include (Eugene Grosbein)
   6. Re: Conditional File Include (Simon Hobson)


----------------------------------------------------------------------

Message: 1
Date: Mon, 7 Aug 2017 08:34:19 -0400
From: Norman Elton <normel...@gmail.com>
To: Users of ISC DHCP <dhcp-users@lists.isc.org>
Subject: Conditional File Include
Message-ID:
        <capcnwuf6wcjgz9_q0btfvz4kkkj-+0mkpsxzvjjdusofekk...@mail.gmail.com>
Content-Type: text/plain; charset="UTF-8"

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


------------------------------

Message: 2
Date: Mon, 7 Aug 2017 09:36:20 -0400
From: Bob Harold <rharo...@umich.edu>
To: Users of ISC DHCP <dhcp-users@lists.isc.org>
Subject: Re: Conditional File Include
Message-ID:
        <ca+nkc8cmu2qyg9xdexxnd0kuvt+yor3ckwr3+odcyf7gxu2...@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"

On Mon, Aug 7, 2017 at 8:34 AM, Norman Elton <normel...@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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
<https://lists.isc.org/pipermail/dhcp-users/attachments/20170807/bfa630d0/attachment-0001.html>

------------------------------

Message: 3
Date: Mon, 7 Aug 2017 09:53:22 -0400
From: Norman Elton <normel...@gmail.com>
To: Users of ISC DHCP <dhcp-users@lists.isc.org>
Subject: Re: Conditional File Include
Message-ID:
        <capcnwuehruofli7u8djacraq6dbumkeee9htwja27kc5iyf...@mail.gmail.com>
Content-Type: text/plain; charset="UTF-8"

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 <rharo...@umich.edu> wrote:
>
> On Mon, Aug 7, 2017 at 8:34 AM, Norman Elton <normel...@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@lists.isc.org
> https://lists.isc.org/mailman/listinfo/dhcp-users


------------------------------

Message: 4
Date: Mon, 7 Aug 2017 08:51:00 -0600
From: Matthew Kassawara <matthew.kassaw...@blinker.com>
To: Users of ISC DHCP <dhcp-users@lists.isc.org>
Subject: Re: Conditional File Include
Message-ID:
        <canpqwzkxz8oyagszxnrmmhuboqms7mxkdtfvik+zuk1x87f...@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"

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 <normel...@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 <rharo...@umich.edu> wrote:
> >
> > On Mon, Aug 7, 2017 at 8:34 AM, Norman Elton <normel...@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@lists.isc.org
> > https://lists.isc.org/mailman/listinfo/dhcp-users
> _______________________________________________
> dhcp-users mailing list
> dhcp-users@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-0001.html>

------------------------------

Message: 5
Date: Mon, 7 Aug 2017 23:10:31 +0700
From: Eugene Grosbein <eu...@grosbein.net>
To: Users of ISC DHCP <dhcp-users@lists.isc.org>
Subject: Re: Conditional File Include
Message-ID: <598890f7.3030...@grosbein.net>
Content-Type: text/plain; charset=windows-1252

07.08.2017 19:34, Norman Elton 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.

Why do you include different contents to main dhcpd.conf?

Just put all identical configuration to single included file
and include it to two distinct dhcpd.conf's each having own "failover peer"
statements and, perhaps, something other like "subnet".

And make your DHCP servers use such distinct dhcpd.conf's
Nothing makes you always use "dhcpd.conf", you may use any name
and just run the daemon with corresponding "-cf config-file" flag.



------------------------------

Message: 6
Date: Mon, 7 Aug 2017 21:23:51 +0100
From: Simon Hobson <dh...@thehobsons.co.uk>
To: Users of ISC DHCP <dhcp-users@lists.isc.org>
Subject: Re: Conditional File Include
Message-ID: <1d2d962a-1b77-4599-9a12-20599f33d...@thehobsons.co.uk>
Content-Type: text/plain; charset=us-ascii

Eugene Grosbein <eu...@grosbein.net> wrote:

> Just put all identical configuration to single included file
> and include it to two distinct dhcpd.conf's each having own "failover peer"
> statements and, perhaps, something other like "subnet".

I suspect the reason is that it moves some of the config outside of the 
management process. While it works, it means that the config is now split in 3 
places - while the aim was to keep it in one place (with tracking of changes 
etc).



------------------------------

Subject: Digest Footer

_______________________________________________
dhcp-users mailing list
dhcp-users@lists.isc.org
https://lists.isc.org/mailman/listinfo/dhcp-users

------------------------------

End of dhcp-users Digest, Vol 106, Issue 4
******************************************

Reply via email to