Ansible Galaxy: Mac App Store CLI (mas)
Installs mas on macOS, and installs macOS apps from the Mac App Store.
Homebrew: Requires homebrew already installed (you can use geerlingguy.homebrew to install it on your Mac).
Mac App Store account: You can either sign into the Mac App Store via the GUI before running this role, or you can set the
mas_passwordprior to running the role. For security reasons, if you’re going to use this role to sign in, you should use
vars_promptfor at least the password; don’t store unencrypted passwords with your playbooks!
First, Install Ansible.
Mac OS X
Then, install it use:
ansible-galaxy install geerlingguy.mas
Available variables are listed below, along with default values (see
The credentials for your Mac App Store account. The Apps you install should already be purchased by/registered to this account.
If setting these variables statically (e.g. in an included
vars file), you should encrypt the inventory using Ansible Vault - http://docs.ansible.com/ansible/playbooks_vault.html. Otherwise you can use
vars_prompt to prompt for the password at playbook runtime.
If you leave both blank, and don’t prompt for them, the role assumes you’ve already signed in via other means (e.g. via GUI or
mas signin [email]), and will not attempt to sign in again.
Fallback to the built-in Mac App Store dialog to complete sign in. If set to yes, you must specify the aforementioned
mas_email variable which will be autofilled in the dialog and prompt you to enter your password, followed by the 2FA authorization code if enabled on the account.
A list of apps to ensure are installed on the computer. You can get IDs for all your existing installed apps with mas list, and you can search for IDs with
mas search [App Name]. The name attribute is not authoritative and only used to provide better information in the playbook output.
Whether to run mas upgrade, which will upgrade all installed Mac App Store apps.
- hosts: localhost
See the Mac Development Ansible Playbook - https://github.com/geerlingguy/mac-dev-playbook for an example of this role’s usage.