ansible-collections / ansible.posix

Ansible Collection for Posix
Other
157 stars 152 forks source link

Adding public key via playbook only succeeds, when the path is set - even if its the default in the userprofile/ Root/.ssh/authorized_keys #532

Open gsg-git opened 7 months ago

gsg-git commented 7 months ago

Please confirm the following

Bug Summary

My playbook gets marked as successfully executed, but there are no entrys in any authorized_keys files. After trying to set a custom path where the content of the public key gets added the playbook did add the line in the custom path. Then i tried my (default?) path at /root/.ssh/authorized_keys and the key got added there too. I got requested to report the bug from the Ansible forum: https://forum.ansible.com/t/default-code-to-add-public-ssh-key-fails/3702/34

AWX version

AWX 23.6.0

Select the relevant components

Installation method

kubernetes

Modifications

no

Ansible version

No response

Operating system

Ubuntu server 22

Web browser

No response

Steps to reproduce

`---

Expected results

Adding the ssh key at the default location without further config

Actual results

i have to add the path even the default ones.

Additional information

Links for the successfull job log: https://github.com/gsg-git/awx_pub/blob/main/job_237.txt link for the false positive log where nothing gets entered: https://github.com/gsg-git/awx_pub/blob/main/job_263-falsepositive.txt

gsg-git commented 7 months ago

I have been told to open the issue here from the regular AWX Git: https://github.com/ansible/awx/issues/14883

s-hertel commented 6 months ago

This is where I asked you to file the issue originally. But, as we previously discussed, your claim is not reproducible (so it's probably a mistake on your end testing, rather than a bug in the module). From https://forum.ansible.com/t/default-code-to-add-public-ssh-key-fails/3702/37:

If you open an issue at Issues · ansible-collections/ansible.posix · GitHub 1 please be sure to include a simple generic reproducer, the full output with -vvv, and the commands you’re running that prove the module didn’t do what it claimed. I wasn’t able to reproduce the issue.

What commands are you running that make you think it's a false positive? From tracing the module just now I am quite sure it's not a bug, but please correct me.