Ansible for Configuring Your Mac - SO MUCH BETTER
source link: https://fuzzyblog.io/blog/osx/2016/11/20/ansible-for-configuring-your-mac-so-much-better.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
Ansible for Configuring Your Mac - SO MUCH BETTER
Nov 20, 2016
Wow. That's all I have to say. Wow. So even tho I'm fully in the postmac world at this point with an Ubuntu-Mate box running 24/7 right alongside my Mac, I did just purchase a new mac – a top of the line previous generation PowerBook 13. This at least got me a memory upgrade from the paltry 8 gigs on my Macbook Air to 16 gigs. Yes it wasn't the 32 gigs or 64 gigs that I wanted but I can suck it up – even though I still steadfastly maintain that Apple should have shipped Macbook Pros with more memory in a laptop form factor than they've been shipping since 2010. And no I'm not going to let that one go.
Anyway I'm now faced with configuring a brand new Mac. I very specifically don't want to use Time Machine in the event that any of my many recent issues are tied to cruft that has built up since my last machine. So that's out – damn it. Which places me in the spot of an absolutely virgin install. I haven't done this in years. And since I'm a developer that means I need a lot of stuff:
- xcode tools
- all the normal unix crap
- server tools - mariadb, redis and the like
- frameworks like node
- rails / ruby / r* (note this is using rbenv / ruby build to see if I can get out of my current rvm hell; since I'm dumping rvm server side anyone this seemed like a good choice)
- tmux, ah blessed tmux, the love-hate-hate relationship I have with you
And to make matters worse I'm going on the road just after Thanksgiving so I really want this to be right. I'd love to just carry one laptop with me. This means that it needs to be fully working – apps, data, etc.
Happily data is already handled. A few months ago Dv convinced me that Dropbox could handle everything I use on a daily basis so all my data syncs automatically as I work. I can see the little Dropbox notices flashing by on all my boxes. I honestly worry a hell of a lot less about Time Machine than I ever used to because the data I actually care about is a working set of 35 gigs of data which is ALWAYS in place on 1 of at least 4 development boxes.
Apps are a very different matter.
Ansible Stuff I Learned From This Project
Here are some of the things I learned:
- 0.0.0.0 in hosts means "run this on the local box"
- there's a homebrew module
- there's a homebrew_cask module
- there's file globbing
In case you haven't recently been following the arcana of Mac package managers, brew installs command line things like, say, redis. brew cask does the same thing for true mac apps.
References / Examples to Setting Up Your Mac with Ansible
Some of the sources I found are below. There's some great stuff here.
I ended up taking a slightly different approach. I didn't try to be as complete (I mean wow - setting your dock icons) but instead focused on the tools I use and I wanted to get my box to a usable state by morning (i.e. its 2 am when I started; I wanted to be running my code by say 8 am). This constraint meant that I wasn't going to get as specific as say mpereira in moving ssh keys over for example. Nothing wrong with that approach but I want to think it over a bit more before I go there.
Note: Well I wrote the above playbook then I delved deeper into mpereira's stuff and I thought "well this isn't too bad" and damn it if I wasn't moving over knownhosts pretty quick. chuckle – thanks man!
Note: I don't know if the SSH key stuff is right or wrong. I still can't push to github but I'm also having issues with even creating new ssh keys so maybe those issues are part of that. Apologies.
In specific I find that Ansible stuff gets deep and confusing quickly. I wanted to focus on the organization by clearly naming exactly what's going on. All my install roles, for example, start with "install_". I did everything with a focus on clarity right down to avoiding pkg lists; that just felt right (verbose but right).
Here's mine:
If you're at all technical I'd highly recommend this as an approach for setting up a new Mac. I did some reading and then starting in about 4 hours I managed to get almost everything I needed setup. Yes the per app config happened post install but I don't think that I could have possibly installed just all the stuff I need manually in that amount of time. Scratch that – I COULD NOT POSSIBLY HAVE DONE THIS AS QUICKLY. Beyond Recommended.
Recommend
-
8
In aprevious article, I covered Red Hat Ansible basics and installed Ansible, creating one control node named RHEL8 and four managed nodes ( node1 ,
-
7
Configuring sql.DB for Better Performance Last updated: 9th April 2020 Filed under:
-
10
Configuring Your Mac with Ansible Take 2 Jul 31, 2017 The last new Mac I setup was back in 2016, November...
-
11
Ansible Tutorial 02 - Configuring a Sidekiq Upstart Job on Ubuntu 14.04 Oct 13, 2016 As I've now noted a number of times, I'm in the process of a large scale AWS migration and we've had stability problems. Unlike previ...
-
5
Elixir Alchemy Configuring your Elixir Application at Runtime with Vapor Devon Estes on Apr 28, 2020 “I absolutely love AppSignal.”
-
6
Configuring Grails to use your own DataSource or Standard DataSource proxy advertisements In an application I want to use my own implementatio...
-
5
NAS 101: Setting Up and Configuring Your NAS March 2, 2021 by Skip Levens //
-
7
Mac Development Ansible Playbook This playbook installs and configures most of the software I use on my Mac for web and software development. Some things in macOS are slightly difficult to automate, so I still have a few manual insta...
-
6
Mac Mail — Configuring email (current versions) Overview This article describes how to configure email using the following versions of Mac Mail: 12.4 (Mojave) ...
-
9
Configuring Ansible's container image registry: What you need to know Consider your options for configuring and maintaining your...
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK