top | item 7694005

Osxc – Simple configuration tool for OS X

110 points| robinricard | 12 years ago |osxc.github.io | reply

44 comments

order
[+] zdw|12 years ago|reply
Another project that uses the same tools (Ansible/Homebrew) to accomplish the same/similar goals:

https://github.com/32degrees/battleschool

If you're going to do this on a wider scale (multiple machines, managed in an organization), the best tools right now are AutoPKG and Munki:

https://github.com/autopkg/autopkg http://code.google.com/p/munki/

[+] robinricard|12 years ago|reply
I looked into battleschool. The way it overally works seems better (having it's own command and a simple config with just a dotfile) but I really like ansible roles and I really enjoy using brew and brew cask to install everything, it's more neat and more undoable than using a pkg command directly. For now, I don't know which design I'll choose but I still like using the ansible-playbook command. I don't want to hide the internal mechanics of my tool. Ansible is great ! I still want to use it !
[+] robinricard|12 years ago|reply
thanks ! That's exactly what I was looking for when I started to create osxc ! I will look into it. In fact osxc should more be seen as a set of roles than anything else, so I think it can be easily plugged with an existing solution such as battleschool.
[+] taylorlapeyre|12 years ago|reply
I'm struggling to see how this is better than a simple bootstrapping script. Every feature you list can be accomplished in very few lines of bash:

https://github.com/taylorlapeyre/.files/blob/master/osx/boot...

[+] ot|12 years ago|reply
The main difference between shell scripts and Ansible playbooks is that shell scripts are imperative, while playbooks are declarative and idempotent.

A shell script will be something like

    install this package
    create this file
    change this line in a configuration file
While a playbook is like

    make sure this package is installed
    make sure this file exists
    make sure this line is like this in this config file
What happens if you want change something in your configuration script? In most cases you can't just replay a shell script, because it will try to do a lot of things that are already done and it is very hard to write idempotent commands.

Ansible on the other hand only performs the tasks in the playbook that need to be performed: if the condition is already satisfied, there's nothing to do.

This is especially convenient if your script fails at some point: you can fix the directive and replay the playbook, and it will restart from where it left off. With shell scripts you have to do it manually (comment out the first part?), which is error-prone and time-consuming.

[+] robinricard|12 years ago|reply
I understand what you're saying. I just started this a few days ago and wanted to share it with the community. For now, this is more: how I setup my computer than how everyone should do it. But I found that even if a simple bash script would do the same, the ansible roles gives me the possibility to have reusable components. (my boot.sh is terrible, I know, I have to find something else ...)
[+] bdunbar|12 years ago|reply
Standalone, it's 6 o' one, half-dozen of another.

We use ansible for configuring servers. Using this to configure our machines would be cake.

[+] kbar13|12 years ago|reply
because writing yaml is way easier than writing a bash script.
[+] jimmcslim|12 years ago|reply
One blind spot that all of these OS X configuration tools appear to have is the App Store. Not through any fault of their own I suspect... more that Apple hasn't opened the App Store app to being scriptable. But a command-line way of installing/reinstalling/updating App Store apps would be great.
[+] sacrilicious|12 years ago|reply
The zdw-mentioned autopkg has the capability of looking at your installed AppStore apps and checking for updates, and further can package them(with embedded receipt/DRM) to a patch mgmt system. https://github.com/autopkg/nmcspadden-recipes/tree/master/Ap... It works with any pkg deployment system, although autopkg itself ships with Munki support. Ansible and osxc by extension are about ConfigMgmt, of course, but conflating mgmt systems is common and understandable.
[+] weitzj|12 years ago|reply
I am using Github's Boxen, which works quite well https://boxen.github.com/
[+] robinricard|12 years ago|reply
boxen looked nice to me, but I really wanted to avoid puppet (even if I never tried, it's often compared to chef and I have lots of bad experiences with chef !)
[+] rafeed|12 years ago|reply
This is neat. I think it'd be pretty awesome if it were possible to download all the dmg's/installers/apps in a folder/drive without installing them so at a later date you could a) install everything without having to wait hours to download or require an internet connection and b) keep your packages up to date (almost as a backup) running the script every once in a while to make sure you have the most up to date packages/installers.
[+] robinricard|12 years ago|reply
I think the project is not largely usable for now, I just want some feedback from HN to get it usable for everyone (and not just for me).
[+] microtonal|12 years ago|reply
For some reason I'd never seen Homebrew Cask before, which looks very interesting! Does anyone have experiences with Cask to share?
[+] alwillis|12 years ago|reply
Homebrew Cask is awesome!

A couple of weeks ago I decided to backup my hard drive, reformat it and reinstall OS X Mavericks to get rid of the cruft that seems to have built up in 4 years, updating from every OS since Mac OS X 10.5 Leopard.

I made halfhearted attempts to organize my dotfiles and configuration in the past, like the cool kids do on Github. That’s when I learned about Homebrew Cask (http://caskroom.io) which makes it super easy to install the GUI apps I install on whatever Mac I’m using—iTerm, Transmission, Vagrant, Virtual Box, etc.

And now I have them in a Brewfile (http://robots.thoughtbot.com/brewfile-a-gemfile-but-for-home...) under version control in case I need to install the whole shebang on another Mac.

And now brew update && brew upgrade updates everything.

[+] kolev|12 years ago|reply
Cask could be awesome, but it's not at this stage. There are no upgrades, in many cases it doesn't work. Most apps complain that they are not in /Applications, but are in ~/Applications instead and so on. At the end of the day, it duplicates some of the Homebrew functionality - some non-GUI packages are getting into Cask, because possibly Homebrew doesn't want them - it's a bit confusing as well. I think efforts should be put into merging into Homebrew instead of keeping it separate.
[+] emdowling|12 years ago|reply
we use Ansible across 300 hosts, including some Mac guests. Well-tested playbooks for Mac are hard to find, so this is awesome.
[+] mukundmr|12 years ago|reply
How is this different from Chef / Puppet?
[+] runjake|12 years ago|reply
The osxc website and documentation is riddled with basic grammar and spelling errors and incorporates slang like "osxc got your back". That doesn't inspire much confidence.

Edit: Wow with the downvotes. I'm just offering feedback in a polite manner for what a lot of others are probably thinking.

[+] robinricard|12 years ago|reply
I know, my english is not very accurate (I'm french). Feel free to do some pull-requests to correct my grammar errors, it'll help me a lot ! Both for this website and my english. Thank you !

Note that you shouldn't be confident using it too, it's still a very early project and, at the beginning, it was only meant to be used by me ... But I intend to make it much better !

[+] moisy|12 years ago|reply
Just because this is a software not an English book.
[+] holyjaw|12 years ago|reply
You were probably downvoted because your feedback was not given in a polite manner.