- hosts: all tasks: - script: scripts/print_env.sh register: env - debug: msg={{env}}