Git Product home page Git Product logo

ansible-macos-playbook's Introduction

Ansible MacOS Playbook

This is the playbook I use after a clean install of MacOS to set everything up.

Roles/Tasks

  • Install ssh keys (Role ssh)
  • Installs Homebrew packages and app casks (Role homebrew)
  • Installs App Store apps with mas-cli (Role mas)
  • Modifies MacOS settings (Role settings)
  • Install other homebrew packages with custom installation process, e.g. omz (Role custombrew)
  • Stow .dotfiles (Role custombrew, task dotfiles)

Installation

Clone a repo in the home dir

cd ~
git clone https://github.com/sseletskyy/ansible-macos-playbook.git
  1. Install xcode
xcode-select --install
  1. Install homebrew
cd ~
git clone https://github.com/Homebrew/brew homebrew
export PATH=$HOME/homebrew/bin:$PATH
brew update --force --quiet
chmod -R go-w "$(brew --prefix)/share/zsh"
  1. Install ansible
brew install python
pip3 install ansible
cd ~/ansible-macos-playbook
  1. Run ansible-playbook main.yml --verbose --ask-vault-pass. Enter your account password when prompted. Enter vault password when prompted.

  2. Or run specific role only

# ssh
ansible-playbook main.yml -t ssh --verbose --ask-vault-pass

# homebrew
ansible-playbook main.yml -t homebrew --verbose

# mas (Macos App Store)
# make sure you have signed in into icloud
ansible-playbook main.yml -t mas --verbose

# settings
ansible-playbook main.yml -t settings --verbose

# custom homebrew
ansible-playbook main.yml -t custombrew --verbose

Troubleshooting

Mac drains battery in a sleep mode

Here's the solution (need to update to macOS 11.2 RC):

  1. Run command in terminal: sudo pmset -a tcpkeepalive 0

  2. Run command in terminal: sudo pmset -a powernap 0

  3. Make sure these options is not checked: "System Preferences->Battery->Optimized battery charging" and "System Preferences->Battery->Power Adapter->Wake for network access"

  4. Reboot your macbook

ansible-macos-playbook's People

Contributors

jeromegamez avatar sseletskyy avatar

Watchers

James Cloos 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.