- name: Print linux distribution and version hosts: all tasks: - name: capture output of id command command: cat /etc/system-release register: login - debug: msg="{{ login.stdout }}"