# Ensure environment: is preserved during call. - name: integration/playbook_semantics/environment.yml hosts: all any_errors_fatal: true tasks: - shell: echo $SOME_ENV environment: SOME_ENV: 123 register: result - debug: msg={{result}} - assert: that: "result.stdout == '123'"