# Multiple values for ansible connection properties

**URL:** <https://forum.ansible.com/t/multiple-values-for-ansible-connection-properties/34347>\
**Category:** Ansible Project\
**Tags:** rhel\
**Created:** [December 17, 2020, 12:29pm UTC](https://forum.ansible.com/t/multiple-values-for-ansible-connection-properties/34347 "2020-12-17T12:29:17Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ivan\_Labrovic](https://avatars.discourse-cdn.com/v4/letter/i/7cd45c/32.png) [@Ivan\_Labrovic](https://forum.ansible.com/u/Ivan_Labrovic)\
**Post date:** [December 17, 2020, 12:29pm UTC](https://forum.ansible.com/t/multiple-values-for-ansible-connection-properties/34347/1 "2020-12-17T12:29:17Z")

</div>

Has anyone heard of providing a second --user/–privatekey to ansible-playbook command, just in case the first user/privkey authentication fails?

Seem to remember something about this in an Ansible session on the RHEl summit last year.

regards,  
Ivan.

---

<div class="post-metadata">

**Author:** ![Ivan\_Labrovic](https://avatars.discourse-cdn.com/v4/letter/i/7cd45c/32.png) [@Ivan\_Labrovic](https://forum.ansible.com/u/Ivan_Labrovic)\
**Post date:** [December 17, 2020, 12:44pm UTC](https://forum.ansible.com/t/multiple-values-for-ansible-connection-properties/34347/2 "2020-12-17T12:44:42Z")

</div>

some background on why I could use this is: configuring systems pre-deployed on different cloud providers, on one if need to start with ‘root’ to create the ansible user, on the other i dont have root, but it’s ‘localadmin’)

Now i have build a script around ansible-playbook, to determine on which provides i will be deploying.  
If i could pass both, i would not need this script construction. From ansible perspecitiv, i should not need to care, where my vm is residing…

ivan.

---

<div class="post-metadata">

**Author:** ![racke](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/racke/32/4767_2.png) [@racke](https://forum.ansible.com/u/racke)\
**Post date:** [December 17, 2020, 12:50pm UTC](https://forum.ansible.com/t/multiple-values-for-ansible-connection-properties/34347/3 "2020-12-17T12:50:19Z")

</div>

> some background on why I could use this is: configuring systems pre-deployed on different cloud providers, on one if  
> need to start with 'root' to create the ansible user, on the other i dont have root, but it's 'localadmin')  
> Now i have build a script around ansible-playbook, to determine on which provides i will be deploying.  
> If i could pass both, i would not need this script construction. From ansible perspecitiv, i should not need to care,  
> where my vm is residing...

Why don't you put this information into group\_vars/host\_vars in your inventory?

Regards  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Racke

---

<div class="post-metadata">

**Author:** ![Ivan\_Labrovic](https://avatars.discourse-cdn.com/v4/letter/i/7cd45c/32.png) [@Ivan\_Labrovic](https://forum.ansible.com/u/Ivan_Labrovic)\
**Post date:** [December 17, 2020, 1:01pm UTC](https://forum.ansible.com/t/multiple-values-for-ansible-connection-properties/34347/4 "2020-12-17T13:01:12Z")

</div>

Thanks Racke,

yes i thought about this. This would require me to split the hosts in multiple groups (lets say: grp\_VMWare, grp\_MSAzure, grp\_OracleCloud etc)  
And that would require some more administration,

Thanks for the tip, this will keep me thinking some more about this suggestion, while waiting for other solutions.

Thanks!  
Ivan.

---

<div class="post-metadata">

**Author:** ![Rene\_Paquin](https://avatars.discourse-cdn.com/v4/letter/r/e9a140/32.png) [@Rene\_Paquin](https://forum.ansible.com/u/Rene_Paquin)\
**Post date:** [December 17, 2020, 1:23pm UTC](https://forum.ansible.com/t/multiple-values-for-ansible-connection-properties/34347/5 "2020-12-17T13:23:13Z")

</div>

Thank you for the response. However, I have tried with quotes, without quotes, encrypted, decrypted, hashed, unhashed, it just does not seem to work.

Rene
