Hi,
I am writing a route53 module for internal usage. For that, I want to list the alias records from route53.
`
- name: retrieve details for lb.example.io
strategy: debug
hosts: localhost
tasks:- route53:
state: get
zone: example.io
record: lb.example.io
type: A
register: rec- name: Print record
debug:
var: rec`
This is the run output
`
PLAY [retrieve details for lb.example.io] ******************************************************************************
TASK [Gathering Facts] ***********************************************************************************************
ok: [localhost]
TASK [route53] *******************************************************************************************************
ok: [localhost]
TASK [Print record] **************************************************************************************************
ok: [localhost] => {
“rec”: {
“changed”: false,
“failed”: false,
“nameservers”: [
“ns-464.awsdns-58.com.”,
“ns-1140.awsdns-14.org.”,
“ns-1893.awsdns-44.co.uk.”,
“ns-691.awsdns-22.net.”
],
“set”: {}
}
}
PLAY RECAP ***********************************************************************************************************
localhost
`
When I list the record using AWS CLI, I get the following answer
`
aws route53 list-resource-record-sets --hosted-zone-id *********** --query “ResourceRecordSets[?Name == ‘lb.example.io.’]” |jq ..AliasTarget.DNSName
“m1.example.io.”
“m2.example.io.”
“m3.example.io.”
“m4.example.io.”
“m5.example.io.”
“m6.example.io.”
“m7.example.io.”
`
I am following route53 core module. My ansible version is
`
ansible --version
ansible 2.4.1.0
`
Please suggest if I am missing something here.
thanks