I've an Ansible role that sets up Postfix transport maps. It's configured like this:
roles/mail-server/vars/defaults.yml
# maps domain -> primary mail server hostname/IP
# e.g. backup_mx_for: { example.com: mail.example.com }
backup_mx_for: {}
# same as above, only without a blanket accept rule