Hi all,

I'm trying to set up ansible.posix.authorized_key
<https://docs.ansible.com/ansible/latest/collections/ansible/posix/authorized_key_module.html#examples>
on my playbook, which look like this:
- name: Set authorized key for Carol
ansible.posix.authorized_key:
user: carol
state: present
key: "{{ lookup('file', 'ssh-keys/carol') }}"

When executing the playbook (*ansible-playbook -i inventory main.yml*), I
get the following message:
TASK [Set authorized key for Carol]
********************************************************************************************************************************************************************************
An exception occurred during task execution. To see the full traceback, use
-vvv. The error was: SyntaxError: invalid syntax
fatal: [nzprodapp]: FAILED! => {"ansible_facts":
{"discovered_interpreter_python": "/usr/bin/python"}, "changed": false,
"module_stderr": "Shared connection to 192.168.199.3 closed.\r\n",
"module_stdout": "Traceback (most recent call last):\r\n  File
\"/home/lucas/.ansible/tmp/ansible-tmp-1608521692.1705554-90163-205930135785049/AnsiballZ_authorized_key.py\",
line 102, in <module>\r\n    _ansiballz_main()\r\n  File
\"/home/lucas/.ansible/tmp/ansible-tmp-1608521692.1705554-90163-205930135785049/AnsiballZ_authorized_key.py\",
line 94, in _ansiballz_main\r\n    invoke_module(zipped_mod, temp_path,
ANSIBALLZ_PARAMS)\r\n  File
\"/home/lucas/.ansible/tmp/ansible-tmp-1608521692.1705554-90163-205930135785049/AnsiballZ_authorized_key.py\",
line 40, in invoke_module\r\n
 
runpy.run_module(mod_name='ansible_collections.ansible.posix.plugins.modules.authorized_key',
init_globals=None, run_name='__main__', alter_sys=True)\r\n  File
\"/usr/lib64/python2.6/runpy.py\", line 136, in run_module\r\n    fname,
loader, pkg_name)\r\n  File \"/usr/lib64/python2.6/runpy.py\", line 54, in
_run_module_code\r\n    mod_loader, pkg_name)\r\n  File
\"/usr/lib64/python2.6/runpy.py\", line 34, in _run_code\r\n    exec code
in run_globals\r\n  File
\"/tmp/ansible_ansible.posix.authorized_key_payload_fuOpH9/ansible_ansible.posix.authorized_key_payload.zip/ansible_collections/ansible/posix/plugins/modules/authorized_key.py\",
line 216, in <module>\r\n  File
\"/tmp/ansible_ansible.posix.authorized_key_payload_fuOpH9/ansible_ansible.posix.authorized_key_payload.zip/ansible/module_utils/urls.py\",
line 115, in <module>\r\n  File
\"/usr/lib/python2.6/site-packages/urllib3/__init__.py\", line 7, in
<module>\r\n    from .connectionpool import HTTPConnectionPool,
HTTPSConnectionPool, connection_from_url\r\n  File
\"/usr/lib/python2.6/site-packages/urllib3/connectionpool.py\", line
105\r\n    _blocking_errnos = {errno.EAGAIN, errno.EWOULDBLOCK}\r\n
                           ^\r\nSyntaxError: invalid syntax\r\n", "msg":
"MODULE FAILURE\nSee stdout/stderr for the exact error", "rc": 1}

I don't know what could be the problem here, as my syntax looks identical
to the documentation. Could someone please advise?

Thanks and merry xmas! :)
Lucas

-- 
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-project+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CAE_gQfVkUHwCsZY7gKno19fW1ciNBua_PBtvJVR3xrg%2BirYscA%40mail.gmail.com.

Reply via email to