--- # Tasks for Passthrough role - name: Check if ssh passthrough file exists stat: path: /usr/local/bin/gitea register: pass_status - name: No need to upload ssh passthrough file when: pass_status.stat.exists == true debug: msg: No need to upload ssh passthrough file as it already exists. - name: Upload ssh passthrough file when: pass_status.stat.exists == false template: src: "files/gitea" dest: "/usr/local/bin/gitea" owner: "{{ user }}" group: "{{ user }}" mode: 0755