I try to update serial number for a zone in Private DNS in Azure. To do that, I run Ansible code:
- name: Increment DNS serial
azure_rm_dnsrecordset:
resource_group: "{{ my_rg }}"
zone_name: "{{ my_domain }}"
relative_name: "@"
record_type: "SOA"
records:
- serial_number: "{{ new_serial }}"
register: dns_update
until: dns_update is succeeded
Ansible however fails with type mismatch error:
The full traceback is:
fatal: [localhost]: FAILED! => {
"changed": false,
"invocation": {
"module_args": {
...
"record_mode": "purge",
"record_type": "SOA",
"records": [
{
"serial_number": "2"
}
],
"relative_name": "@",
"resource_group": "my-rg",
"state": "present",
...
}
},
"msg": "implementation error: unknown type long requested for serial_number"
}
The error message is a bit confusing: should I understand it as Ansible trying to send 2 as long while Azure API expects string, or vice versa, Azure expects long but Ansible sends string?
Which type conversion should I apply?
Except above issue, is this proper way to update serial?