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
--To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/b810b7ea-e534-479f-94f3-33e76d3680ed%40googlegroups.com.
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 ansible-proje...@googlegroups.com.
To post to this group, send email to ansible...@googlegroups.com.