You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
od -c authorized_keys
0000000 # A d d e d b y G o o g l
0000020 e \n s s h - r s a A A A A B 3
0000040 N z a C 1 y c 2 E A A A A D A Q
.....
0001360 @ d x t e s t s r v \n
0001373
- name: Load and Deploy SSH Keyauthorized_key:
user: "xxxx"state: presentkey: "# Added by Google\n{{ lookup('file', changeInstKey__currentSshPubKey) }}"exclusive: true
EXPECTED RESULTS
No change as the key in the file lookup contains exactly the key in the authorized_keys file.
I tied this with different key settings.
"# Added by Google\n{{ lookup('file', changeInstKey__currentSshPubKey) }}""\\# Added by Google\n{{ lookup('file', changeInstKey__currentSshPubKey) }}""{{ lookup('file', changeInstKey__currentSshPubKey) }}"
But every try results in a changed in Ansible.
I would also happy with a switch to ignore all # Comment lines and ony set the key and exclusive if this would result in an OK Statement
ACTUAL RESULTS
The comment line will be removed and if I reboot the cloud system google adds the line again and ansible changes the line again and so on.
The text was updated successfully, but these errors were encountered:
SUMMARY
The Module reports a change but the only and exclusive key is set allredy in the file.
ISSUE TYPE
COMPONENT NAME
ansible.posix.authorized_key
ANSIBLE VERSION
COLLECTION VERSION
CONFIGURATION
OS / ENVIRONMENT
STEPS TO REPRODUCE
Current Content in authroized_keys file
EXPECTED RESULTS
No change as the key in the file lookup contains exactly the key in the authorized_keys file.
I tied this with different key settings.
But every try results in a changed in Ansible.
I would also happy with a switch to ignore all # Comment lines and ony set the key and exclusive if this would result in an OK Statement
ACTUAL RESULTS
The comment line will be removed and if I reboot the cloud system google adds the line again and ansible changes the line again and so on.
The text was updated successfully, but these errors were encountered: