On Tue, May 17, 2022 at 1:14 PM Geert Stappers via Dnsmasq-discuss
<dnsmasq-discuss@lists.thekelleys.org.uk> wrote:
>
> On Tue, May 17, 2022 at 03:26:44AM -0500, Carl Karsten wrote:
> > On Tue, May 17, 2022 at 2:55 AM <wkitt...@gmail.com> wrote:
> > >
> > > On 5/16/22 5:46 PM, Carl Karsten wrote:
> > > > I know of a few ways of doing this, but they all involve generating 10
> > > > lines of .conf file.  I have no problem creating a little csv and
> > > > writing about 10 lines of python to generate the file.   But anything
> > > > that involves "generate" seems clunky.     I am hoping dnsmasq has a
> > > > provision for what I am doing.
> > >
> > > can't you create the .conf one time and leave it be for inclusion with 
> > > the other
> > > dnsmasq conf files? maybe i'm not understanding? is there some sort of 
> > > dynamic
> > > nature you've not mentioned?
> > >
> >
> > Yes I could, this is what I mean by generate the file.  I am trying to
> > avoid that.
> > If I have to swap out a machine, then I get a new mac, and I have to
> > update the file.
> > And this pattern comes up fairly often: I want a machine to have a
> > defined IP, and I would like the dhcp server to be the source of truth
> > defining what machines get what IPs.
> >
> > I generally maintain a list of mac/IP/hostname, likely in a
> > spreadsheet.
>
> It is 2020 there are tools like Ansible.
>
> I'm suggesting to maintain the mac/IP/hostname combos in YAML.
>
>
> > or maybe a text file checked into version control.  If
> > dnsmasq could read this file, it would save steps and less chance of
> > my file and the server's file being out of sync.
> >
> > I am creating a little cluster thing and documenting how to build it.
> > If dnsmasq has a simple way of doing something, it will make my docs
> > of the process easier.
>
> https://en.wikipedia.org/wiki/Ansible_(software)
>

If dnsmasq has a simple way of doing something, it will make my
ansible playbook easier to read.  ;)

I found this, it looks fairly well thought out, any comments?

dhcp-host={{ item['mac_address']|join(',') }}{% if item['name'] is
defined %},{{ item['name'] }}{% endif %}{% if item['address'] is
defined %},{{ item['address'] }}{% endif %}{% if item['lease_time'] is
defined %},{{ item['lease_time'] }}{% endif %}

https://github.com/mrlesmithjr/ansible-dnsmasq/blob/master/templates/etc/dnsmasq.conf.j2#L69
https://github.com/mrlesmithjr/ansible-dnsmasq/blob/master/defaults/main.yml#L32-L40

I don't need (and really I'm having trouble understanding) "Multiple
MAC addresses may be assigned"   but if it works I don't mind relying
on something created by someone who is an expert.  I don't want to
make something new and improved given I don't spend much time with
dnsmasq


>
> > Carl K
>
> Groeten
> Geert Stappers
> --
> Silence is hard to parse
>
> _______________________________________________
> Dnsmasq-discuss mailing list
> Dnsmasq-discuss@lists.thekelleys.org.uk
> https://lists.thekelleys.org.uk/cgi-bin/mailman/listinfo/dnsmasq-discuss



-- 
Carl K

_______________________________________________
Dnsmasq-discuss mailing list
Dnsmasq-discuss@lists.thekelleys.org.uk
https://lists.thekelleys.org.uk/cgi-bin/mailman/listinfo/dnsmasq-discuss

Reply via email to