ansible-collection-mac icon indicating copy to clipboard operation
ansible-collection-mac copied to clipboard

mas role not working on sequoia 15.4

Open lo-yuta opened this issue 3 months ago • 3 comments

Hello,

i'm having an issue with the mas role on sequoia 15.4, as my playbook runs and tries to execute the following task:

- name: Install mas and apps
  ansible.builtin.import_role:
    name: geerlingguy.mac.mas                                                                                                                                         
    tasks_from: main.yml

it breaks with the following error:

fatal: [localhost]: FAILED! => {"changed": false, "cmd": ["/opt/homebrew/bin/mas", "list"], "delta": "0:00:00.022339", "end": "2025-08-27 22:34:31.462032", "msg": "non-zero return code", "rc": 1, "start": "2025-08-27 22:34:31.439693", "stderr": "Error: No installed apps found\n\nIf this is unexpected, the following command line should fix it by\n(re)creating the Spotlight index (which might take some time):\n\nsudo mdutil -Eai on", "stderr_lines": ["Error: No installed apps found", "", "If this is unexpected, the following command line should fix it by", "(re)creating the Spotlight index (which might take some time):", "", "sudo mdutil -Eai on"], "stdout": "", "stdout_lines": []}

it is breaking as the command mas list returns error:

Error: No installed apps found

If this is unexpected, the following command line should fix it by
(re)creating the Spotlight index (which might take some time):

sudo mdutil -Eai on

the version of mas installed is 2.3.0, perhaps is just this version that is bugged? is anyone else facing this issue? can we consider putting a register and a failed_when in the mas ansible role main.yml file?

lo-yuta avatar Aug 27 '25 20:08 lo-yuta

i added a small workaround on the pull request mentioned above, please consider it or let's talk about a possible solution,

i tried to install an app via mas cli command and then run the ansible role, it does work as the mas list detects a package installed, so yeah it does seem that the problem is mas itself, could we still consider the workaround that i provided?

lo-yuta avatar Aug 27 '25 21:08 lo-yuta

It seems like that would possibly be a bug in mas, why would it return an error if it's returning a list and just not showing anything in the list? It seems like it should only error out if it can't produce the empty list at all... hmm.

geerlingguy avatar Aug 27 '25 22:08 geerlingguy

you're totally right, my bad for not thinking about it but as far as i understood the 2.3.0 release didn't affect the output of the search command, i'll open an issue there too maybe they missed something.

lo-yuta avatar Aug 28 '25 09:08 lo-yuta