--- - name: Check the system raw: uname -a register: OS - name: Ubuntu pre-tasks include: ubuntu.yml when: '"Ubuntu" in OS.stdout' - name: FreeBSD pre-tasks include: freebsd.yml when: '"FreeBSD" in OS.stdout' - name: Ensure the algo ssh key exist on the server authorized_key: user: "{{ ansible_ssh_user }}" state: present key: "{{ lookup('file', '{{ SSH_keys.public }}') }}" tags: [ 'always' ]