---
- stat: path="~/dotfiles"
  register: st_dotfiles
- git: repo=git@github.com:briangershon/dotfiles.git
    dest="~/dotfiles"
  when: not st_dotfiles.stat.exists

- name: symlink bash_profile
  file: src=~/dotfiles/bash_profile dest=~/.bash_profile state=link

- name: symlink bashrc
  file: src=~/dotfiles/bashrc dest=~/.bashrc state=link

- name: symlink gitconfig
  file: src=~/dotfiles/gitconfig dest=~/.gitconfig state=link

- name: symlink vimrc
  file: src=~/dotfiles/vimrc dest=~/.vimrc state=link

- name: symlink tmux
  file: src=~/dotfiles/tmux.conf dest=~/.tmux.conf state=link

---
- stat: path="~/dotfiles"
  register: st_dotfiles
- git: repo=git@github.com:briangershon/dotfiles.git
    dest="~/dotfiles"
  when: not st_dotfiles.stat.exists

- stat: path=~/.bash_profile
  register: st_bash_profile
- name: Remove .bash_profile if it is not a symlink
  file: path=~/.bash_profile state=absent
  when: not st_bash_profile.stat.islnk

- name: symlink bash_profile
  file: src=~/dotfiles/bash_profile dest=~/.bash_profile state=link

- stat: path=~/.bashrc
  register: st_bashrc
- name: Remove .bashrc if it is not a symlink
  file: path=~/.bashrc state=absent
  when: not st_bashrc.stat.islnk

- name: symlink bashrc
  file: src=~/dotfiles/bashrc dest=~/.bashrc state=link

- name: symlink gitconfig
  file: src=~/dotfiles/gitconfig dest=~/.gitconfig state=link

- name: symlink vimrc
  file: src=~/dotfiles/vimrc dest=~/.vimrc state=link

- name: symlink tmux
  file: src=~/dotfiles/tmux.conf dest=~/.tmux.conf state=link

Remove .bashrc and .bash_profile is they are not a symlink.
Remove .bashrc and .bash_profile is they are not a symlink.
