From 25df194b0c911ca34f0ab69e5057b373e12609f9 Mon Sep 17 00:00:00 2001 From: Ben Dixon Date: Fri, 1 Jan 2021 15:43:12 +0800 Subject: [PATCH] Adds: updated readme and fixes for Python installation on Big Sur --- README.md | 46 ++++++++++++++++++++-------------------------- ansible_osx.yml | 9 +++------ bin/bootstrap | 1 + 3 files changed, 24 insertions(+), 32 deletions(-) diff --git a/README.md b/README.md index fb98253..ecfa840 100644 --- a/README.md +++ b/README.md @@ -1,38 +1,32 @@ -Install Xcode +# MacOS Setup with Ansible -Accept license: +This repository contains an Ansible configuration for setting up a Mac from scratch. It's primary purpose is setting up a new Mac from scratch, but I endeavor to also use it for adding new software as I go so that it remains up to date. At the moment it's being used for setting up Intel based Macs running MacOS Big Sur. -``` -sudo xcodebuild -license -``` +## Getting Started -Install Ansible +There's a simple shell script in `bin/bootstrap` which will perform the initial steps of: -``` -sudo easy_install pip -sudo pip install --ignore-installed ansible -``` +1. Installing Xcode +2. Installing Ansible +3. Fetching required Ansible roles and collections -Get community.general collection: +And then runs the main playbook `ansible_osx.yml`. -``` -ansible-galaxy install -r requirements.yml -``` +For future updates, `bin/apply` can be used to run just the Ansible playbook without the setup commands. -To run playbook: +## What's installed -``` -ansible-playbook -i "localhost," -c local ansible_osx.yml --ask-become-pass -``` +The easiest way to understand what's installed is to read the contents of `ansible_osx.yml`, this configuration is fairly specific to the range of development I do personally, but may serve as a useful starting point for others. The core components are: -You can run a role directly with: +- ZSH + Oh My Zsh as the primary shell +- Homebrew for package management +- ASDF for version management (along with plugins and default versions for ruby, python, javascript, elixir and erlang) +- Virtualbox, Vagrant and Docker +- VSCode + default plugins and configuration +- A selection of Android SDK's +- Lots of other tools and utilities -``` -ansible localhost -m include_role -a name=dnsmasq --ask-become-pass -``` - -## Structure - -- +## Customising +Almost anything can be customised by editing `ansible_osx.yml`. diff --git a/ansible_osx.yml b/ansible_osx.yml index 100410b..c739dfd 100644 --- a/ansible_osx.yml +++ b/ansible_osx.yml @@ -191,15 +191,12 @@ - name: "Install Default Python" shell: | - export LDFLAGS="${LDFLAGS} -L/usr/local/opt/zlib/lib" - export CPPFLAGS="${CPPFLAGS} -I/usr/local/opt/zlib/include" - export PKG_CONFIG_PATH="${PKG_CONFIG_PATH} /usr/local/opt/zlib/lib/pkgconfig" source /Users/{{ lookup('env', 'USER') }}/.asdf/asdf.sh - asdf install python 3.7.3 - asdf global python 3.7.3 + asdf install python 3.9.1 + asdf global python 3.9.1 pip3 install boto pip3 install ansible - pip3 install jupyterlab` + pip3 install jupyterlab pip3 isntall numpy pip3 install scipy pip3 install matplotlib diff --git a/bin/bootstrap b/bin/bootstrap index 138e18c..c462667 100755 --- a/bin/bootstrap +++ b/bin/bootstrap @@ -1,4 +1,5 @@ #!/bin/sh +xcode-select --install sudo xcodebuild -license sudo easy_install pip sudo pip install --ignore-installed ansible