Last active
May 4, 2017 08:21
-
-
Save snowleung/3d86f6ac0ebbdb760956dc01d29e8144 to your computer and use it in GitHub Desktop.
ansible playbook to set up your mac, include
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
# ## osx startup | |
# ansible playbook to set up your mac, include: | |
# * oh~my~zsh | |
# * pyenv | |
# * pyenv-virtualenv | |
# ## dependency | |
# * [homebrew](https://brew.sh/) | |
# * [Ansible](https://github.com/ansible/ansible/) | |
# * [Emacs-24.4](https://emacsformacosx.com/emacs-builds/Emacs-24.4-universal.dmg) | |
# ## How to use | |
# ```shell | |
# ansible-playbook startup.yml | |
# ``` | |
############################# | |
- hosts: localhost | |
tasks: | |
- name: install ohmyzsh | |
command: sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)" | |
- name: clone pyenv | |
git: | |
repo: https://github.com/pyenv/pyenv.git | |
dest: ~/.pyenv | |
- name: install virtual | |
git: | |
repo: https://github.com/pyenv/pyenv-virtualenv.git | |
dest: ~/.pyenv/plugins/pyenv-virtualenv | |
### config pyenv ### | |
- lineinfile: dest=~/.zshrc line='#pyenv required' | |
- lineinfile: dest=~/.zshrc line='export PYENV_ROOT="$HOME/.pyenv"' | |
- lineinfile: dest=~/.zshrc line='export PATH="$PYENV_ROOT/bin:$PATH"' | |
- lineinfile: dest=~/.zshrc line='eval "$(pyenv init -)"' | |
- lineinfile: dest=~/.zshrc line='eval "$(pyenv virtualenv-init -)"' | |
### useful alias ### | |
- lineinfile: dest=~/.zshrc line='#my script' | |
- lineinfile: dest=~/.zshrc line="alias djsrc='open https://github.com/django/django/tree/stable/1.6.x'" | |
- lineinfile: dest=~/.zshrc line="alias pysrc='open https://github.com/python-git/python'" | |
- lineinfile: dest=~/.zshrc line="alias gsheet='open https://docs.google.com/spreadsheets/u/0/'" | |
- lineinfile: dest=~/.zshrc line="alias emptycurr='git push origin :$(current_branch)'" | |
- lineinfile: dest=~/.zshrc line="alias rmpyc='find . -name \"*.pyc\" -delete'" | |
- lineinfile: dest=~/.zshrc line="alias rmtmp='find . -name \"*~\" -delete'" | |
- lineinfile: dest=~/.zshrc line="alias rmlogs='find . -name \"*.log\" -delete'" | |
- lineinfile: dest=~/.zshrc line="alias gnr='grep -nr'" | |
- lineinfile: dest=~/.zshrc line="alias e='/Applications/Emacs.app/Contents/MacOS/Emacs -nw'" | |
# ### CONFIG Emacs-24.5 ### | |
- name: clone emacsd | |
git: | |
repo: https://github.com/snowleung/myemacsd | |
dest: ~/myemacsd | |
- name: config my emacs | |
command: cp -rf ~/myemacsd/.emacs ~/ | |
- name: config my emacs2 | |
command: cp -rf ~/myemacsd/.emacs.d ~/ | |
### brew install ### | |
- name: cmd:mycli, https://github.com/dbcli/mycli | |
command: brew install mycli | |
- name: cmd:pgcli,https://github.com/dbcli/pgcli | |
command: brew install pgcli | |
- name: cmd:ag, https://github.com/ggreer/the_silver_searcher | |
command: brew install the_silver_searcher | |
- name: cmd:fzf, https://github.com/junegunn/fzf | |
command: brew install fzf | |
- name: install fzf | |
shell: y | /usr/local/opt/fzf/install |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment