A variable does not disappear after being used in an item loop, so I
suspect you aren't referring to the variable correctly in the second task.
Please post an example playbook and the full -vvvv output with the error.
On Tuesday, April 25, 2017 at 2:55:27 PM UTC-4, balubhai555 wrote:
>
> Hello team,
>
> I want to
>
> 1. Create AWS ec2 instance using one "*with_items: ec2"*
> 2. After that I want to insert the IP address of those instances into
> */etc/ansible/hosts* file. For that I am using *local_action:
> lineinfile . *But after that I want to use again with_items:
> "{{ec2.instances}}"
>
>
> At that time it shows error, That Item is undefined.
>
> Are we use those with_items twice in a playbook. Any example please
> suggest me.
>
> Thank you in advance.
>
>
--
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/7f893eb7-cfcc-4f70-abf3-e0238d4b7a12%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.