geerlingguy.mas
Ansible Role: Mac App Store CLI (mas) (MOVED)
MOVED: This role has been moved to the geerlingguy.mac
collection. For help with the transition, see this issue.
This role installs mas on macOS and can download apps from the Mac App Store.
Requirements
- Homebrew: You need to have
homebrew
installed (you can usegeerlingguy.homebrew
to install it on your Mac). - Mac App Store account: Sign in to the Mac App Store through the GUI before using this role, or you can set the
mas_email
andmas_password
beforehand. For security, if you use this role to sign in, usevars_prompt
for at least the password; do not keep unencrypted passwords in your playbooks!
Role Variables
Here are some available variables and their default values (see defaults/main.yml
):
mas_email: ""
mas_password: ""
These are the credentials for your Mac App Store account. Make sure the apps you want to install are linked to this account.
If you set these variables directly (like in a vars file), you should encrypt the inventory using Ansible Vault. Alternatively, you can use vars_prompt
to ask for the password when running the playbook.
If you leave both fields blank and do not prompt for them, the role will assume you have already signed in through another method (like GUI or mas signin [email]
), and it won't try to sign in again.
mas_signin_dialog: false
This option uses the built-in Mac App Store dialog to complete the sign-in. If set to yes, you must provide the mas_email
, which will be auto-filled in the dialog, and then you will need to enter your password followed by a 2FA code if you have it enabled.
mas_installed_apps:
- { id: 425264550, name: "Blackmagic Disk Speed Test (3.0)" }
- { id: 411643860, name: "DaisyDisk (4.3.2)" }
- { id: 498486288, name: "Quick Resizer (1.9)" }
- { id: 497799835, name: "Xcode (8.1)" }
This is a list of apps you want to ensure are installed on your computer. You can find the IDs of your installed apps using mas list
, and search for IDs with mas search [App Name]
. The name
is just for reference in the playbook output and is not the official name.
mas_upgrade_all_apps: false
This option lets you decide whether to run mas upgrade
, which will update all installed Mac App Store apps.
Dependencies
- (Soft dependency)
geerlingguy.homebrew
Example Playbook
- hosts: localhost
vars:
mas_installed_apps:
- { id: 497799835, name: "Xcode (8.1)" }
roles:
- geerlingguy.homebrew
- geerlingguy.mas
You can check the Mac Development Ansible Playbook for an example of how to use this role.
License
MIT / BSD
Author Information
This role was created in 2016 by Jeff Geerling, who is the author of Ansible for DevOps.
Mac App Store CLI installation for macOS
ansible-galaxy install geerlingguy.mas