- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
Ansible loop through variable list and lookup CNAME records
[ Edited ]- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-19-2022 08:12 AM - edited 09-20-2022 10:23 AM
Trying to loop over the CNAME records and use the canonical name to lookup the A records. The lookup for the CNAME is working great but when the Get A Record by Canonical task runs it is only picking up a single canonical name when the results of the CNAME lookup is presenting two. This is an issue with the loop I understand but I can't seem to fix the issue. I'm currently testing with two FQDN and this is the output from the CNAME lookup. Right now I'm only getting the last entry from FQDN.
{
"changed": false,
"ansible_facts": {
"record_fqdn": [
{
"_ref": "record:cname/ZG5zLmJpbmRfY25hbWUkLjIxLmNvbS5ia2ljb25uZWN0LmNoYXNlZW1wb3dlcmxlbmRpbmc:test.com/Acme",
"canonical": "test.com"
}
]
},
{
"changed": false,
"ansible_facts": {
"record_fqdn": [
{
"_ref": "record:cname/ZG5zLmJpbmRfY25hbWUkLjIxLmNvbS5ia2ljb25uZWN0LmVtcG93ZXJsb3M:test1.com/Acme",
"canonical": "TEST1.COM"
}
]
},
This my lookup tasks: