Update create_user_ssh/check_authorizzed_key.yml

This commit is contained in:
David Lopez 2023-07-27 09:05:59 +00:00
parent bb992fa54a
commit b72d005b96
1 changed files with 2 additions and 2 deletions

View File

@ -16,11 +16,11 @@
- name: Display result
debug:
msg: "Authorized key exists: {{ authorized_key_exists }}"
msg: "Authorized key exists: {{ authorized_key_exists | default(false) }}"
- name: Add authorized key
authorized_key:
user: root # Replace with the remote user's name
state: present
key: "{{ key_to_add }}"
when: not authorized_key_exists
when: authorized_key_exists | default(false) | not