-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use mas for Mac App Store automation #11
Comments
See: https://github.com/TravisCarden/dotfiles/blob/master/playbooks/tasks/mac-app-store.yml Idempotent example: - name: Install Mac App Store apps.
shell: mas list | grep {{ item }} || mas install {{ item }}
with_items:
- 407963104 # Pixelmator
- ...
register: result
changed_when: result.stdout.find('Installed') != -1 h/t to @TravisCarden |
+1. |
Here's a small variation, which improves readability. vars/main.yml
main.yml
tasks/mac-apple-store.yml
extra vars for signing into mac store
This modification changes the structure of the array of processed items, to show the name as well as the mac id. The name isn't actually used by Ansible but it serves as a valuable non-comment entry to authors to identify what's what. Also added is an easy way to sign the user in, with the assistance of additional variables declared on the command line. This could all be a new role though, if you didn't want the integration aspects. It has been tested with and without variable input, and all cases where a fail is possible have been eliminated here. |
@fubarhouse - Thanks for your work on this—one of the last components would be to document how to get I wouldn't want the playbook to hang the first time it's run because |
Revision 2Changes as requested, see full list of changes from the master below. For documentation purposes, any user can turn the entire functionality off by setting Let me know if you're happy and I can create a PR. Observations
vars/main.yml
main.yml
tasks/mac-apple-store.yml
|
A few notes:
I'll close this out once I've verified the role and integration with this playbook are working correctly. |
(This is all predicated by my finally getting a new work laptop today, and deciding it's better to spend 30 minutes automating the app install instead of spending 5 minutes clicking all those install buttons one by one :P). |
Jeff - first thanks for all your amazing work on Ansible - I've found your books and code here invaluable :) Quick question - this role presumes that I've already identified the ID's for any of the Applications I want to install via the App Store, correct? It doesn't appear to be using MAS's query functionality to lookup anything, but I wanted to check before I dove in... |
I'm running a final test on my brand new (2015) retina MBP now; once that's done I'll be pushing up the changes to this repo, along with a little more documentation. |
is it bypassing the 2FA of Apple Store? if yes, how do you do it? |
@aquintiliano, it does not. It'll bring up a login dialog box. |
See: https://github.com/argon/mas
This would be nice to get even the Mac App Store stuff automated. Or maybe just a second playbook that you can run once authenticated, something like that.
The text was updated successfully, but these errors were encountered: