Managing Bind DNS zone files

I’ve just finished creating a system to manage my dns zone files with ansible and I was hoping I could get some feedback on how I handled it. My solution feels unelegant, so I’m curious how other folks would (or do) handle this.

I’ve attached a copy of my playbook, a plugin and some example, made-up, data yaml files.

My biggest challenge was dealing with dynamically generated data. EG the reverse dns zone for the 192.168.0/24 subnet is 0.168.192.in-addr.arpa and I found that difficult to handle (in that case I just did it manually and stuck it in the yaml data files).

Anyway, I’d love to know how other folks handle things like this. How much do you do in a playbook? How much do you handle with plugins? Should I have skipped playbooks altogether and written an ansible runner subclass? Should I have gone the other direction and done something to automate the population of my playbook and/or yaml data files?

Thanks for any feedback.

And big thanks for ansible!

-Dylan

(attachments)

update_dns.tar.gz (5.24 KB)

Small request – please don’t share tarballs with the list. We have to download them, extract them, then look through them.

It’s much better if you can to upload a repo to github.

That all being said, I don’t think managing them with Ansible makes a whole lot of sense – but Cobbler is actually pretty darn good at generating BIND configurations.

–Michael

Ah, sorry about the tarball. I’ll use github in the future.

Hmmm… That’s interesting. I’ve been trying to do basically everything with ansible. It sounds like my idea of what ansible is for is different. Your answer was strangely useful. Thanks!

-Dylan

Just the idea that it’s more of a function of pre-OS configuration, where you want to maintain a list of things.

You could definitely maintain the list of hosts in Ansible, but it’s more general purpose to where I think that would be done in a database that might feed Ansible (as an inventory source).

–Michael