Mac-dev-playbook – Mac setup and configuration via Ansible
github.com
github.com
For those interested: https://github.com/carlosonunez/setup
Haven't needed that extension for a while because I'm actually busy these days!
1. Playbooks are not a complete programming language for a good reason. You just get a simple linear flow of tasks with limited loops and conditions, so they're hard to make unreadable, unlike full-blown programming languages, like Python in Fabric or Ruby in Chef.
2. Yes, using shell commands for things that can be done using modules is frowned upon, but nobody is going to physically frown at you, so don't worry about it too much :) I drop down to shell/command/script modules whenever I need to without giving it a single thought.
3. Yes, the modules are often less powerful than the underlying tools. The other side is that they return nicely parsed data and changed/not changed status, so you can analyze their results more easily than shell commands.
4. Yes, ansible has immense advantages over shell scripting whenever one or more applies (generally the "manage a fleet of servers" scenario, not the "set up a dev box" one): - you need to coordinate configuration between multiple machines (sshing back and forth is just clumsy in comparison) - the playbook is to be used more than once (e.g. evolving configuration) -- I can't imagine my life right now without diffs and check mode. This also makes developing/debugging playbooks much easier than scripts, e.g. I recently wrote a hairy migration tool as a playbook and could easily see all the changes it would do without applying them - some things are just easier in ansible (template and lineinfile come to the top of my head, plus everything is parsed for you into easily usable data structures)
5. I'd probably use ansible to set up my own machine if I ever got to automating the task, but you're right: learning ansible just for that makes little sense.
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.
https://www.stavros.io/posts/provisioning-your-computer-one-...
It's a great way to synchronize state between computers, including installed packages, fonts, Vim plugins, etc.
It goes much further than dotfiles.
Strap is a script to bootstrap a minimal OS X development system. This does not assume you're doing Ruby/Rails/web development but installs the minimal set of software every OS X developer will want.
Not as great as the nixos version but every bit helps.
What more could you need? :)
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.
Once you've got a script, then it'll just be a minor annoyance if you have to reinstall at an inconvenient time. Personally, I've got a combination of a script, plus a set of notes. I haven't automated everything, just the easy parts.
But then again for a REAL quick installation, I've restored from Time Machine as well.
I performed an installation of Arch Linux on a ThinkPad W530, carefully documenting every little thing I did (lots of minor "tweaks" to get ZFS just the way I want it, my Yubikeys working with LUKS at boot, etc.).
Once that was up and running, I started writing Ansible roles to configure the system exactly to my liking. It was very time consuming at first, as I made sure to do every little thing "the right way" and so on. Eventually I started taking shortcuts in the interest of time, as I can always go back later and clean things up.
Once I get everything I need taken care of by Ansible, I'll reinstall the laptop and let Ansible loose as one last "verification", then I'll do the same thing for my workstation. I should end up with two almost identical machines that are configured exactly how I want them. Changes I make later can be "replicated" to the other host simply by updating my repo and re-running my playbooks. I'm going to try my best to avoid any ad-hoc changes but we'll see how that goes...
I work from home 95% of the time and the laptop is mostly for when SHTF and I have to grab it and go (network engineer for an ISP, so that usually means "something bad has happened"). I'm confident that I won't end up out in the field somewhere without access to certain files I need or documentation or whatever and the environments being almost identical means I won't have to deal with those annoying little inconsistencies between machines at the worst possible time.
It's time-consuming, for sure, but I think the end result will be worth it.
https://www.stavros.io/posts/provisioning-your-computer-one-...
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.
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.
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 .
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.
https://gist.github.com/talentdeficit/253fd1eaf25cb41e5c24a4...
package { 'notepadplusplus':
ensure => '6.7.5',
provider => 'chocolatey',
}
I've used it on a few client machines with no issues.See the role it's using: https://github.com/geerlingguy/ansible-role-mas
http://lifehacker.com/mas-updates-and-installs-mac-app-store...
The mas utility can be installed via a quick "brew install mas".