[ale] Copying config files to DHCP peer

Bryan L. Gay ale at bryangay.com
Thu Dec 19 12:18:34 EST 2019


If it were me, I'd have users making the config changes in git, then
have a hook on the git side that pushes the new configs and handles
the restarts. This could be done with Jenkins.
Since we're talking about git, you can limit who is able to make these
merges through github, gitlab, etc. Full automation... without
Jenkins, you could poll the git server for changes.

To do it old school, what about setting up an inotify rule on the
config file to auto-reload the service on a config file change and
keep doing the rsync like you're doing now?

Your current method seems a bit too manual for my liking...

On Thu, Dec 19, 2019 at 11:58 AM Todor Fassl via Ale <ale at ale.org> wrote:
>
> I have been running peered ISC dhcp servers for years. The problem is
> that you need copies of the config files on both machines. Say you want
> to assign an IP address to a new machine. You add a stanza to a config
> file but then you then have to get a copy of the modified config file to
> the peer. If you forget to do that, you are going to screw things up
> pretty badly.
>
> Other people in my department occasionally need to make these config
> changes. So I need a way to guarantee that the config files get copied
> over. Googling showed me lots of articles on configuring a peer in
> isc-dhcp but only one on syncing the config files. That person was doing
> it via rsync and a script in cron.hourly.
>
> What I have done, at least for now, is to replace the init script with
> my own script. This script uses an ssh key to copy the files to the peer
> and then restarts dhcp on the peer. If somebody types "service dhcp
> restart", it runs my script. But now with systemd, it is going to be harder.
>
> Fortunately, for now, my co-workers are still typing "service bind9
> restart" and the like. So "service dhcp restart" is not a problem --
> yet. But if somebody types "systemctl restart isc-dhcp-server", it is
> not going to work.
>
>
> Its interesting that bind9 and slapd handle this under the covers.
>
>
> --
> Todd
> _______________________________________________
> Ale mailing list
> Ale at ale.org
> https://mail.ale.org/mailman/listinfo/ale
> See JOBS, ANNOUNCE and SCHOOLS lists at
> http://mail.ale.org/mailman/listinfo


More information about the Ale mailing list