FAILED! => {"changed": false, "msg": "src file does not exist, use \"force=yes\" if you really want to create the link: /snap/bin/certbot", "path": "/usr/bin/certbot", "src": "/snap/bin/certbot"}
My proposed change would be to ignore the error for this task when being run in check mode.
- name: Symlink certbot into place.
file:
src: /snap/bin/certbot
dest: /usr/bin/certbot
state: link
ignore_errors: "{{ ansible_check_mode }}"
When executing the role initially via dry-run the task
Symlink certbot into place.
fails to execute because the src file is not present.https://github.com/geerlingguy/ansible-role-certbot/blob/dd1f8bd22c884dbbf28c2991be735ad88fd3bde3/tasks/install-with-snap.yml#L32-L36
Error message:
My proposed change would be to ignore the error for this task when being run in check mode.