Use Homebrew-Cask in place of mac_pkg
nanoxd opened this issue · 8 comments
Have you looked into integrating homebrew-cask instead of creating a new file for mac_pkg? We already track lots of applications and it would simplify entry for a new user. This could allow applications to be specified in one file, and keep links up to date.
I had never heard of it before. It would be pretty simple to had support for it. How do the apps that are installed with cask interact with the ones installed in /Applications. In other words, if I already installed Google Chrome and then run brew cask install google-chrome
, what happens? With mac_pkg and ansible in general, the mac_pkg task to install chrome, will think its work is already done.
Applications that were previously installed are not tracked. Once an application is installed via brew-cask, any subsequent attempts will result in an error indicating it is installed. It can be reinstalled through brew cask install google-chrome --force
On Jul 14, 2014, at 11:02 PM, Spencer Gibb notifications@github.com wrote:
I had never heard of it before. It would be pretty simple to had support for it. How do the apps that are installed with cask interact with the ones installed in /Applications. In other words, if I already installed Google Chrome and then run brew cask install google-chrome, what happens? With mac_pkg and ansible in general, the mac_pkg task to install chrome, will think its work is already done.
—
Reply to this email directly or view it on GitHub.
I found a repo that integrates homebrew-cask
@nanoxd , am I right that no uninstall of a Homebrew-Cask item is allowed in HNakamur's Ansible role? I found this code.
https://github.com/hnakamur/ansible-role-homebrew-cask-packages/blob/master/tasks/main.yml
---
# tasks file for homebrew-cask-packages
- homebrew_tap: tap=caskroom/cask state=present
- homebrew: name=brew-cask state=latest
- homebrew_cask: name={{ item }} state=installed
with_items: homebrew_cask_packages_packages
@AnneTheAgile I was playing with this the other day, replacing some different mac_pkg pieces with homebrew_cask - and state=absent seems to work reasonably nicely. To be honest, I'm licking it a lot
Thank you @jayshao ! Btw I too love the idea of a white glass whiteboard , you have a nice blog.
I see that (perhaps new?) now Ansible includes both Brews and Casks in its list of supported package managers! I got them both working just great.
http://docs.ansible.com/list_of_packaging_modules.html
To use it, perhaps a test or two might help for documentation purposes?
https://github.com/spencergibb/battleschool/search?p=2&q=mac_pkg&utf8=%E2%9C%93
Because they are regular Ansible Extras, they can be used directly - even easier than the Ansible Galaxy repo - which itself is quite easy :).
I haven't checked if the API for mac_pkg is the same as for Brew/Cask. Maybe it's not, @spencergibb ?
https://github.com/spencergibb/battleschool/blob/53eac5a560c25faa4fc57b1ed9aef9d12761889d/share/library/mac_pkg
I'd be happy to help contribute patches once we figure out the best way to approach it. I'm writing a blog post and finally am almost done, yay!
AnneTheAgile
p.s.
There are so many Ansible-supplied package managers now that I wish we could categorize them! Maybe I'll be able to help with that, so I wrote a ticket.
.[DOC] Add Categories to the List of supported Package Managers. · Issue #9420 · ansible/ansible
ansible/ansible#9420
//update, add Ref to Doc ticket on Ansible
Since homebrew_cask is in ansible, I'm going to close this as they can live side-by-side.
Thanks @spencergibb