community.general.mas (8.5.0) — module

Manage Mac App Store applications with mas-cli

| "added in version" 0.2.0 of community.general"

Authors: Michael Heap (@mheap), Lukas Bestle (@lukasbestle)

Install collection

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


Add to requirements.yml

  collections:
    - name: community.general
      version: 8.5.0

Description

Installs, uninstalls and updates macOS applications from the Mac App Store using the C(mas-cli).


Requirements

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Install Keynote
  community.general.mas:
    id: 409183694
    state: present
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Install Divvy with command mas installed in /usr/local/bin
  community.general.mas:
    id: 413857545
    state: present
  environment:
    PATH: /usr/local/bin:{{ ansible_facts.env.PATH }}
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Install a list of apps
  community.general.mas:
    id:
      - 409183694 # Keynote
      - 413857545 # Divvy
    state: present
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Ensure the latest Keynote version is installed
  community.general.mas:
    id: 409183694
    state: latest
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Upgrade all installed Mac App Store apps
  community.general.mas:
    upgrade_all: true
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Install specific apps and also upgrade all others
  community.general.mas:
    id:
      - 409183694 # Keynote
      - 413857545 # Divvy
    state: present
    upgrade_all: true
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Uninstall Divvy
  community.general.mas:
    id: 413857545
    state: absent
  become: true # Uninstallation requires root permissions

Inputs

    
id:
    description:
    - The Mac App Store identifier of the app(s) you want to manage.
    - This can be found by running C(mas search APP_NAME) on your machine.
    elements: int
    type: list

state:
    choices:
    - absent
    - latest
    - present
    default: present
    description:
    - Desired state of the app installation.
    - The V(absent) value requires root permissions, also see the examples.
    type: str

upgrade_all:
    aliases:
    - upgrade
    default: false
    description:
    - Upgrade all installed Mac App Store apps.
    type: bool