I'm using the authorized_key module to distribute ssh keys to my server, 
loading a key this way: 

> authorized_key: user=root key="{{ item }}"
with_file:
  - my_key.pub
 

the source key file contains an entry like:
from="hostname.domain,10.0.0.*" ssh-rsa AAAAB3NzaCBLAHBLAHBLAH...


but when it's written in the authorized_keys of the target host it appears 
in the form:
from=hostname.domain,10.0.0.* ssh-rsa AAAAB3NzaCBLAHBLAHBLAH...


The key written in the target misses the quotation marks and doesn't work 
as expected.

The problem seems to be located when  _load_params calls the shlex.split() 
function and removes the quotation marks:
MODULE_ARGS = 'user=root key="from="hostname.domain,10.0.0.*" ssh-rsa 
AAAAB3NzaCBLAHBLAHBLAH... "'

...

    def _load_params(self):
        ''' read the input and return a dictionary and the arguments string 
'''
        args = MODULE_ARGS
        *items   **= shlex.split(args)*


items now contains something like:

['user=root', 'key=from=hostname.domain,10.0.0.* ssh-rsa 
AAAAB3NzaCBLAHBLAHBLAH...

I don't know if I am doing something wrong or if it is some kind of bug

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/69d923f4-7aa6-48fc-8999-b075d0c966a8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to