ansible: fix vim role syntax for consistency

This commit is contained in:
Fernando Schauenburg 2020-12-17 20:30:25 +01:00
parent e2181333f5
commit 55249f2a76
2 changed files with 27 additions and 16 deletions

View file

@ -1,30 +1,41 @@
- name: Install vim (Debian)
- name: Install vim with apt
when: ansible_os_family == "Debian"
become: yes
apt: name=vim state=latest update_cache=yes
apt:
name: vim
state: latest
update_cache: yes
- name: Install vim (macOS)
- name: Install vim with homebrew
when: ansible_os_family == "Darwin"
homebrew: name=vim state=latest
homebrew:
name: vim
state: latest
- name: Create the vim cache and config directories
file:
path: "{{ item }}"
state: directory
loop:
- "~/.cache/vim"
- "~/.config/vim"
- "~/.config/vim/autoload"
- ~/.cache/vim
- ~/.config/vim
- ~/.config/vim/autoload
- name: Deploy vim plug and vimrc
- name: Deploy vim-plug and vimrc
file:
src: "{{ role_path }}/files/{{ item }}"
dest: "~/.config/vim/{{ item }}"
src: "{{ role_path }}/files/{{ item.src }}"
dest: ~/.config/vim/{{ item.dest }}
state: link
force: yes
loop:
- autoload/plug.vim
- vimrc
- src: plug.vim
dest: autoload/plug.vim
- src: vimrc
dest: vimrc
- name: Install configured vim plugins
shell: vim -u "~/.config/vim/vimrc" +PlugInstall +qall