ansible.builtin.homebrew (v2.9.27) — module

Package manager for Homebrew

| "added in version" 1.1 of ansible.builtin"

Authors: Indrajit Raychaudhuri (@indrajitr), Daniel Jaouen (@danieljaouen), Andrew Dunham (@andrew-d)

preview | supported by community

Install Ansible via pip

Install with pip install ansible==2.9.27

Description

Manages Homebrew packages


Requirements

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# Install formula foo with 'brew' in default path (C(/usr/local/bin))
- homebrew:
    name: foo
    state: present
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# Install formula foo with 'brew' in alternate path C(/my/other/location/bin)
- homebrew:
    name: foo
    path: /my/other/location/bin
    state: present
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# Update homebrew first and install formula foo with 'brew' in default path
- homebrew:
    name: foo
    state: present
    update_homebrew: yes
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# Update homebrew first and upgrade formula foo to latest available with 'brew' in default path
- homebrew:
    name: foo
    state: latest
    update_homebrew: yes
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# Update homebrew and upgrade all packages
- homebrew:
    update_homebrew: yes
    upgrade_all: yes
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# Miscellaneous other examples
- homebrew:
    name: foo
    state: head
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- homebrew:
    name: foo
    state: linked
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- homebrew:
    name: foo
    state: absent
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- homebrew:
    name: foo,bar
    state: absent
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- homebrew:
    name: foo
    state: present
    install_options: with-baz,enable-debug

Inputs

    
name:
    aliases:
    - pkg
    - package
    - formula
    description:
    - list of names of packages to install/remove

path:
    default: /usr/local/bin
    description:
    - A ':' separated list of paths to search for 'brew' executable. Since a package (I(formula)
      in homebrew parlance) location is prefixed relative to the actual path of I(brew)
      command, providing an alternative I(brew) path enables managing different set of
      packages in an alternative location in the system.

state:
    choices:
    - head
    - latest
    - present
    - absent
    - linked
    - unlinked
    default: present
    description:
    - state of the package

upgrade_all:
    aliases:
    - upgrade
    default: 'no'
    description:
    - upgrade all homebrew packages
    type: bool

install_options:
    aliases:
    - options
    description:
    - options flags to install a package
    version_added: '1.4'
    version_added_collection: ansible.builtin

update_homebrew:
    aliases:
    - update-brew
    default: 'no'
    description:
    - update homebrew itself first
    type: bool