[英]Ansible: "unknown type long" when updating Private DNS Zone in Azure
I try to update serial number for a zone in Private DNS in Azure.我尝试更新 Azure 私有 DNS 中某个区域的序列号。 To do that, I run Ansible code:
为此,我运行 Ansible 代码:
- 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:但是 Ansible 因类型不匹配错误而失败:
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?错误消息有点令人困惑:我是否应该将其理解为 Ansible 尝试发送 2,而 Azure API 需要字符串,反之亦然,Azure 需要很长但 Ansible 发送字符串?
Which type conversion should I apply?我应该应用哪种类型转换?
Except above issue, is this proper way to update serial?除了上述问题,这是更新串行的正确方法吗?
I bypassed this by switching from azure_rm_dnsrecordset Ansible module to az call, replacing the template as below:我通过从 azure_rm_dnsrecordset Ansible 模块切换到 az 调用来绕过这个,替换模板如下:
- name: Increment DNS serial
command: >
az network private-dns record-set soa update
--resource-group "{{ my_rg }}"
--zone-name "{{ my_domain }}"
--serial-number "{{ new_serial }}"
This is accepted by Azure at least.这至少被 Azure 接受。
It does not update serial for me however.但是,它不会为我更新序列号。 I can update other SOA paramters like refresh time or minimum TTL, but not the serial number;
我可以更新其他 SOA 参数,例如刷新时间或最小 TTL,但不能更新序列号; but this is different issue.
但这是不同的问题。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.