I am looking for method to set a variable in ansible playbook using
inventory information received from dynamic inventory.
For example if we have a sample playbook like
---
- hosts: localhost
connection: local
tasks:
- set_fact: rds_hostname="{{ rds_mysql }}" #set rds endpoint from
ec2.py
- debug: var=rds_hostname
I am able to get the endpoint when I run the plain ec2.py script as
> "rds_mysql":{
>> "rds_mysql.shdahfiahfa.us-easy-1.rds.amazon.com"
> }
However I wish to set rds_hostname as the endpoint recieved from
dynamic_inventory.
Can any one point out my mistake. Thank you
--
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/5ec626c4-f00e-48e8-ac47-256c0ea85d4b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.