I’m executing the same script at two different hosts. Script just returns current working directory:
tasks:
- name: Get exec_path localaction
local_action: command pwd
register: res - debug: var=res.stdout_lines
At both hosts script is locted in /opt/test
In one host I’m getting script location:
TASK [debug] *************************************************************************************************************************************************************************************************
ok: [single] => {
“res.stdout_lines”: [
“/opt/test”
]
}
On another: /root
TASK [debug] *********************************************************************************************************************************************
ok: [ single ] => {
“res.stdout_lines”: [
“/root”
]
}
Why it is so? How to make on second host run local_action from scrit location?