Skip to content

Instantly share code, notes, and snippets.

@NileshGule
Last active July 5, 2017 02:27
Show Gist options
  • Save NileshGule/b495d283997c44e4397179cd4756240c to your computer and use it in GitHub Desktop.
Save NileshGule/b495d283997c44e4397179cd4756240c to your computer and use it in GitHub Desktop.
Gist for storing files for Ansible Mac Setup
---
downloads: ~/.ansible-downloads/
general:
local_home: "{{ lookup('env','HOME') }}"
user_name: "{{ lookup('env', 'USER') }}"
configure_dotfiles: no
configure_sudoers: yes
configure_terminal: yes
configure_osx: yes
dotfiles_repo: https://github.com/geerlingguy/dotfiles.git
dotfiles_repo_accept_hostkey: yes
dotfiles_repo_local_destination: ~/Dropbox/Development/GitHub/dotfiles
dotfiles_files:
- .bash_profile
- .gitignore
- .inputrc
- .osx
- .vimrc
homebrew_upgrade_all_packages: yes
homebrew_installed_packages:
# - ansible # Installed via Pip.
- autoconf
- bash-completion
- chromedriver
- docker-compose
- git
- gpg
- node
- nvm
- tree
- zsh
homebrew_taps:
- homebrew/core
- caskroom/cask
#- homebrew/php
homebrew_cask_appdir: /Applications
homebrew_cask_apps:
- atom
- docker
- dropbox
# - fing # Download link keeps getting changed, d'oh!
- firefox
- google-chrome
- github-desktop
- iterm2
- sublime-text
- vagrant
- virtualbox
- visual-studio-code
atom_packages_packages:
- file-icons
- atom-material-ui
- atom-material-syntax-dark
- atom-cform-yaml
- language-yaml-cloudformation
- linter
- linter-js-yaml
- linter-ui-default
# See `geerlingguy.mas` role documentation for usage instructions.
mas_installed_apps: []
mas_email: ""
mas_password: ""
osx_script: "~/.osx --no-restart"
# Install packages from other package managers.
# Note: You are responsible for making sure the required package managers are
# installed, eg. through homebrew.
composer_packages: []
# - name: drush
# state: present # present/absent, default: present
# version: "^8.1" # default: N/A
gem_packages: []
# - name: bundler
# state: present # present/absent/latest, default: present
# version: "~> 1.15.1" # default: N/A
npm_packages:
- iterm2-tab-set
- material-theme
# - name: webpack
# state: present # present/absent/latest, default: present
# version: "^2.6" # default: N/A
pip_packages: []
# - name: mkdocs
# state: present # present/absent/latest, default: present
# version: "0.16.3" # default: N/A
# Glob pattern to ansible task files to run after all other tasks are finished.
post_provision_tasks: []
visual_studio_code_extensions:
- extensionName: autoimport
publisher: steoates
- extensionName: vscode-docker
publisher: PeterJausovec
- extensionName: csharp
publisher: ms-vscode
- extensionName: file-icons
publisher: file-icons
- extensionName: githistory
publisher: donjayamanne
- extensionName: vscode-auto-open-markdown-preview
publisher: hnw
- extensionName: docker-explorer
publisher: formulahendry
# visual_studio_code_extensions:
# - steoates.autoimport
# - PeterJausovec.vscode-docker
# - ms-vscode.csharp
# - file-icons.file-icons
# - donjayamanne.githistory
# - hnw.vscode-auto-open-markdown-preview
# - formulahendry.docker-explorer
---
- hosts: all
connection: local
vars_files:
- default.config.yml
pre_tasks:
- include_vars: "{{ item }}"
with_fileglob:
- ../config.yml
tags: ['always']
roles:
- role: geerlingguy.homebrew
tags: ['homebrew']
- role: geerlingguy.dotfiles
when: configure_dotfiles
tags: ['dotfiles']
- role: geerlingguy.mas
when: mas_installed_apps
tags: ['mas']
- role: hnakamur.atom-packages
tasks:
- include: tasks/ansible-setup.yml
- include: tasks/oh-my-zsh-setup.yml
- include: tasks/visual-studio-code-extensions-setup.yml
- include: tasks/sudoers.yml
when: configure_sudoers
- include: tasks/terminal.yml
when: configure_terminal
#- include: tasks/osx.yml
# when: configure_osx
# tags: ['osx']
- include: tasks/extra-packages.yml
tags: ['extra-packages']
- name: Run configured post-provision ansible task files.
include: "{{ outer_item }}"
loop_control:
loop_var: outer_item
with_fileglob: "{{ post_provision_tasks|default(omit) }}"
---
- name: Clone oh-my-zsh repo
git: repo=https://github.com/robbyrussell/oh-my-zsh.git dest="{{general.local_home}}/.oh-my-zsh"
- name: deploy .zshrc
template: src=files/zshrc.in dest="{{general.local_home}}/conf/zshrc" owner="{{general.user_name}}"
- name: remove standard zshrc
file: path="{{general.local_home}}/.zshrc" state=absent
- name: Create conf folder in home directory
file: path="{{general.local_home}}/conf/" state=directory owner="{{general.user_name}}"
- name: symlink zshrc
file: path="{{general.local_home}}/.zshrc" src="{{general.local_home}}/conf/zshrc" state=link owner="{{general.user_name}}"
#- name: Set zsh as default shell
# user: name=nileshgule shell=/bin/zsh
---
- name: "install VS extensions"
become: yes
become_user: "{{general.user_name}}"
command: "code --install-extension '{{ item.publisher }}'.'{{ item.extensionName }}'"
with_items:
- "{{ visual_studio_code_extensions }}"
register: vscode_result
changed_when: "'already installed' not in vscode_result.stdout"
@NileshGule
Copy link
Author

This gist is based on my repo for setting up development environment for MacBook using Ansible
Mac Dev Playbook

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment