templates/ansible/roles/vim/tasks/main.yml
---
- name: Install vim
apt: name=vim
- name: Prepare dirs for pathogen.vim
file: path={{ item }} state=directory owner={{ user_name }} group={{ group_name }} recurse=yes
with_items:
- '{{ vim_autoload_path }}'
- '{{ vim_bundle_path }}'
- name: Install pathogen.vim
get_url: url=https://tpo.pe/pathogen.vim dest={{ vim_autoload_path }}/pathogen.vim
sudo_user: '{{ user_name }}'
- name: Create ~/.vimrc
template: src=vimrc.j2 dest={{ user_home_path }}/.vimrc owner={{ user_name }} group={{ group_name }}
- name: Install plugins
git: repo={{ item.git }} dest={{ vim_bundle_path }}/{{ item.name }} version=master accept_hostkey=yes
sudo_user: '{{ user_name }}'
with_items: vim_plugins