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

`mac.homebrew`: Install `mas` apps from Brewfile over SSH does not work

Open tuxpeople opened this issue 2 years ago • 2 comments

I'd like to reopen https://github.com/geerlingguy/ansible-role-homebrew/issues/146 here, as the issue still exists.

I have a Brewfile with multiple mas apps in it. When I run the playbook over SSH, it fails:

TASK [geerlingguy.mac.homebrew : Install from Brewfile.] *******************************************************************************************************************************************************************************************************************************************************************
fatal: [ws547]: FAILED! => changed=true
  cmd:
  - /usr/local/bin/brew
  - bundle
  delta: '0:00:09.632515'
  end: '2022-04-01 15:18:18.952991'
  msg: non-zero return code
  rc: 1
  start: '2022-04-01 15:18:09.320476'
  stderr: 'Error: Unable to install Affinity Designer app. mas installation failed.'
  stderr_lines: <omitted>
  stdout: 
(Lot of Brewfile content)
  stdout_lines: <omitted>

However, it works using ansible_connection=local therefor I'm using this workaround now:

- name: Set controller_host fact
  set_fact:
    controller_host: "{{lookup('pipe','hostname')}}"

- name: Switch to local connection if this is the device
  set_fact:
    ansible_connection: local
  when: ansible_hostname == controller_host

tuxpeople avatar Apr 01 '22 13:04 tuxpeople

This issue has been marked 'stale' due to lack of recent activity. If there is no further activity, the issue will be closed in another 30 days. Thank you for your contribution!

Please read this blog post to see the reasons why I mark issues as stale.

stale[bot] avatar Jul 10 '22 06:07 stale[bot]

For me the whole MAS installation doesnt work when using ansible remotely on my M1 mac. It just stops at the task. Im logged in via GUI and have Xcode installed and uninstalled to check if it was user error. It just doesnt appear to install or it takes forever that way?

JuSenshi avatar Jul 11 '22 15:07 JuSenshi

This issue has been closed due to inactivity. If you feel this is in error, please reopen the issue or file a new issue with the relevant details.

stale[bot] avatar Aug 13 '22 05:08 stale[bot]