Authorized_Key module not compatible with Python3?

I use the “authorized_key” module (https://docs.ansible.com/ansible/authorized_key_module.html), for adding SSH keys to the admins of our boxes.

Today I had to use one of my playbooks against a box that only has Python3. I learned about the “ansible_python_interpreter=/usr/bin/python3” variable I had to set, and my playbook worked through everything until I got to the “authorized_key” where it failed. I tried the same playbook against an Ubuntu box that still has Python2.7 and it worked fine. So it seems to be only the Python3.

Here is the task:

Here is the Error:

{
“changed”: false,
“failed”: true,
“module_stderr”: “Shared connection to collector.oitd.net closed.\r\n”,
“module_stdout”: “Traceback (most recent call last):\r\n File "/tmp/ansible__ftramx6/ansible_module_authorized_key.py", line 527, in \r\n main()\r\n File "/tmp/ansible__ftramx6/ansible_module_authorized_key.py", line 523, in main\r\n results = enforce_state(module, module.params)\r\n File "/tmp/ansible__ftramx6/ansible_module_authorized_key.py", line 433, in enforce_state\r\n key = [s for s in key.splitlines() if s and not s.startswith(‘#’)]\r\n File "/tmp/ansible__ftramx6/ansible_module_authorized_key.py", line 433, in \r\n key = [s for s in key.splitlines() if s and not s.startswith(‘#’)]\r\nTypeError: startswith first arg must be bytes or a tuple of bytes, not str\r\n”,
“msg”: “MODULE FAILURE”
}

Is this the place to mention this or can I be directed to the correct support channel/group?

Interesting, this or the ansible-dev list are both good places to bring this up. Can you share the exact version you are using and maybe some system package versions?

I’m running (ansible 2.2.1.0), how do I get the system package versions?

PS: I just opened this issue on the Ansible GitHub repo: https://github.com/ansible/ansible/issues/22984