- AnsibleFest
- Products
- Community
- Webinars & Training
- Blog

Documentation

# homebrew – Package manager for Homebrew

- Synopsis

- Requirements

- Parameters

- Notes

- Examples

- Status

## Synopsis

- Manages Homebrew packages

## Requirements

The below requirements are needed on the host that executes this module.

- python >= 2.6

- homebrew must already be installed on the target system

## Parameters

Parameter | Choices/Defaults | Comments
--- | --- | ---
install_options - |  | options flags to install a package aliases: options
name - |  | list of names of packages to install/remove aliases: pkg, package, formula
path - | Default: "/usr/local/bin" | A ':' separated list of paths to search for 'brew' executable. Since a package (formula in homebrew parlance) location is prefixed relative to the actual path of brew command, providing an alternative brew path enables managing different set of packages in an alternative location in the system.
state - | Choices: head latest present ← absent linked unlinked | state of the package
update_homebrew boolean | Choices: no ← yes | update homebrew itself first aliases: update-brew
upgrade_all boolean | Choices: no ← yes | upgrade all homebrew packages aliases: upgrade

## Notes

Note

- When used with a loop: each package will be processed individually, it is much more efficient to pass the list directly to the name option.

## Examples

    # Install formula foo with 'brew' in default path (C(/usr/local/bin))
    - homebrew:
        name: foo
        state: present

    # Install formula foo with 'brew' in alternate path C(/my/other/location/bin)
    - homebrew:
        name: foo
        path: /my/other/location/bin
        state: present

    # Update homebrew first and install formula foo with 'brew' in default path
    - homebrew:
        name: foo
        state: present
        update_homebrew: yes

    # Update homebrew first and upgrade formula foo to latest available with 'brew' in default path
    - homebrew:
        name: foo
        state: latest
        update_homebrew: yes

    # Update homebrew and upgrade all packages
    - homebrew:
        update_homebrew: yes
        upgrade_all: yes

    # Miscellaneous other examples
    - homebrew:
        name: foo
        state: head

    - homebrew:
        name: foo
        state: linked

    - homebrew:
        name: foo
        state: absent

    - homebrew:
        name: foo,bar
        state: absent

    - homebrew:
        name: foo
        state: present
        install_options: with-baz,enable-debug

## Status

- This module is not guaranteed to have a backwards compatible interface. [preview]

- This module is maintained by the Ansible Community. [community]

### Authors

- Indrajit Raychaudhuri (@indrajitr)

- Daniel Jaouen (@danieljaouen)

- Andrew Dunham (@andrew-d)

Hint

If you notice any issues in this documentation, you can edit this document to improve it.