Rather than register the facts and write to a file, you can use a custom
lookup to query the endpoint based on the instance name. Then you can put
the following in your template file:
{{ lookup('aws_rds_endpoint_port_from_instance_name', (region,
database_instance )) }}
where region is a variable containing the region you use and
database_instance is the name.
I've written some additional lookups, including one to get the endpoint of
an RDS instance based on name
here: https://github.com/jonhadfield/ansible-lookups
I'm also putting together a guide (nearly finished) that includes their use
here: http://lessknown.info.
--
You received this message because you are subscribed to the Google Groups
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/237cb674-5f4e-4680-b4bf-ccb5f59b9946%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.