Files
ansible-osx-setup/ansible_osx.yml
2021-06-29 08:16:56 +01:00

284 lines
8.0 KiB
YAML

---
- hosts: localhost
tasks:
- name: Install homebrew
include_role:
name: geerlingguy.homebrew
- name: Setup dnsmasq
include_role:
name: dnsmasq
- name: 'add custom homebrew repos'
community.general.homebrew_tap:
name: [
adoptopenjdk/openjdk,
fishtown-analytics/dbt,
heroku/brew,
homebrew/cask-versions,
thoughtbot/formulae,
weaveworks/tap,
]
- name: Install core packages via brew casks
community.general.homebrew_cask:
name: "{{ item }}"
ignore_errors: yes
with_items:
- 1password
- adoptopenjdk/openjdk/adoptopenjdk8
- android-sdk
- android-studio
- dash
- datagrip
- docker
- dropbox
- google-chrome
- google-cloud-sdk
- graphql-playground
- iterm2
- kindle
- microsoft-office
- ngrok
- osxfuse
- postico
- postman
- rstudio
- sketch
- slack
- sublime-text
- telegram
- tunnelblick
- vagrant
- virtualbox
- visual-studio-code
- vlc
- zeplin
- zoomus
- name: "Install homebrew packages"
community.general.homebrew:
name: [
'autoconf',
'automake',
'aws-iam-authenticator',
'awscli',
'bfg',
'coreutils',
'curl',
'dbt@0.18.0',
'direnv',
'dnsmasq',
'erlang',
'fzf',
'gnu-time',
'gpg',
'heroku',
'htop',
'imagemagick@6',
'kubectx',
'kubernetes-cli',
'kubernetes-helm',
'libtool',
'libxslt',
'libyaml',
'mas',
'mysql',
'openssl' ,
'pkg-config',
'postgresql',
'r',
'rcm',
'readline',
'redis',
'sqlite3',
'sshfs',
'terraform',
'tmux',
'unixodbc',
'unzip',
'vim',
'watchman',
'weaveworks/tap/eksctl',
'xz',
'yarn',
'zlib',
'zsh',
]
state: present
update_homebrew: yes
- name: "Link ImageMagick6 as main version (for rmagick gem)"
shell: brew link -f imagemagick@6
- name: Get the path to ZSH
become: false
local_action: command which zsh
register: zsh_path
- name: "Ensure homebrew zsh is in allowed shells"
lineinfile:
path: /etc/shells
line: "{{ zsh_path.stdout }}"
become: true
- name: Install Oh My ZSH
shell: sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
args:
creates: "/Users/{{ lookup('env', 'USER') }}/.oh-my-zsh"
- name: Set ZSH as the default shell
shell: chsh -s $(which zsh) {{ lookup('env', 'USER') }}
become: true
- name: "Create a default ZSH configuration"
template:
src: templates/.zshrc.j2
dest: /Users/{{ lookup('env', 'USER') }}/.zshrc
owner: "{{ lookup('env', 'USER') }}"
force: yes
- name: Create a default VSCode configuration
template:
src: templates/vscode-settings.json.j2
dest: /Users/{{ lookup('env', 'USER') }}/Library/Application Support/Code/User/settings.json
owner: "{{ lookup('env', 'USER') }}"
force: no
- name: Create a default VSCode keuybinding configuration
template:
src: templates/vscode-keybindings.json.j2
dest: /Users/{{ lookup('env', 'USER') }}/Library/Application Support/Code/User/keybindings.json
owner: "{{ lookup('env', 'USER') }}"
force: no
- name: Install VSCode extensions
shell: code --install-extension {{ item }}
with_items:
- apollographql.vscode-apollo
- bradlc.vscode-tailwindcss
- castwide.solargraph
- clinyong.vscode-css-modules
- eamodio.gitlens
- jakebecker.elixir-ls
- kaiwood.endwise
- karunamurti.haml
- ms-vscode-remote.vscode-remote-extensionpack
- ms-vscode.vscode-typescript-tslint-plugin
- msjsdiag.debugger-for-chrome
- rebornix.ruby
- richie5um2.vscode-sort-json
- Tyriar.sort-lines
- vscodevim.vim
- vscoss.vscode-ansible
- wholroyd.jinja
- wingrunr21.vscode-ruby
- xabikos.javascriptsnippets
- streetsidesoftware.code-spell-checker
- fabiospampinato.vscode-todo-plus
- git:
repo: https://github.com/asdf-vm/asdf.git
dest: "/Users/{{ lookup('env', 'USER') }}/.asdf"
version: v0.7.1
- name: "Create a default asdf configuration"
template:
src: templates/.asdfrc.j2
dest: /Users/{{ lookup('env', 'USER') }}/.asdfrc
owner: "{{ lookup('env', 'USER') }}"
force: yes
- name: "Install asdf plugins"
shell: |
source /Users/{{ lookup('env', 'USER') }}/.asdf/asdf.sh
asdf plugin-add {{ item }} || exit 0
with_items:
- ruby
- elixir
- nodejs
- python
- erlang
- name: "Install Default Python"
shell: |
source /Users/{{ lookup('env', 'USER') }}/.asdf/asdf.sh
asdf install python 3.9.1
asdf global python 3.9.1
pip3 install boto
pip3 install ansible
pip3 install jupyterlab
pip3 isntall numpy
pip3 install scipy
pip3 install matplotlib
pip3 install ipython
pip3 install jupyter
pip3 install pandas
pip3 install sympy
pip3 install nose
pip3 install scikit-learn
asdf reshim python
- name: "Install Default Ruby"
shell: |
source /Users/{{ lookup('env', 'USER') }}/.asdf/asdf.sh
asdf install ruby 3.0.0
asdf install ruby 2.7.2
asdf global ruby 3.0.0
gem install bundler -v 2.2.4
gem install cocoapods
gem install rubocop
gem install solargraph
- name: "Install default node"
shell: |
source /Users/{{ lookup('env', 'USER') }}/.asdf/asdf.sh
bash /Users/{{ lookup('env', 'USER') }}/.asdf/plugins/nodejs/bin/import-release-team-keyring
asdf install nodejs 14.15.3
asdf global nodejs 14.15.3
- name: "Install default elixir"
shell: |
source /Users/{{ lookup('env', 'USER') }}/.asdf/asdf.sh
asdf install elixir 1.11.2
asdf global elixir 1.11.2
mix local.hex --force
mix archive.install hex phx_new 1.5.7 --force
- name: Install yarn packages
shell: yarn global add {{ item }} --prefix /usr/local
with_items:
- react-native-cli
- create-react-app
- apollo
- generator-generator
- yo
- name: Install Addroid SDKs etc
shell: yes | sdkmanager "{{ item }}" --sdk_root=/Users/{{ lookup('env', 'USER') }}/Library/Android/sdk
with_items:
- "add-ons;addon-google_apis-google-21"
- "add-ons;addon-google_apis-google-22"
- "add-ons;addon-google_apis-google-23"
- "build-tools;23.0.1"
- "build-tools;23.0.3"
- "build-tools;25.0.2"
- "build-tools;25.0.3"
- "build-tools;26.0.0"
- "build-tools;26.0.1"
- "build-tools;26.0.2"
- "build-tools;26.0.3"
- "build-tools;27.0.3"
- "build-tools;28.0.3"
- "extras;android;m2repository"
- "extras;google;google_play_services"
- "extras;google;m2repository"
- "extras;m2repository;com;android;support;constraint;constraint-layout;1.0.1"
- "extras;m2repository;com;android;support;constraint;constraint-layout;1.0.2"
- "platforms;android-23"
- "platforms;android-25"
- "platforms;android-26"
- "platforms;android-27"
- "platforms;android-28"
- "system-images;android-23;google_apis;x86"
- "system-images;android-26;google_apis;x86"