I have some code to create A Record and PTR Record on DNS Server via Ansible as follows:
# ipaddress, hostname, and domain are necessary --- - hosts: brc.testlab.