Skip to content

Commit 35c5406

Browse files
committed
Add personal changes
Include dockutil: geerlingguy#106 Include bootstrap from geerlingguy#96 (comment) Use osx_defaults module: geerlingguy#79
1 parent cba70eb commit 35c5406

23 files changed

+952
-235
lines changed

.github/FUNDING.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
# These are supported funding model platforms
22
---
3-
github: geerlingguy
4-
patreon: geerlingguy
3+
github: StephenBrown2

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@
22
.DS_Store
33
*.retry
44
roles*
5+
.cache
56
config.yml

README.md

Lines changed: 173 additions & 92 deletions
Original file line numberDiff line numberDiff line change
@@ -1,138 +1,219 @@
1-
<img src="https://raw.githubusercontent.com/geerlingguy/mac-dev-playbook/master/files/Mac-Dev-Playbook-Logo.png" width="250" height="156" alt="Mac Dev Playbook Logo" />
2-
31
# Mac Development Ansible Playbook
42

3+
![Mac Dev Playbook Logo](/files/Mac-Dev-Playbook-Logo.png)
4+
55
[![CI][badge-gh-actions]][link-gh-actions]
66

7+
This work is inspired by [geerlingguy](https://github.com/geerlingguy/mac-dev-playbook)'s work on automating the setup for my MacBook.
8+
79
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 some manual installation steps, but at least it's all documented here.
810

911
This is a work in progress, and is mostly a means for me to document my current Mac's setup. I'll be evolving this playbook over time.
1012

1113
*See also*:
1214

13-
- [Boxen](https://github.com/boxen)
14-
- [Battleschool](http://spencer.gibb.us/blog/2014/02/03/introducing-battleschool)
15-
- [osxc](https://github.com/osxc)
16-
- [MWGriffin/ansible-playbooks](https://github.com/MWGriffin/ansible-playbooks) (the original inspiration for this project)
15+
- [Boxen](https://github.com/boxen)
16+
- [Battleschool](http://spencer.gibb.us/blog/2014/02/03/introducing-battleschool)
17+
- [osxc](https://github.com/osxc)
18+
- [MWGriffin/ansible-playbooks](https://github.com/MWGriffin/ansible-playbooks) (the original inspiration for geerlingguy's project)
19+
- [geerlingguy/mac-dev-playbook](https://github.com/geerlingguy/mac-dev-playbook) (the original inspiration for this project)
20+
- [NileshGule/Mac-dev-playbook](https://github.com/NileshGule/Mac-dev-playbook)
1721

1822
## Installation
1923

20-
1. Ensure Apple's command line tools are installed (`xcode-select --install` to launch the installer).
21-
2. [Install Ansible](https://docs.ansible.com/ansible/latest/installation_guide/index.html).
22-
3. Clone this repository to your local drive.
23-
4. Run `$ ansible-galaxy install -r requirements.yml` inside this directory to install required Ansible roles.
24-
5. Run `ansible-playbook main.yml -i inventory --ask-become-pass` inside this directory. Enter your account password when prompted.
24+
1. Clone this repository to your local drive.
25+
2. Source [`bootstrap.sh`](bootstrap.sh)
26+
3. Run `$ mac::setup`
2527

2628
> Note: If some Homebrew commands fail, you might need to agree to Xcode's license or fix some other Brew issue. Run `brew doctor` to see if this is the case.
2729
2830
### Use with a remote Mac
2931

3032
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](https://www.macstadium.com), you just need to make sure you can connect to it with SSH:
3133

32-
1. (On the Mac you want to connect to:) Go to System Preferences > Sharing.
33-
2. Enable 'Remote Login'.
34+
1. (On the Mac you want to connect to:) Go to System Preferences > Sharing.
35+
2. Enable 'Remote Login'.
3436

3537
> You can also enable remote login on the command line:
3638
>
37-
> sudo systemsetup -setremotelogin on
39+
> ```sh
40+
> sudo systemsetup -setremotelogin on
41+
> ```
3842
3943
Then edit the `inventory` file in this repository and change the line that starts with `127.0.0.1` to:
4044
41-
```
45+
```ini
4246
[ip address or hostname of mac] ansible_user=[mac ssh username]
4347
```
4448
4549
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.
4650

4751
### Running a specific set of tagged tasks
4852

49-
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 `dotfiles`, `homebrew`, `mas`, `extra-packages` and `osx`.
53+
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 `dotfiles`, `homebrew`, `mas`, `extra-packages`, `vscode`, `dock`, and `osx`.
5054

51-
ansible-playbook main.yml -i inventory -K --tags "dotfiles,homebrew"
55+
```sh
56+
ansible-playbook main.yml -i inventory -K --tags "dotfiles,homebrew"
57+
```
5258

5359
## Overriding Defaults
5460

5561
Not everyone's development environment and preferred software configuration is the same.
5662

5763
You can override any of the defaults configured in `default.config.yml` by creating a `config.yml` file and setting the overrides in that file. For example, you can customize the installed packages and apps with something like:
5864

59-
homebrew_installed_packages:
60-
- cowsay
61-
- git
62-
- go
63-
64-
mas_installed_apps:
65-
- { id: 443987910, name: "1Password" }
66-
- { id: 498486288, name: "Quick Resizer" }
67-
- { id: 557168941, name: "Tweetbot" }
68-
- { id: 497799835, name: "Xcode" }
69-
70-
composer_packages:
71-
- name: hirak/prestissimo
72-
- name: drush/drush
73-
version: '^8.1'
74-
75-
gem_packages:
76-
- name: bundler
77-
state: latest
78-
79-
npm_packages:
80-
- name: webpack
81-
82-
pip_packages:
83-
- name: mkdocs
65+
```yaml
66+
homebrew_installed_packages:
67+
- cowsay
68+
- git
69+
- go
70+
71+
mas_installed_apps:
72+
- { id: 443987910, name: "1Password" }
73+
- { id: 498486288, name: "Quick Resizer" }
74+
- { id: 557168941, name: "Tweetbot" }
75+
- { id: 497799835, name: "Xcode" }
76+
77+
composer_packages:
78+
- name: hirak/prestissimo
79+
- name: drush/drush
80+
version: '^8.1'
81+
82+
gem_packages:
83+
- name: bundler
84+
state: latest
85+
86+
npm_packages:
87+
- name: webpack
88+
89+
pip_packages:
90+
- name: mkdocs
91+
```
8492
8593
Any variable can be overridden in `config.yml`; see the supporting roles' documentation for a complete list of available variables.
8694

8795
## Included Applications / Configuration (Default)
8896

8997
Applications (installed with Homebrew Cask):
9098

91-
- [ChromeDriver](https://sites.google.com/a/chromium.org/chromedriver/)
92-
- [Docker](https://www.docker.com/)
93-
- [Dropbox](https://www.dropbox.com/)
94-
- [Firefox](https://www.mozilla.org/en-US/firefox/new/)
95-
- [Google Chrome](https://www.google.com/chrome/)
96-
- [Handbrake](https://handbrake.fr/)
97-
- [Homebrew](http://brew.sh/)
98-
- [LICEcap](http://www.cockos.com/licecap/)
99-
- [LimeChat](http://limechat.net/mac/)
100-
- [MacVim](http://macvim-dev.github.io/macvim/)
101-
- [nvALT](http://brettterpstra.com/projects/nvalt/)
102-
- [Sequel Pro](https://www.sequelpro.com/) (MySQL client)
103-
- [Skitch](https://evernote.com/skitch/)
104-
- [Slack](https://slack.com/)
105-
- [Sublime Text](https://www.sublimetext.com/)
106-
- [Transmit](https://panic.com/transmit/) (S/FTP client)
107-
- [Vagrant](https://www.vagrantup.com/)
99+
- android-messages # Desktop client for Android Messages
100+
- android-studio # Tools for building Android applications
101+
- appgate-sdp-client # Software-defined perimeter for secure network access
102+
- balance-lock # Keep your Mac audio centred
103+
- balenaetcher # Tool to flash OS images to SD cards & USB drives
104+
- cheatsheet # Tool to list all active shortcuts of the current application
105+
- day-o # A simple menu bar clock replacement
106+
- dbeaver-community # Free universal database tool and SQL client
107+
- discord # Voice and text chat software
108+
- disk-inventory-x # Disk usage utility
109+
- docker # App to build and share containerized applications and microservices
110+
- dozer # Tool to hide status bar icons
111+
- dupeguru # Finds duplicate files in a computer system
112+
- firefox-developer-edition # Web browser
113+
- font-fantasque-sans-mono # Fantasque Sans Mono
114+
- font-firacode-nerd-font # FiraCode Nerd Font (Fira Code)
115+
- font-hack-nerd-font # Hack Nerd Font (Hack)
116+
- font-ia-writer-mono # iA Writer Mono
117+
- freemind # Mind-mapping software written in Java
118+
- gitkraken # Git client focusing on productivity
119+
- google-backup-and-sync # Access and sync your Google Drive content
120+
- google-chrome # Web browser
121+
- gramps # Genealogy software
122+
- iina # Free and open-source media player
123+
- insomnia # HTTP and GraphQL Client
124+
- iterm2-beta # Terminal emulator as alternative to Apple's Terminal app
125+
- licecap # Animated screen capture application
126+
- meld # Visual diff and merge tool
127+
- muzzle # Silence embarrassing notifications while screensharing
128+
- rectangle # Move and resize windows using keyboard shortcuts or snap areas
129+
- robo-3t # MongoDB management tool
130+
- session-manager-plugin # Plugin for AWS CLI to start and end sessions that connect to managed instances
131+
- signal-beta # Instant messaging application focusing on security
132+
- slack # Team communication and collaboration software
133+
- the-unarchiver # Unpacks archive files
134+
- tunnelblick # Free and open-source OpenVPN client
135+
- vagrant # Development environment
136+
- virtualbox # Free and open-source hosted hypervisor for x86 virtualization
137+
- visual-studio-code # Open-source code editor
138+
- wkhtmltopdf # open source (LGPLv3) command line tool to render HTML into PDF
139+
- wombat # Cross platform gRPC client
140+
- yubico-yubikey-manager # Cross-platform application for configuring any YubiKey over all USB interfaces
141+
- zenmap # Multi-platform graphical interface for official Nmap Security Scanner
142+
- zoom # Video communication and virtual meeting platform
143+
- zoom-outlook-plugin # Outlook Plugin for Zoom.us
108144

109145
Packages (installed with Homebrew):
110146

111-
- autoconf
112-
- bash-completion
113-
- doxygen
114-
- gettext
115-
- gifsicle
116-
- git
117-
- go
118-
- gpg
119-
- hub
120-
- httpie
121-
- iperf
122-
- libevent
123-
- sqlite
124-
- mcrypt
125-
- nmap
126-
- node
127-
- nvm
128-
- php
129-
- ssh-copy-id
130-
- cowsay
131-
- readline
132-
- openssl
133-
- pv
134-
- wget
135-
- wrk
147+
- ansible # Automate deployment, configuration, and upgrading
148+
- ansible-lint # Checks ansible playbooks for practices and behaviour
149+
- bat # Clone of cat(1) with syntax highlighting and Git integration
150+
- bitwarden-cli # Secure and free password manager for all of your devices
151+
- broot # New way to see and navigate directory trees
152+
- caddy # Powerful, enterprise-ready, open source web server with automatic HTTPS
153+
- cowsay # Configurable talking characters in ASCII art
154+
- curl # Get a file from an HTTP, HTTPS or FTP server
155+
- dive # A tool for exploring each layer in a docker image
156+
- docker-compose # Isolated development environments using Docker
157+
- ericm/stonks/stonks # A terminal based stock visualizer and tracker.
158+
- exa # Modern replacement for 'ls'
159+
- fd # Simple, fast and user-friendly alternative to find
160+
- gh # GitHub command-line tool
161+
- git # Distributed revision control system
162+
- git-extras # Small git utilities
163+
- go # Open source programming language to build simple/reliable/efficient software
164+
- gobuffalo/tap/buffalo # Rapid Web Development w/ Go
165+
- gofumpt # Stricter gofmt
166+
- graphviz # Graph visualization software from AT&T and Bell Labs
167+
- helm # Kubernetes package manager
168+
- homeassistant-cli # Command-line utility for Home Assistant
169+
- httpie # User-friendly cURL replacement (command-line HTTP client)
170+
- hugo # Configurable static site generator
171+
- jawshooah/pyenv/pyenv-default-packages # Automatically install packages in python environments
172+
- jq # Lightweight and flexible command-line JSON processor
173+
- kubectx # Tool that can switch between kubectl contexts easily and create aliases
174+
- lazydocker # Lazier way to manage everything docker
175+
- molecule # Automated testing for Ansible roles
176+
- moreutils # Collection of tools that nobody wrote when UNIX was young
177+
- mosh # Remote terminal application
178+
- muffet # Fast website link checker in Go
179+
- multitail # Tail multiple files in one terminal simultaneously
180+
- node # Platform built on V8 to build network applications
181+
- nvm # Manage multiple Node.js versions
182+
- openssl # Cryptography and SSL/TLS Toolkit
183+
- pandoc # Swiss-army knife of markup format conversion
184+
- pgcli # CLI for Postgres with auto-completion and syntax highlighting
185+
- pipx # Execute binaries from Python packages in isolated environments
186+
- poetry # Python package management tool
187+
- pre-commit # Framework for managing multi-language pre-commit hooks
188+
- pv # Monitor data's progress through a pipe
189+
- pyenv-ccache # Make Python build faster, using the leverage of `ccache`
190+
- pyenv-pip-migrate # Migrate pip packages from one Python version to another
191+
- qrencode # QR Code generation
192+
- rclone # Rsync for cloud storage
193+
- ripgrep # Search tool like grep and The Silver Searcher
194+
- rust # Safe, concurrent, practical language
195+
- shellcheck # Static analysis and lint tool, for (ba)sh scripts
196+
- shihanng/gig/gig # gitignore file generator
197+
- sl # Prints a steam locomotive if you type sl instead of ls
198+
- sqlite # Command-line interface for SQLite
199+
- ssh-copy-id # Add a public key to a remote machine's authorized_keys file
200+
- starship # Cross-shell prompt for astronauts
201+
- stoken # Tokencode generator compatible with RSA SecurID 128-bit (AES)
202+
- tealdeer # Very fast implementation of tldr in Rust
203+
- tlk/imagemagick-x11/imagemagick # Tools and libraries to manipulate images in many formats (X11 support)
204+
- tokei # Program that allows you to count code, quickly
205+
- tox # Generic Python virtualenv management and test command-line tool
206+
- tree # Display directories as trees (with optional color/HTML output)
207+
- watch # Executes a program periodically, showing output fullscreen
208+
- wget # Internet file retriever
209+
- wireguard-tools # Tools for the WireGuard secure network tunnel
210+
- wrk # HTTP benchmarking tool
211+
- yadm # Yet Another Dotfiles Manager
212+
- yarn # JavaScript package manager
213+
- youtube-dl # Download YouTube videos from the command-line
214+
- yq # Process YAML documents from the CLI
215+
- zsh # UNIX shell (command interpreter)
216+
- zsh-history-substring-search # Zsh port of Fish shell's history search
136217

137218
My [dotfiles](https://github.com/geerlingguy/dotfiles) are also installed into the current user's home directory, including the `.osx` dotfile for configuring many aspects of macOS for better performance and ease of use. You can disable dotfiles management by setting `configure_dotfiles: no` in your configuration.
138219

@@ -144,16 +225,16 @@ Finally, there are a few other preferences and settings added on for various app
144225

145226
It's my hope that I can get the rest of these things wrapped up into Ansible playbooks soon, but for now, these steps need to be completed manually (assuming you already have Xcode and Ansible installed, and have run this playbook).
146227

147-
1. Install [Sublime Package Manager](http://sublime.wbond.net/installation).
148-
2. Remap Caps Lock to Escape (requires macOS Sierra 10.12.1+).
149-
3. Set trackpad tracking rate.
150-
4. Set mouse tracking rate.
151-
5. Configure extra Mail and/or Calendar accounts (e.g. Google, Exchange, etc.).
228+
1. Remap Caps Lock to Escape (requires macOS Sierra 10.12.1+).
229+
2. Set trackpad tracking rate.
230+
3. Set mouse tracking rate.
231+
4. Configure extra Mail and/or Calendar accounts (e.g. Google, Exchange, etc.).
152232

153-
### Configuration to be added:
233+
### Configuration to be added
154234

155-
- I have vim configuration in the repo, but I still need to add the actual installation:
156-
```
235+
- I have vim configuration in the repo, but I still need to add the actual installation:
236+
237+
```sh
157238
mkdir -p ~/.vim/autoload
158239
mkdir -p ~/.vim/bundle
159240
cd ~/.vim/autoload

bootstrap.sh

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
#!/usr/bin/env bash
2+
3+
#set -eoup
4+
5+
function mac::ensure-upstream() {
6+
if [ ! -d mac-dev-playbook ]; then
7+
git clone https://github.com/geerlingguy/mac-dev-playbook
8+
cd mac-dev-playbook
9+
git remote rename origin upstream
10+
else
11+
cd mac-dev-playbook
12+
git fetch --all
13+
git rebase upstream master
14+
cd -
15+
fi
16+
}
17+
18+
function mac::ensure-dependencies() {
19+
xcode-select --install || true
20+
/usr/bin/env bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
21+
brew install ansible mas
22+
ansible-galaxy install -r requirements.yml
23+
}
24+
25+
function mac::apply() {
26+
# cd mac-dev-playbook
27+
# [ ! -f config.yml ] && ln -s ../config.yml .
28+
ansible-playbook main.yml -i inventory --ask-become-pass
29+
}
30+
31+
function mac::setup() {
32+
mac::ensure-dependencies
33+
# mac::ensure-upstream
34+
mac::apply
35+
}

0 commit comments

Comments
 (0)