首页 > 解决方案 > 通过 Ansible 安装 Homebrew 卡住了

问题描述

我正在尝试通过 Ansible 配置 Homebrew,以在 Mac Catalina 来宾中自动运行在 VMware 中的 Mac VM。我已经尝试了一些在线可用的片段,但没有一个有效。

这是最推荐的脚本。我试过成为 & become_user

- name: Install Homebrew
  # script: install-homebrew.sh
  shell: /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"

有人建议以异步模式运行它。现在脚本响应速度很快,但由于它需要 sudo 访问权限而抱怨并停止,即使我正在成为的用户已经在 macOS 中担任管理员角色。

- name: Install Homebrew
  # script: install-homebrew.sh
  shell: /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
  become_user: seng
  become: yes
  async: 30
  poll: 5
  register: out2

我怀疑是 Python 2.7,所以我使用 pyenv 手动实例化了 Python 3.8.5,然后将其用作 python_interpretor,它的行为方式也与 macOS 默认的 python 对应部分相同。

我尝试了单独的 shell 脚本、命令和 shell 方法,但它们都遇到了永远卡住的问题

标签: ansible

解决方案


推荐阅读