# Ho to use different answers for the same questions?

**URL:** <https://forum.ansible.com/t/ho-to-use-different-answers-for-the-same-questions/27615>\
**Category:** Ansible Project\
**Created:** [May 24, 2018, 1:42pm UTC](https://forum.ansible.com/t/ho-to-use-different-answers-for-the-same-questions/27615 "2018-05-24T13:42:07Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![user78](https://avatars.discourse-cdn.com/v4/letter/u/74df32/32.png) [@user78](https://forum.ansible.com/u/user78)\
**Post date:** [May 24, 2018, 1:42pm UTC](https://forum.ansible.com/t/ho-to-use-different-answers-for-the-same-questions/27615/1 "2018-05-24T13:42:07Z")

</div>

Hello  
I use ansible 2.5.2

I have this responses section in my playbook:

_(?i)Login: “admin\n\r”_  
_(?i)Password: “admin\n\r”_  
_(?i)#: “password\n\r”_  
_(?i)Enter new password: “admin123\n\r”_  
_(?i)Confirm new password: “admin123\n\r”_  
_(?i)#: “logout\n\r”_

As you can see, I use two different answers with same question “#”.  
But it is not working:

> found a duplicate dict key ((?i)#).  
> Using last defined value only.

As I understood, you promise to add that functionality: [https://groups.google.com/forum/#!topic/ansible-project/850sYU11aO4](https://groups.google.com/forum/#!topic/ansible-project/850sYU11aO4)

Or I made a mistake with my playbook?

---

<div class="post-metadata">

**Author:** ![Kai\_Stian\_Olstad](https://avatars.discourse-cdn.com/v4/letter/k/e19adc/32.png) [@Kai\_Stian\_Olstad](https://forum.ansible.com/u/Kai_Stian_Olstad)\
**Post date:** [May 24, 2018, 1:48pm UTC](https://forum.ansible.com/t/ho-to-use-different-answers-for-the-same-questions/27615/2 "2018-05-24T13:48:40Z")

</div>

> I use ansible 2.5.2
> 
> I have this responses section in my playbook:
> 
> \* (?i)Login: "admin\n\r"\*  
> \* (?i)Password: "admin\n\r"\*  
> \* (?i)#: "password\n\r"\*  
> \* (?i)Enter new password: "admin123\n\r"\*  
> \* (?i)Confirm new password: "admin123\n\r"\*  
> \* (?i)#: "logout\n\r"\*
> 
> As you can see, I use two different answers with same question "#".  
> But it is not working:

But the answers as a list under the same question.

> found a duplicate dict key ((?i)#).
> 
> > Using last defined value only.
> 
> As I understood, you promise to add that  
> functionality:  
> [https://groups.google.com/forum/#!topic/ansible-project/850sYU11aO4](https://groups.google.com/forum/#!topic/ansible-project/850sYU11aO4)
> 
> Or I made a mistake with my playbook?

As the documentation say  
"If the response is a list, successive matches return successive responses. List functionality is new in 2.1."

&nbsp;&nbsp;&nbsp;(?i)#:  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;- "password\n\r"  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;- "logout\n\r"
