# Per-environment SSH keys

**URL:** <https://forum.ansible.com/t/per-environment-ssh-keys/14613>\
**Category:** Ansible Project\
**Created:** [February 20, 2014, 11:18pm UTC](https://forum.ansible.com/t/per-environment-ssh-keys/14613 "2014-02-20T23:18:59Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nick\_Doyle](https://avatars.discourse-cdn.com/v4/letter/n/9fc348/32.png) [@Nick\_Doyle](https://forum.ansible.com/u/Nick_Doyle)\
**Post date:** [February 20, 2014, 11:18pm UTC](https://forum.ansible.com/t/per-environment-ssh-keys/14613/1 "2014-02-20T23:18:59Z")

</div>

The use case is 3 devs, 3 environments (dev/staging/prod)  
Adding ssh keys to the deployment user’s authorized\_keys, in each environment.  
In Dev, add all, in Staging just 2, and in Production just 1.

This is not the first time I’ve wished YAML inventory were still possible =)  
(I get the reasons though, fair enough)

Does anybody have recommendations?  
Perhaps make complete files e.g. ‘authorized\_keys\_dev’ , ‘authorized\_keys\_staging’

and specify which to use in the inventory?

---

<div class="post-metadata">

**Author:** ![Brian\_Coca1](https://avatars.discourse-cdn.com/v4/letter/b/278dde/32.png) [@Brian\_Coca1](https://forum.ansible.com/u/Brian_Coca1)\
**Post date:** [February 21, 2014, 1:41pm UTC](https://forum.ansible.com/t/per-environment-ssh-keys/14613/2 "2014-02-21T13:41:45Z")

</div>

i use a include\_vars: {{env}}\_userlist.yml

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan1](https://avatars.discourse-cdn.com/v4/letter/m/5e9695/32.png) [@Michael\_DeHaan1](https://forum.ansible.com/u/Michael_DeHaan1)\
**Post date:** [February 21, 2014, 1:48pm UTC](https://forum.ansible.com/t/per-environment-ssh-keys/14613/3 "2014-02-21T13:48:04Z")

</div>

So FYI, group\_vars/ and host\_vars/ directory still allows keeping structured data in inventory.

You can keep your environment as a group if you like.
