
Mac-dev-playbook – Mac setup and configuration via Ansible - geerlingguy
https://github.com/geerlingguy/mac-dev-playbook
======
nunez
Ansible is great and all, but I've been using a bash_profile to set up my
workstations for years and it's worked great. Doesn't require third-party
tools and uses bash, so it can literally run on anything, including Cygwin and
LXSS (Windows).

For those interested:
[https://github.com/carlosonunez/setup](https://github.com/carlosonunez/setup)

~~~
ykler
I don't have a problem with third party tools or need to run a setup scrip on
Cygwin or LXSS, but shell scripting just seems easier than a tool like ansible
because you have a full programming language (albeit a terrible one), and you
can use familiar command line utilities to do everything. (You can use them in
ansible too, but it is frowned on -- you are supposed to relearn how to do
everything using modules that are usually less powerful than the equivalent
command line utilities.) I have never had to manage a huge fleet of servers,
so maybe ansible has advantages in that setting, but for setting up a single
box it just seems to make everything harder.

~~~
geerlingguy
When you have three+ Macs to configure, it starts looking more like a fleet
and less like a single computer :)

The main advantage I see is at it's a lot easier to reason with Yaml
configuration than shell scripts with a ton of conditionals, and it's also
easier to use Ansible's modules to make sure you can reprovision whenever you
want to get new things added or old things removed.

~~~
StavrosK
That's exactly my use case as well, which I detailed in a writeup:

[https://www.stavros.io/posts/provisioning-your-computer-
one-...](https://www.stavros.io/posts/provisioning-your-computer-one-command-
awesome/)

It's a great way to synchronize state between computers, including installed
packages, fonts, Vim plugins, etc.

It goes much further than dotfiles.

------
lukeadams
Since I've been playing with NixOS, this project reminded me of
[https://github.com/LnL7/nix-darwin](https://github.com/LnL7/nix-darwin) which
lets you use a system-wide configuration.nix on OS X. Never tried it but it
looks neat.

~~~
mitchty
I actually use this, using it to replace my old ansible setup. I've got a lot
of things I need to merge into there after more testing but yep its neat.

Not as great as the nixos version but every bit helps.

------
vr46
Nice, but I think the days of Chef/Puppet/Ansible-based setups might be gone.
Boxen is deprecated in favour of the excellent Strap:
[https://github.com/mikemcquaid/strap](https://github.com/mikemcquaid/strap)
which I have customized to use a post-completion script to configure defaults
(e.g.
[https://github.com/mathiasbynens/dotfiles/blob/master/.macos](https://github.com/mathiasbynens/dotfiles/blob/master/.macos))
and initial setup of Vim. Homebrew and shell scripting.

What more could you need? :)

------
nmat
I thought several times about having an automated environment setup for my
personal laptop, but I usually come to the conclusion that the time it would
take me to maintain these scripts would probably exceed the time I spend doing
the setup every 3-4 years (xkcd
[https://xkcd.com/1319/](https://xkcd.com/1319/)).

I usually now just install things as I need them and I feel that it is a
smooth process. Installing software and managing packages has become much
easier in recent years.

~~~
matt_wulfeck
Me too. I've settled on just storing my dotfiles in dropbox as good enough.
Just upgraded to a MBP and it was no issue.

~~~
vlunkr
In addition to dotfiles I keep a Brewfile around, so I can run the 'brew
bundle' command and install everything, including brew casks.

~~~
crymer11
`brew bundle` has become quite handy. There isn't much I can't automate the
install of now that it supports the Mac App Store too.

------
eslaught
[https://github.com/geerlingguy/macos-virtualbox-
vm](https://github.com/geerlingguy/macos-virtualbox-vm)

Thanks for this. I'm going to have to try these instructions at some point. A
while back I was trying to do this, and couldn't make any of the instructions
work. TL;DR: Installing macOS in a VM is more trouble than it's worth. I gave
up and switched to VMWare instead, but I'd prefer to stick to VirtualBox since
it's what I use for everything else.

------
ronaldvalente
Very nicely done, I do a clean install every point release of macOS so having
automation such as this has been crucial.

------
msbarnett
First one of these in ages I've seen that isn't riddled with settings that
will silently reduce system security for anyone foolish enough to run it.

Be aware it does apply some pretty idiosyncratic settings from his dotfiles,
though, like disabling sleep and hibernate. I'd take some time to edit those
prior to using.

~~~
bartvk
Exactly. It makes sense when you have a 128 GB SSD, but for most people, it's
a bad idea to disable hibernation. And local Time Machine.

------
foolinaround
wow - this is really cool, and it is a great initiative.

If someone would take a similar approach to installing (on linux) a particular
version of ElementaryOS or linux, and puts together a set of recipes that
would get it all souped up for development etc, that would be really great!!

One can even take it further to use an OS like Bodhi Linux which seems
stripped down for the task, and use ansible instead of the native scripting
etc.

One can get a superb development environment even with an older lower powered
laptop; a lot of the grunt work can be automated away.

This has to be an open-sourced effort because a thousand combinations are
possible and one needs a easy way to select what one needs, and this was my
issue with ninite. It would install everything, and it also would configure
etc .

------
ttaylorr
This seems interesting. I use a Makefile to bootstrap my machine and manage my
dotfiles.

I understand the appeal of Ansible, but I think it's more robust features are
most useful in more complex environments than a personal laptop. My Makefile
seems to do the trick.

~~~
nkristoffersen
Do you have your makefile on github?

~~~
hermanhermitage
Looks like this is it:

[https://github.com/ttaylorr/dotfiles/blob/work-
gh/Makefile](https://github.com/ttaylorr/dotfiles/blob/work-gh/Makefile)

~~~
mi100hael
Yuck. What's the point of a Makefile if every single rule is phony?

------
rallycarre
Windows equivalent for application installs(no configuring)
[https://ninite.com/](https://ninite.com/).

~~~
omtinez
I'd say that the Windows equivalent is
[https://chocolatey.org/](https://chocolatey.org/). It has the largest amount
of "packages" from all other similar efforts that I have seen.

~~~
lukeadams
I second Chocolatey. There's also a (supported by Choco) puppet plugin which
makes client installations as simple as

    
    
      package { 'notepadplusplus':
        ensure            => '6.7.5',
        provider          => 'chocolatey',
      }
    

I've used it on a few client machines with no issues.

------
jaequery
itd be cool if theres way to install apps too

~~~
geerlingguy
It is integrated with mas (the CLI helper for the Mac App Store). You just
pass in the IDs of whatever apps you want installed, and it will do the rest
(even prompting for the App Store login).

See the role it's using: [https://github.com/geerlingguy/ansible-role-
mas](https://github.com/geerlingguy/ansible-role-mas)

