--- - name: Registering a variable hosts: nodes tasks: - name: Execution command: "ls -l /root" register: info - name: calling register variable debug: var: info # Calling same registered variable through msg arument in debug module - name: Calling through msg debug: msg: "{{ info }}" ... # If we do not use -v option while executing playbook ansible do not carry output it leaves them on managed host onlywhenever playbook run # Note we do not use jinja delimiters as var argument in debug module is itself wrapped in jinja "{{ }}" # filename: register.yml