community.general.homebrew_cask (0.1.4) — module

Install and uninstall homebrew casks

Authors: Indrajit Raychaudhuri (@indrajitr), Daniel Jaouen (@danieljaouen), Enric Lluelles (@enriclluelles)

Install collection

Install with ansible-galaxy collection install community.general:==0.1.4


Add to requirements.yml

  collections:
    - name: community.general
      version: 0.1.4

Description

Manages Homebrew casks.


Requirements

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Install cask
  homebrew_cask:
    name: alfred
    state: present
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Remove cask
  homebrew_cask:
    name: alfred
    state: absent
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Install cask with install options
  homebrew_cask:
    name: alfred
    state: present
    install_options: 'appdir=/Applications'
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Install cask with install options
  homebrew_cask:
    name: alfred
    state: present
    install_options: 'debug,appdir=/Applications'
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Allow external app
  homebrew_cask:
    name: alfred
    state: present
    accept_external_apps: True
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Remove cask with force option
  homebrew_cask:
    name: alfred
    state: absent
    install_options: force
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Upgrade all casks
  homebrew_cask:
    upgrade_all: true
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Upgrade given cask with force option
  homebrew_cask:
    name: alfred
    state: upgraded
    install_options: force
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Upgrade cask with greedy option
  homebrew_cask:
    name: 1password
    state: upgraded
    greedy: True
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Using sudo password for installing cask
  homebrew_cask:
    name: wireshark
    state: present
    sudo_password: "{{ ansible_become_pass }}"

Inputs

    
name:
    aliases:
    - cask
    - package
    - pkg
    description:
    - Name of cask to install or remove.
    elements: str
    type: list

path:
    default: /usr/local/bin
    description:
    - ''':'' separated list of paths to search for ''brew'' executable.'
    type: path

state:
    choices:
    - absent
    - installed
    - latest
    - present
    - removed
    - uninstalled
    - upgraded
    default: present
    description:
    - State of the cask.
    type: str

greedy:
    default: false
    description:
    - Upgrade casks that auto update.
    - Passes --greedy to brew cask outdated when checking if an installed cask has a newer
      version available.
    type: bool

upgrade_all:
    aliases:
    - upgrade
    default: false
    description:
    - Upgrade all casks.
    - Mutually exclusive with C(upgraded) state.
    type: bool

sudo_password:
    description:
    - The sudo password to be passed to SUDO_ASKPASS.
    required: false
    type: str

install_options:
    aliases:
    - options
    description:
    - Options flags to install a package.
    elements: str
    type: list

update_homebrew:
    aliases:
    - update-brew
    default: false
    description:
    - Update homebrew itself first.
    - Note that C(brew cask update) is a synonym for C(brew update).
    type: bool

accept_external_apps:
    default: false
    description:
    - Allow external apps.
    type: bool