fatal: [localhost]: FAILED! => {“msg”: "The task includes an option with an undefined variable. The error was: ‘dict object’ has no attribute ‘public_ip’. ‘dict object’ has no attribute ‘public_ip’
I’ve already searched the internet and read the Ansible manual, but so far I haven’t found any solution to this problem.
In addition to a debug task to see what keys are available, modules should document the return structure (assuming you’re registering the ec2 variable). If you’re using the ec2_instance module, for example the variable is documented here as public_ip_address, not public_ip.
Hello guys,
Sorry for delay in write post. First all I want to thank you, @shertel and @akira6592 to me help about this issue.
I got solved it I noticed that when I went to provisioning my AWS instance I forgot mentioned assign an IP public for it, then when I was running my playbook in that part “add_host” the IP address couldn’t find the IP to store the information, then error message occurred.