Giter Site home page Giter Site logo

juanedu / macbook-playbook Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mpereira/macbook-playbook

0.0 0.0 0.0 4.97 MB

Install all your applications and configure everything the way you like it with one command

Shell 63.68% AppleScript 2.52% Makefile 19.75% Qt Script 14.04%

macbook-playbook's Introduction

macbook-playbook

Install all your applications and configure everything the way you like it with one command.

Table of Contents

Tested on

I’ve been using macbook-playbook since 2013. I’ve used it on at least six MacBook Pros with different macOS versions. As of March 2021 I use it on both my current MacBook Pros, one with Catalina and the other with Big Sur installed.

Please open an issue if you’re trying this out and bump into anything.

Bootstrap machine (make bootstrap)

These are one-time steps that need to be done on machines that are running macbook-playbook for the first time.

Install Developer Tools (xcode-select)

Open the “Terminal” application, type git into the shell and follow the instructions to install the Apple Developer Tools.

Clone repository

Now your machine should have git and python3 installed.

git clone https://github.com/mpereira/macbook-playbook.git

Give Terminal/iTerm2/Emacs/etc. assistive access

Depending on your macOS version you will be queried or not for assistive access while make converge runs. This is required for example to remap caps lock to control.

In case that task fails, or if you want to do it beforehand just in case, go to “System Preferences > Security & Privacy > Privacy > Accessibility” and add the application running macbook-playbook (Terminal/iTerm2/Emacs/etc.) to the list.

Create an Ansible Vault password

This password will be used to encrypt and decrypt the files referenced in the Encrypted files section. Please make sure to use a strong password.

echo 'SomePassword123$' > .ansible_vault_password

Encrypted files (using Ansible Vault)

The following files currently checked into this git repository are encrypted with my personal Ansible Vault password. Unless you have my password, roles referencing these files will fail to run.
DescriptionFileRole
AWS CLI credentialssecrets/aws_credentials_fileawscli
BetterTouchTool licensesecrets/better_touch_tool_license_filebetter-touch-tool
DaisyDisk licensesecrets/daisydisk_registration_key_filedaisydisk
Enviroment variables for dotfilessecrets/mpereira_dotfiles_environment_yml_filedotfiles
iStat Menus settingssecrets/istat_menus_settings_fileistat-menus
Prey API keysecrets/prey_api_key_yaml_fileprey
Private SSH keysecrets/mpereira_at_pluto_ssh_private_keyssh-keys
s3cmd configurationsecrets/s3cmd_cfg_files3cmd

You have two choices: skip these roles, and/or overwrite the encrypted files with your own.

To overwrite them first run

make truncate-sensitive-files

And then you’ll be able to overwrite them with your own files (for example your own ~/.ssh/id_rsa) and then encrypt them with make encrypt.

To skip them, when you reach the provision machine step, make Ansible skip roles tagged with uses-secrets. You don’t need to run this now, the command below is just an example.

make converge ARGS='--skip-tags uses-secrets'

Prepare machine to run the Ansible playbooks

This will:

  1. Set up passwordless sudo
  2. Install a user Python3
  3. Install Ansible
  4. Set up the Git pre-commit hook that automatically encrypts secrets before Git commits
make bootstrap

Your machine should now be ready to be provisioned! You won’t need to run the above steps again.

Configure machine (make converge)

Now that the machine is bootstrapped, we can provision it.

Provision machine

This runs all non-disabled roles in =main.yml=.
make converge ARGS='--skip-tags disabled'

ansible-playbook arguments can be passed via the ARGS environment variable. For example, --tags can be passed so that only matching roles are run.

make converge ARGS='--tags google-chrome'

--skip-tags can also be passed to avoid running certain roles.

make converge ARGS='--skip-tags disabled,unity'

All role tags can be seen in =main.yml=.

Tasks may fail due to intermittent reasons like temporary server unavailability. When a task fails you can either disable its role via --skip-tags or use --start-at-task with the name value of some task to cause Ansible to start the playbook exactly there.

For example, if the “Install Emacs” task from the “build-emacs” role fails for what seems to be an intermittent issue, you can pick up provisioning from there so that previous tasks don’t have to re-run.

make converge ARGS='--skip-tags disabled --start-at-task "Install Emacs"'

Check the official Ansible documentation for more details.

Manual steps post make converge

These are steps that are currently not automated because:

  • it would be difficult
  • it would be impossible
  • or I just didn’t have the time

Change keyboard layout to U.S. international

  1. System Preferences -> Keyboard -> Input Sources
  2. Click +
  3. Select “English” on left column
  4. Select “U.S. International - PC” on right column
  5. Click “Add”
  6. Remove other keyboard layouts from the left column

iStat Menus

  1. Import license from roles/istat-menus/files/iStat Menus Settings.ismp

PDF Expert

  1. Register license

Sound Control

  1. Check “Check for updates automatically”
  2. Register license
  3. Preferences > Priority Devices > Output and Input
    • Check “Switch to device when” “Device is attached”
    • Reorder devices in priority list

BetterTouchTool

  1. Register license

Terminal

Preferences > Profiles > Pro > Font

Set to Hack Regular 18 pt.

System Preferences > Security & Privacy > Privacy > Accessibility

  • BetterTouchTool.app
  • Dropbox
  • Emacs.app
  • Persephone.app
  • RescueTime
  • VLC

System Preferences > Keyboard > Shortcuts > Mission Control

Uncheck:

  • Mission Control
  • Move left a space
  • Move right a space
  • Switch to desktop 1

Roles

Installs

Desktop Applications

Text Editors

Configuration

Programming Languages

Multimedia

Fonts

Browser Plugins

Virtualization, Provisioning, Containers and System Tools

Package Managers and Build Tools

Shell

Programming Utilities

Data Systems

  • Apache Hadoop (disabled by default, it conflicts with the yarn JavaScript package manager)

Configuration, Monitoring and Debugging

Document Processors and Plotting

Markup Tools

Command line tools

Security

GNU Command Line Tools

  • binutils
  • coreutils
  • diffutils
  • ed
  • findutils
  • gawk
  • gnu-indent
  • gnu-sed
  • gnu-tar
  • gnu-which
  • gnutls
  • grep
  • gzip
  • screen
  • watch
  • wdiff
  • wget

Miscellaneous

Configures

Makes Google Chrome the default browser

Passwordless sudo

Puts SSH keys in place

Remaps Caps-Lock to Control

Author

Murilo Pereira

License

MIT

macbook-playbook's People

Contributors

mpereira avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.