geerlingguy.homebrew

Ansible Role: Homebrew (MOVED)

MOVED: This role has been moved to the geerlingguy.mac collection. Please check this issue for a guide on how to migrate and for more details.

MIT licensed Galaxy Role Downloads CI

This role installs Homebrew on MacOS and sets up packages, taps, and cask applications based on the given variables.

Requirements

No special requirements.

Role Variables

Here are the available variables with their default values (see defaults/main.yml):

  • homebrew_repo: https://github.com/Homebrew/brew

    • This is the GitHub link for the Homebrew core repository.
  • homebrew_prefix: {{ (ansible_machine == 'arm64') | ternary('/opt/homebrew', '/usr/local') }}

  • homebrew_install_path: {{ homebrew_prefix }}/Homebrew

    • This defines where Homebrew will be installed. It's best to stick with the default to avoid issues. If you change this, make sure to create a symlink to /usr/local.
  • homebrew_brew_bin_path: /usr/local/bin

    • This is where the brew command will be installed.
  • homebrew_installed_packages:

    • Default:
      - ssh-copy-id
      - pv
      - { name: vim, install_options: "with-luajit,override-system-vi" }
      
    • List of packages to ensure they are installed via brew install. You can also add installation options.
  • homebrew_uninstalled_packages: []

    • List of packages to ensure they are removed.
  • homebrew_upgrade_all_packages: false

    • Set to true to upgrade Homebrew and all installed packages. Keep it false if you prefer to do this manually.
  • homebrew_taps:

    • Default:
      - homebrew/core
      - { name: my_company/internal_tap, url: 'https://example.com/path/to/tap.git' }
      
    • Taps to ensure Homebrew has added.
  • homebrew_cask_apps:

    • Default:
      - firefox
      - { name: virtualbox, install_options:"debug,appdir=/Applications" }
      
    • Applications to install via cask. Check for available applications here.
  • homebrew_cask_accept_external_apps: true

    • Default is false, which stops the process if any app from homebrew_cask_apps is already installed without cask. Set as true to skip errors in such cases.
  • homebrew_cask_uninstalled_apps:

    • Default:
      - google-chrome
      
    • List of applications to ensure they are removed.
  • homebrew_cask_appdir: /Applications

    • Directory for cask-installed applications.
  • homebrew_use_brewfile: true

    • Whether to install using a Brewfile. If yes, you'll need to add the homebrew/bundle tap in homebrew_taps.
  • homebrew_brewfile_dir: ~

    • The location of your Brewfile.
  • homebrew_clear_cache: false

    • Set to true to clear the Homebrew cache after installing new software.
  • homebrew_user: {{ ansible_user_id }}

    • The user under which Homebrew is installed.
  • homebrew_group: {{ ansible_user_gid }}

    • The group to use while installing Homebrew.
  • homebrew_folders_additional: []

    • Any extra folders in homebrew_prefix to ensure ownership.

Dependencies

Example Playbook

- hosts: localhost
  vars:
    homebrew_installed_packages:
      - mysql
  roles:
    - geerlingguy.homebrew

Check the tests/local-testing directory for a sample of how to run this role through Ansible's local connection. Also refer to: Mac Development Ansible Playbook.

License

MIT

Author Information

This role was created in 2014 by Jeff Geerling, the author of Ansible for DevOps.

Maintainer(s)

Installa
ansible-galaxy install geerlingguy.homebrew
Licenza
mit
Download
2.4M
Proprietario
Father, author, developer, maker. Sometimes called "an inflammatory enigma". #stl #drupal #ansible #k8s #raspberrypi #crohns