Skip to content

wilsonmar/ansible-macos-setup

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This repo is used to setup software on a new OS X laptop for web development by running a script that retrieves from this GitHub repository.

  1. On an existing Mac, clone this repo and view the install.sh file.

    It installs xcode and homebrew because Ansible is installed using Homebrew.

    The script skips over apps already installed.

  2. Edit playbook.yml (described below) and add/remove the apps/utils you want Ansible to install:

    vi playbook.yml
    

    Alternately, instead of vi, use another text editor such as atom, code, etc.

  3. CAUTION: Do not run this on a Mac you've already configured (used for a while). Create a virtual memory instance of a Mac to run this.

    You shouldn't wipe your entire workstation and start from scratch just to test changes to the playbook.

    Instead, you can follow theses instructions for how to build a Mac OS X VirtualBox VM, on which you can continually run and re-run this playbook to test changes and make sure things work correctly.

  4. In a Terminal of a brand-new Mac (after operating system installation) run the install.sh bootstrap command to install the default list of tools and apps defined:

    sh -c "$(curl -fsSL https://raw.githubusercontent.com/wilsonmar/ansible-macos-setup/master/install.sh)"
    

    This runs

    This was test run on OS X Sierra (~10.10.4).

  5. Stop the script (by pressing Ctrl+C) when Ansible asks for the a 'sudo' password.

    Changing to laptop repo dir ...
     
    Running ansible playbook ...
    SUDO password:  ^c
    
  6. Change into the cloned repo dir

    cd laptop
  7. Kick off Ansible manually to process based on its playbook.yml file:

    ansible-playbook playbook.yml -i hosts --ask-sudo-pass -vvvv 
    

    Change configuration

    This can be safely re-run several times after changing the configuration. The script uses Ansible, which is designed to be run several times on the same machine. It installs, upgrades, or skips packages based on what is already installed on the machine.

  8. Edit the file playbook.yml to change what is installed.

  9. Add a comment signal # (or remove it).

    Under Applications: are apps installed by Homebrew Cask.


Playbook.yml applications specified

UI Applications installed using Homebrew Cask:

  • 1password
  • alfred # | http://www.alfredapp.com
  • apptrap # remove associated prefs when uninstalling
  • appzapper # uninstaller
  • bettertouchtool # window snapping. (maybe Moom is more lightweight?)
  • carbon-copy-cloner # backups | https://bombich.com/download
  • cheatsheet # know your shortcuts
  • cyberduck # ftp, s3, openstack
  • dash # totally sick API browser
  • diffmerge # free visual diq
  • disk-inventory-x # reclaim space on your expensive-ass Apple SSD | http://www.derlien.com/
  • dropbox # a worse Mega Sync
  • firefox
  • flux # get more sleep
  • google-chrome
  • imageoptim # optimize images
  • istumbler # network discovery GUI
  • jumpcut # awesome clipboard
  • karabiner # Keyboard customization
  • licecap # GIFs !
  • little-snitch # awesome outbound firewall
  • megasync # a better Dropbox
  • monolingual # remove unneeded osx lang files
  • nvalt # fast note taking
  • qlcolorcode # quick look syntax highlighting
  • qlimagesize # quick look image dimensions
  • qlmarkdown # quick look .md files
  • qlstephen # quick look extension-less text files
  • rowanj-gitx # Awesome gitx fork.
  • sequel-pro # FREE SQL GUI!
  • shortcat # kill your mouse
  • shuttle # ssh management
  • skype #
  • sublime-text3 # (experimental cask) | http://www.sublimetext.com/
  • thunderbird # email
  • tomighty # pomodoro
  • torbrowser # be the noise
  • transmission # torrents
  • tunnelblick # VPN
  • vagrant # | https://www.vagrantup.com/downloads.html
  • vagrant-manager #
  • virtualbox # | https://www.virtualbox.org/
  • vlc

Packages install by Homebrew

Listed alphabetically:

  • autoconf
  • autojump # quickly navigate from cmd line
  • bash # Bash 4
  • boot2docker # obsolete way for running docker on osx
  • brew-cask
  • coreutils # Install GNU core utilities (those that come with OS X are outdated)
  • cowsay # amazing
  • docker # | https://docs.docker.com/installation/mac/
  • findutils # Install GNU find, locate, updatedb, and xargs, g-prefixed
  • git
  • go # golang
  • gpg
  • hub # github
  • keybase # in alpha at time of writing.
  • mtr # better traceroute
  • node
  • npm
  • openssl
  • packer
  • postgresql # yes and nosql
  • python
  • rbenv # ruby. Just installs binaries - assumes you bring in the dotfiles.
  • readline
  • redis
  • rename # rename multiple files
  • rsync
  • ruby-build
  • sqlite # production rails DB
  • the_silver_searcher # fast ack-grep
  • tmux
  • vim
  • wget
  • zsh # Z shell

There are several more utils listed in the playbook.yml - simply uncomment them to include them in your install.

System Settings

It also installs a few useful system preferences/settings/tweaks with a toned-down verson of Matt Mueller's OSX-for Hackers script.

It does some reasonably gnarly stuff e.g.

  • hide spotlight icon
  • disable app Gate Keeper
  • change stand-by delay from 1hr to 12hrs.
  • Set trackpad tracking rate.
  • Set mouse tracking rate.
  • and lots more...

so you need read it very carefully first. (see scripts/system_settings.sh)

TODO: moar sick settings with https://github.com/ryanmaclean/OSX-Post-Install-Script

User Preferences

It then syncs your user prefs with dotfiles+rcm

It grabs the thoughttbot/dotfiles repo, saves it in ~/src/thoughtbot/dotfiles and symlinks it to ~/dotfiles.

It then grabs glennr/dotfiles repo, saves it in ~/src/glennr/dotfiles and symlinks it to ~/dotfiles-local

You probably want to change the dotfile_repo_username variable to match your github username :-)

It then runs rcup to initialize your dotfiles.

MacStore Apps (WIP)

These apps only available via the App Store. (sigh)

TODO: Port bork : https://github.com/mattly/bork/blob/master/types/macstore.sh and do this automagically!

From Apple:

  • Pages
  • Keynote
  • Numbers

From others:

  • Microsoft Office (Word, PowerPoint, Excel, etc. 2016)
  • 1Password
  • Monosnap
  • Tweetbot
  • RadarScope
  • Pixelmator
  • Quick Resizer
  • DaisyDisk
  • Byword
  • Aperture

Application Settings (WIP)

Keep your application settings in sync.

TODO: Add Mackup task

Other

Approach

We've tested it using an OSX 10.10 Vagrant/Virtualbox VM for developing & testing the Ansible scripts.

Simply spin up the Yosemite box in a VM, and have vagrant kick off the laptop setup.

Whats included?

Nada. Well not much. The whole point is to test the process of getting our OSX dev machines from zero to hero.

The Vagrant box we use is a clean-ish install of OSX. However the setup notes above uses Packer, which installs Xcode CLI tools. This can't be automated in an actual test run, and needs user intervention to install.

Test Setup

  1. Get Homebrew Cask

     brew install caskroom/cask/brew-cask
    
  2. Install Vagrant

     brew cask install --appdir="/Applications" vagrant
    
  3. Install VirtualBox;

     brew cask install --appdir="/Applications" virtualbox
    
  4. cd into this project directory;

  5. Run

     vagrant init http://files.dryga.com/boxes/osx-yosemite-10.10.3.0.box;
    
  6. The Vagrantfile should be ready as soon as Vagrant downloads the box;

  7. Start VM

     vagrant up
    

Notes

  • VirtualBox doesn't have Guest additions for Mac OS X, so you can't have shared folders. Instead you can use normal network shared folders.

  • If you are rolling your own box with the OSX VM template, this is the Packer config;

    ```
    packer build \
      -var iso_checksum=aaaabbbbbbcccccccdddddddddd \
      -var iso_url=../out/OSX_InstallESD_10.10.4_14E46.dmg \
      -var update_system=0 \
      -var autologin=true \
      template.json
    ```
    

Author

Glenn Roberts, 2015.

Credits

This project is based off the work of the following folks;

See also:

  • Battleschool is a more general solution than what I've built here. (It may be a better option if you don't want to fork this repo and hack it for your own workstation...).
  • osxc is another more general solution, set up so you can fork the xc-custom repo and get your own local environment bootstrapped quickly.
  • MWGriffin/ansible-playbooks was the original inspiration for this repository, but this project has since been completely rewritten.

About

Setup on a Mac for a developer

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages