Please note these are just examples and ideas on how you can automate DNS Configurations in your environment. You need to have some understanding of ansible before you can start tweaking and playing with the examples. There could be thousands of variations of these, but these examples will help you atleast set a base.
DNS Server Configuration using Ansible.
Ansible role for Server Side Configuration.
Ansible playbook for dns Client Side Configuration.