authorized_key not working on the latest devel

Hi,

In ansible 1.4 (devel 4f13967386) last updated 2013/10/22 13:48:49 (GMT +000) the bellow tasks has stopped working :

``1

  • name: Deploying user(s) ssh key(s)
    authorized_key: user=${item.user} key=“{{ lookup(‘file’, ‘public-keys/’ + item.user + ‘.pub’) }}”
    with_items: ssh_users
    tags:
  • copy
  • credentials

Output

TASK: [common | Deploying user(s) ssh key(s)] *********************************
<ss2.xyz.net> ESTABLISH CONNECTION FOR USER: root on PORT 22 TO ss2.xyz.net
<ss2.xyz.net> EXEC /bin/sh -c ‘mkdir -p $HOME/.ansible/tmp/ansible-1382449993.6-110248301379805 && echo $HOME/.ansible/tmp/ansible-1382449993.6-110248301379805’
<ss2.xyz.net> REMOTE_MODULE authorized_key user=nicolasg key=“{{lookup(‘file’, ‘public-keys/’ + item.user + ‘.pub’)}}”
<ss2.xyz.net> PUT /tmp/tmpv_7zAk TO /root/.ansible/tmp/ansible-1382449993.6-110248301379805/authorized_key
<ss2.xyz.net> EXEC /bin/sh -c ‘sudo -k && sudo -H -S -p “[sudo via ansible, key=ymbyzjxzulvzioocwmdircnvbjjasnxt] password: " -u root /bin/sh -c '”’“‘/usr/bin/python /root/.ansible/tmp/ansible-1382449993.6-110248301379805/authorized_key; rm -rf /root/.ansible/tmp/ansible-1382449993.6-110248301379805/ >/dev/null 2>&1’”‘"’’
failed: [ss2.xyz.net] => (item={‘user’: ‘nicolasg’}) => {“failed”: true, “item”: {“user”: “nicolasg”}}
msg: invalid key specified: {{lookup(‘file’, ‘public-keys/’ + item.user + ‘.pub’)}}


Have something changed regarding the authorized_key module ? it works ok if I run version 1.3.3 .

Hi, we’re aware and there’s a ticket for this.

The problem is not with authorized_key in this case just that we need to repair lookup plugin operation.

AnsibleFest is today so it may be a while.

Stay tuned or use a production release.

Good luck with AnsibleFest then :wink: