# Problem with key\_options

**URL:** <https://forum.ansible.com/t/problem-with-key-options/14252>\
**Category:** Ansible Project\
**Created:** [January 2, 2014, 2:30pm UTC](https://forum.ansible.com/t/problem-with-key-options/14252 "2014-01-02T14:30:06Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jurgen\_Haas2](https://avatars.discourse-cdn.com/v4/letter/j/f0a364/32.png) [@Jurgen\_Haas2](https://forum.ansible.com/u/Jurgen_Haas2)\
**Post date:** [January 2, 2014, 2:30pm UTC](https://forum.ansible.com/t/problem-with-key-options/14252/1 "2014-01-02T14:30:06Z")

</div>

Looks like Ansible 1.4.x behaves different form earlier versions with key\_options in the module authorized\_key. The following task resulted in a proper line in the authorized\_keys file but does no longer (tested with 1.4.1 and 1.4.3):

- name: ‘Subversion | Install SSH user public keys’  
authorized\_key: user=sshsvn  
key=“{{lookup(‘file’, inventory\_dir + ‘/files/certs/’ + item + ‘.svn.pub’)}}”  
key\_options=‘command=“/usr/local/bin/svnserve -t --tunnel-user={{item}}”,no-port-forwarding,no-agent-forwarding,no-X11-forwarding,no-pty’  
with\_items: svn\_user

What happens now is that they key is written to the authorized\_keys file but not the leading options anymore. Is this a bug?

---

<div class="post-metadata">

**Author:** ![tannerjc](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/tannerjc/32/985_2.png) [@tannerjc](https://forum.ansible.com/u/tannerjc)\
**Post date:** [January 2, 2014, 8:10pm UTC](https://forum.ansible.com/t/problem-with-key-options/14252/2 "2014-01-02T20:10:46Z")

</div>

Please retest against devel/HEAD. There have been a few refactors of authorized\_key since the 1.4.x releases.

---

<div class="post-metadata">

**Author:** ![Jurgen\_Haas2](https://avatars.discourse-cdn.com/v4/letter/j/f0a364/32.png) [@Jurgen\_Haas2](https://forum.ansible.com/u/Jurgen_Haas2)\
**Post date:** [January 3, 2014, 8:24am UTC](https://forum.ansible.com/t/problem-with-key-options/14252/3 "2014-01-03T08:24:23Z")

</div>

Just tried the latest dev release with the exact same result. So it still doesn’t seem to be working.

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan2](https://avatars.discourse-cdn.com/v4/letter/m/da6949/32.png) [@Michael\_DeHaan2](https://forum.ansible.com/u/Michael_DeHaan2)\
**Post date:** [January 3, 2014, 12:58pm UTC](https://forum.ansible.com/t/problem-with-key-options/14252/4 "2014-01-03T12:58:04Z")

</div>

Please make sure there’s a github ticket that includes steps to reproduce.

This may require sharing a sanitized version of your authorized key file as well as what keys you are adding, or steps from your playbook.

---

<div class="post-metadata">

**Author:** ![Jurgen\_Haas2](https://avatars.discourse-cdn.com/v4/letter/j/f0a364/32.png) [@Jurgen\_Haas2](https://forum.ansible.com/u/Jurgen_Haas2)\
**Post date:** [January 3, 2014, 1:09pm UTC](https://forum.ansible.com/t/problem-with-key-options/14252/5 "2014-01-03T13:09:50Z")

</div>

Github Ticket filed: [https://github.com/ansible/ansible/issues/5486](https://github.com/ansible/ansible/issues/5486)
