You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Running my playbook on my Mac acting as control node and managing itself as localhost, everything works fine with MAS:
$ ansible-playbook -i inventory/localhost.yml macOS_app-installs.yml --ask-become-pass
...
TASK [geerlingguy.mac.mas : Ensure MAS is installed.] *******************************************************************************************************************************************************
ok: [127.0.0.1]
...
TASK [geerlingguy.mac.mas : List installed MAS apps.] *******************************************************************************************************************************************************
ok: [127.0.0.1]
...
However, when I try running the same playbook via SSH remotely, something fails after detecting the installed MAS, and when MAS is called to run (and it comes back, "[Errno 2] No such file or directory: b'mas'"):
$ ansible-playbook -i inventory/mac_ssh.yml macOS_app-installs.yml --private-key ~/.ssh/id_rsa --ask-become-pass
...
TASK [geerlingguy.mac.mas : Ensure MAS is installed.] **************************************************************************************************************
ok: [192.168.1.97]
...
TASK [geerlingguy.mac.mas : List installed MAS apps.] **************************************************************************************************************
fatal: [192.168.1.97]: FAILED! => {"changed": false, "cmd": "mas list", "msg": "[Errno 2] No such file or directory: b'mas'", "rc": 2, "stderr": "", "stderr_lines": [], "stdout": "", "stdout_lines": []}
I can correct this problem when coming in remotely by tweaking the PATH in the environment, like this:
that is, by injecting into the PATH environment variable where (on my Intel Mac) the mas executable is.
$ ls -l $(which mas)
lrwxr-xr-x 1 user group 27 Dec 20 14:08 /usr/local/bin/mas -> ../Cellar/mas/1.8.6/bin/mas
(I'd imagine, on an Apple Silicon Mac, if Apple Silicon systems have the same problem, one might need to inject "/opt/homebrew" instead of "/usr/local/bin".)
However, it seems strange that "TASK [geerlingguy.mac.mas : Ensure MAS is installed.]" works fine (i.e., it finds the mas executable), but then when it comes it comes time to actually use the detected installed mas in "TASK [geerlingguy.mac.mas : List installed MAS apps.]" then it fails. (And, perhaps, if it got that far, it'd also fail in "TASK [geerlingguy.mac.mas : Ensure configured MAS apps are installed.]" as well.)
Is there a fix for this that should be put in the role code, and that would work across Intel and Apple Silicon Macs? Or is it just best to stick with tweaking the PATH in the calling playbook? Or is this a problem somewhere else that needs to be corrected instead?
Thanks for any guidance!
The text was updated successfully, but these errors were encountered:
I am having the same problem and I am running the playbook locally. I was able to confirm that mas is indeed installed at /opt/homebrew/bin, but the task geerlingguy.mac.mas : List installed MAS apps. fails with [Errno 2] No such file or directory: b''mas'''. 4 tasks before there is a task ensuring that mas is installed.
Running my playbook on my Mac acting as control node and managing itself as localhost, everything works fine with MAS:
However, when I try running the same playbook via SSH remotely, something fails after detecting the installed MAS, and when MAS is called to run (and it comes back, "[Errno 2] No such file or directory: b'mas'"):
I can correct this problem when coming in remotely by tweaking the PATH in the environment, like this:
that is, by injecting into the PATH environment variable where (on my Intel Mac) the mas executable is.
(I'd imagine, on an Apple Silicon Mac, if Apple Silicon systems have the same problem, one might need to inject "/opt/homebrew" instead of "/usr/local/bin".)
However, it seems strange that "TASK [geerlingguy.mac.mas : Ensure MAS is installed.]" works fine (i.e., it finds the mas executable), but then when it comes it comes time to actually use the detected installed mas in "TASK [geerlingguy.mac.mas : List installed MAS apps.]" then it fails. (And, perhaps, if it got that far, it'd also fail in "TASK [geerlingguy.mac.mas : Ensure configured MAS apps are installed.]" as well.)
I found a couple of past issues referencing what sounds like the same/similar problems, but those both ended up going stale and getting closed.
Problems with the PATH fo mas commands #10
and
Installing apps with mas doesn't work for pubkey ssh tunnels #70
Is there a fix for this that should be put in the role code, and that would work across Intel and Apple Silicon Macs? Or is it just best to stick with tweaking the PATH in the calling playbook? Or is this a problem somewhere else that needs to be corrected instead?
Thanks for any guidance!
The text was updated successfully, but these errors were encountered: