---
- name: Playbook to manage DNS records.
  hosts: ipaserver
  become: true
  gather_facts: false

  tasks:
  - name: Ensure an MX record is present
    ipadnsrecord:
      ipaadmin_password: SomeADMINpassword
      name: '@'
      record_type: 'MX'
      record_value: '1 mailserver.example.com'
      zone_name: example.com
      state: present
