Update create_user_ssh/check_authorizzed_key.yml
This commit is contained in:
parent
bb992fa54a
commit
b72d005b96
|
@ -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
|
Loading…
Reference in New Issue