Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
97 lines (95 sloc) 3.03 KB
- hosts: ubuntu
become: yes
- name: "FIX: Ubuntu 16.04 LTS doesn't come with certain modules, required by ansible"
raw: apt-get install python-minimal aptitude -y
become: true
become_user: root
become_method: sudo
- name: apt update
apt: update_cache=yes
- name: upgrade all packages
apt: upgrade=full
- name: install zsh
apt: name=zsh
- name: install wget
apt: name=wget
- name: install build-essential
apt: name=build-essential
- name: install git
apt: name=git
- name: check dotfiles
shell: test -d /home/azusa/dotfiles
register: dotfiles_result
ignore_errors: true
- name: check .vim/bundle
shell: test -d /home/azusa/.vim/bundle
register: bundle_result
ignore_errors: true
- name: clone bundle
dest: //home/azusa/.vim/bundle/vundle
become: azusa
when: bundle_result|failed
- name: clone dotfiles
dest: /home/azusa/dotfiles
become: azusa
when: dotfiles_result|failed
- name: link dotfiles
file: src=/home/azusa/dotfiles/.zshrc dest=/home/azusa/.zshrc state=link
become: azusa
- name: link dotfiles
file: src=/home/azusa/dotfiles/.vimrc dest=/home/azusa/.vimrc state=link
become: azusa
- name: apt install for rbenv
apt: name="{{ item }}" state=present
- ruby-build
- name: check rbenv
shell: grep rbenv /home/azusa/.zshlocal
become: azusa
register: rbenv_result
ignore_errors: true
- name: install rbenv
shell: |
git clone /home/azusa/.rbenv
git clone /home/azusa/.rbenv/plugins/ruby-build
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> /home/azusa/.zshrc
echo 'export SHELL=/usr/bin/zsh' >> /home/azusa/.zshlocal
echo 'eval "$(rbenv init - zsh)"' >> /home/azusa/.zshlocal
become: azusa
when: rbenv_result|failed
- name: check nodebrew
shell: grep nodebrew /home/azusa/.zshlocal
become: azusa
register: nodebrew_result
ignore_errors: true
- name: install nodebrew
shell: |
curl -L | perl - setup
echo 'export PATH=$HOME/.nodebrew/current/bin:$PATH' >> /home/azusa/.zshlocal
become: azusa
when: nodebrew_result|failed
- user:
name: azusa
shell: /usr/bin/zsh
- name: clone vim
dest: /tmp/vim
- name: check vim
shell: test -f /usr/local/bin/vim
register: vim_result
ignore_errors: true
- name: install vim
shell: |
cd /tmp/vim/src
./configure --prefix=/usr/local
make install
when: vim_result|failed
- name: link vi
file: src=/usr/local/bin/vim dest=/usr/local/bin/vi state=link