diff --git a/create_user_ssh/check_authorizzed_key.yml b/create_user_ssh/check_authorizzed_key.yml index 7742fdb..f950608 100644 --- a/create_user_ssh/check_authorizzed_key.yml +++ b/create_user_ssh/check_authorizzed_key.yml @@ -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 \ No newline at end of file + when: authorized_key_exists | default(false) | not \ No newline at end of file