Created
November 21, 2015 01:33
-
-
Save MrNice/01113bcf0dd0ae682ec1 to your computer and use it in GitHub Desktop.
Ansible Mac OS X install app w/ brew and add to the Dock
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# TODO: Get version from registering output of brew cask install | |
- name: "install browser: {{ browser }}" | |
homebrew_cask: > | |
name={{ browser }} | |
state=present | |
- name: read defaults to know what to add to the dock | |
shell: defaults read com.apple.dock | |
register: apple_defaults | |
- name: "add {{ browser }} to the dock" | |
vars: | |
brew_name: google-chrome | |
app_name: "Google Chrome" | |
version: latest | |
shell: defaults write com.apple.dock persistent-apps -array-add '<dict><key>tile-data</key><dict><key>file-data</key><dict><key>_CFURLString</key><string>/opt/homebrew-cask/Caskroom/{{ brew_name }}/{{ version }}/{{ app_name }}.app</string><key>_CFURLStringType</key><integer>0</integer></dict></dict></dict>' | |
when: apple_defaults.stdout.find(app_name) == -1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment