Ansible Modules homebrew and homebrew cask

From NovaOrdis Knowledge Base
Jump to navigation Jump to search

External

Internal

Overview

Install a Homebrew formula or cask. Also see:

brew install

To install a formula:

- name: Install bash
  homebrew:
    name: bash
  register: brew_install_result

To install a cask:

- name: Install Corretto 11
  homebrew_cask:
    name: corretto11
  register: brew_install_result

In both cases, brew_install_result is initialized to something similar to:

{
  "changed": false,
  "failed": false,
  "msg": "Cask already installed: corretto11"
}

Parameters

state

A string describing the state of the formula or cask. Possible values are:

  • "absent"
  • "installed"
  • "latest"
  • "present"
  • "removed"
  • "uninstalled"
  • "upgraded"

The default value is "present"