I'm having problems working with environment variables of a remote host. For example, when I try {{lookup ('env', 'PATH')}}, it returns the path to my guest machine not to the remote host.
How to select / change remote host environment variables?
my playbook:
--- - name : playbook hosts : webservers gather_facts: yes remote_user: user1 vars: Path: "{{lookup('ansible_env','PATH')}}" roles : - task1 - task2 - task3
which return the path to my machine, not the path to the remote host named user1. I'm starting to need help. thanks in advance.
linux yaml environment-variables ansible ansible-playbook
mndhr
source share