I just realised that I am stupid :D

The file was on the computer where I was running the ansible script not on 
the target server. What I needed to do was to run the check locally

- name: Check if ssh key exists
  local_action: stat path="/config/clients/ssh_keys/daniel_nanboe.pub"
  register: exista
- debug: var=exista
- fail:
    msg: Stop



-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/96c190ef-33d8-4e09-8712-8f1b2de8bcbc%40googlegroups.com.

Reply via email to