Manage a DNS (dnsmasq) server in Foreman

Oye there,

I'm managing a DNS server (using dnsmasq) via Puppet in Foreman.

Currently, I've got one parameter called host_definitions which is the
content of my /etc/hosts file, e.g:

10.0.0.1 my-serv-a.domain
10.0.0.2 my-serv-b.domain
10.0.0.3 my-serv-c.domain

One of my colleague would like to put the content of that file directly in
the puppet module, but I don't think we should update a Puppet module when
updating the DNS configuration.

Managing the content of a file (300+ entries) in a Foreman parameter is
kindof ugly. Is there any alternative? Does anyone has stumbled upon this
use case or any similar?

Regards,

One option that might work in your case is to have all these entries listed
in a text file in the puppetmaster server and have puppet update the hosts
with the values listed in that file.

We use something similar for the motd file (Message of the Day - when you
log into the computer)

The puppet module should be something similar to this:

/etc/puppet/environments/production/modules/dns/manifests/dnsentries.pp
class dns::dnsentries() {
file {'/etc/hosts':
ensure => present,
source => 'puppet:///modules/dns/listofips.txt',
}
}

and then a file with the IPs listed there:

/etc/puppet/environments/production/modules/dns/files/listofips.txt
10.0.0.1 my-serv-a.domain
10.0.0.2 my-serv-b.domain
10.0.0.3 my-serv-c.domain

IB

··· On Wednesday, October 15, 2014 9:43:57 AM UTC-4, Anthony Lapenna wrote: > > Oye there, > > I'm managing a DNS server (using dnsmasq) via Puppet in Foreman. > > Currently, I've got one parameter called host_definitions which is the > content of my /etc/hosts file, e.g: > > 10.0.0.1 my-serv-a.domain > 10.0.0.2 my-serv-b.domain > 10.0.0.3 my-serv-c.domain > ... > > One of my colleague would like to put the content of that file directly in > the puppet module, but I don't think we should update a Puppet module when > updating the DNS configuration. > > Managing the content of a file (300+ entries) in a Foreman parameter is > kindof ugly. Is there any alternative? Does anyone has stumbled upon this > use case or any similar? > > Regards, > > > >

Just for the record, foreman does support dnsmasq via libvirt (virsh
command). It has limited capabilities and this is not recommended for
production.

http://theforeman.org/manuals/1.6/#4.3.12Libvirt

LZ

··· On Wed, Oct 15, 2014 at 06:43:57AM -0700, Anthony Lapenna wrote: > Oye there, > > I'm managing a DNS server (using dnsmasq) via Puppet in Foreman. > > Currently, I've got one parameter called host_definitions which is the > content of my /etc/hosts file, e.g: > > 10.0.0.1 my-serv-a.domain > 10.0.0.2 my-serv-b.domain > 10.0.0.3 my-serv-c.domain > ... > > One of my colleague would like to put the content of that file directly in > the puppet module, but I don't think we should update a Puppet module when > updating the DNS configuration. > > Managing the content of a file (300+ entries) in a Foreman parameter is > kindof ugly. Is there any alternative? Does anyone has stumbled upon this > use case or any similar? > > Regards, > > > > -- > You received this message because you are subscribed to the Google Groups "Foreman users" group. > To unsubscribe from this group and stop receiving emails from it, send an email to foreman-users+unsubscribe@googlegroups.com. > To post to this group, send email to foreman-users@googlegroups.com. > Visit this group at http://groups.google.com/group/foreman-users. > For more options, visit https://groups.google.com/d/optout.


Later,
Lukas #lzap Zapletal