Skip to content

jaanhio/mac-development-setup

Repository files navigation

Mac Development Ansible Setup (WIP)

This contains ansible code for setting up a Mac with various development related packages/apps for development work.

  • homebrew apps/packages setup (completed)
  • dotfile setup (WIP)
  • mac configuration setup (WIP)

Pre-setup steps

These steps have to be executed manually in order to get ansible onto local machine.

1. Install Apple CLI tools. Open terminal and run xcode-select --install.

xcode-select --install

2. Set up SSH key for github access.

3. Clone repo to local machine.

Due to high possibility of running into permission issues when installing packages via homebrew, be sure to make sure the relevant permissions to folders have been given. This can be checked via brew doctor.

5. Install latest version of python (python3) and pip (pip3) by running brew install python.

brew install python

Read this for additional info on setting up python.

6. Update pip to latest version.

pip3 install --user --upgrade pip

OR

python3 -m pip install --user --upgrade pip

7. Install Ansible using pip.

python3 -m pip install --user ansible

Python installer installs modules at /Users/<user>/Library/Python/<version number>/bin. Add to PATH.

export PATH=/Users/<user>/Library/Python/<version number>/bin:$PATH
echo "export PATH=/Users/$(whoami)/Library/Python/3.9/bin:$PATH" | tee -a ~/.zshrc

Setup

Run playbook inside this directory.

ansible-playbook main.yml -i inventory --ask-become-pass

Using custom collection

It is possible to overwrite Ansible collection referenced in playbooks to test custom collections/changes/bug fixes

ANSIBLE_COLLECTIONS_PATH=<ansible-collection-top-level-directory> ansible-playbook -i inventory test-ansible-dev.yaml

where ansible-collection-top-level-directory contains ansible_collections/<ansible-collection-path>

└── ansible_collections
    └── community
        └── general

ZSH theme setup

oh-my-zsh is used to customize the terminal shell. Theme used is Power10K https://github.com/romkatv/powerlevel10k Theme configuration file can be found at /files/dotfile/.p10k.zsh. iTerm profile can be found at /files/P10K.json.

Color depends on 2 things:

  • P10K configuration value
  • iTerm color palette

For more iTerm color schemes: https://iterm2colorschemes.com/

To see how the different color code set in P10K file will be rendered, run:

for i in {0..255}; do print -Pn "%K{$i}  %k%F{$i}${(l:3::0:)i}%f " ${${(M)$((i%6)):#3}:+$'\n'}; done

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published