- name: debug tasks gather_facts: no hosts: "{{target}}" become: "{{become}}" tasks: - name: define distro ansible.builtin.shell: executable: /bin/bash cmd: "lsb_release -is 2>/dev/null | tr A-Z a-z || echo unknown" register: distro changed_when: false check_mode: false - debug: var=distro.stdout - name: define sftp subsystem path set_fact: sftp_subsystem_path: "{{ '/usr/lib/openssh/sftp-server' if distro.stdout == 'debian' or distro.stdout == 'ubuntu' else '/usr/libexec/openssh/sftp-server' }}" - name: check sftp subsystem path ansible.builtin.shell: executable: /bin/bash cmd: "[[ -x {{sftp_subsystem_path}} ]]" check_mode: false changed_when: false