Team, Works locally on my laptop manually but fails only when calling via ansible. Is ansible looking at it in different shell? I have ansible controller as MAC book.
I am trying to store the path of a binary in register variable but shell command is not executing.
- name: "Find kubectl binary"
register: kubectl_path
shell: which kubectl
args:
executable: /bin/bash
output:
TASK [Find kubectl binary] ***************************************************************************************************************
fatal: [target1]: FAILED! => {"changed": true, "cmd": "which kubectl", "delta": "0:00:00.007541", "end": "2019-10-01 17:17:45.515963", "msg": "non-zero return code", "rc": 1, "start": "2019-10-01 17:17:45.508422", "stderr": "", "stderr_lines": [], "stdout": "", "stdout_lines": []}