Skip to content

greylabel/mac-dev-playbook

Repository files navigation

Mac Development Ansible Playbook

[![CI][badge-gh-actions]][link-gh-actions]

Based on the Mac Development Ansible Playbook by Jeff Geerling (geerlingguy).

Installation

See the full from-scratch setup document full-mac-setup.md for more details.

Setup goes through the following automated [A] and manual [M] steps.

macOS installation and initiation setup

  1. [M] Install macOS
  2. [M] Sign in to iCloud and the App Store and run software update
  3. [M] Install Xcode command line tools and agree to license
  4. [M] Install Rosetta (Apple silicon)
  5. [M] Install apps that won't be handled through automation

Python and Ansible

  1. [M] Add python3 to $PATH, update packages, and install ansible
  2. [M] Clone or download the (this) Mac Development Ansible Playbook.
    1. [M] Copy in additional config files and vaults.
    2. [M] Install requirements and run playbook.

Ansible playbook

  1. [A] Ensure OS X Command Line Tools are installed
  2. [A] Create home directories for source code and websites
  3. [A] Create SSH key and config, add key to SSH Agent, setup git commit signing
  4. [A] Install packages and apps with Homebrew
  5. [A] Install and symlink dotfiles
  6. [A] Install apps from the Mac App Store
  7. [A] Configure macOS Dock
  8. [A] Install packages from other package managers, e.g. composer, pip
  9. [A] Configure masOS

Manual configuration

  1. [M] Install non-managed software, e.g. Node
  2. [M] Configure macOS, System Application, User and Cloud Applications
  3. [M] Manually copy other assets, e.g. fonts, repos, documents

Cleanup

  1. [M] Clean up temporary artifacts

Running without a specific tag

ansible-playbook main.yml --ask-become-pass --skip-tags "post"

Running a specific set of tagged tasks

You can filter which part of the provisioning process to run by specifying a set of tags using ansible-playbook's --tags flag. The tags available are pre, post, dotfiles, homebrew, mas, extra-packages and osx.

ansible-playbook main.yml -K --tags "dotfiles,homebrew"

Use with a remote Mac

You can use this playbook to manage other Macs as well; the playbook doesn't even need to be run from a Mac at all! If you want to manage a remote Mac, either another Mac on your network, or a hosted Mac like the ones from MacStadium, you just need to make sure you can connect to it with SSH:

Enable Remote Login on the Mac you want to connect to:

  • System Settings -> General -> Sharing -> Remote Login = On

You can also enable remote login on the command line:

`sudo systemsetup -setremotelogin on`

Then edit the inventory file in this repository and change the line that starts with 127.0.0.1 to:

[ip address or hostname of mac]  ansible_user=[mac ssh username]

If you need to supply an SSH password (if you don't use SSH keys), make sure to pass the --ask-pass parameter to the ansible-playbook command.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages