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" when: ansible_os_family == "Debian"
become: yes 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" when: ansible_os_family == "Darwin"
homebrew: name=vim state=latest homebrew:
name: vim
state: latest
- name: Create the vim cache and config directories - name: Create the vim cache and config directories
file: file:
path: "{{ item }}" path: "{{ item }}"
state: directory state: directory
loop: loop:
- "~/.cache/vim" - ~/.cache/vim
- "~/.config/vim" - ~/.config/vim
- "~/.config/vim/autoload" - ~/.config/vim/autoload
- name: Deploy vim plug and vimrc
- name: Deploy vim-plug and vimrc
file: file:
src: "{{ role_path }}/files/{{ item }}" src: "{{ role_path }}/files/{{ item.src }}"
dest: "~/.config/vim/{{ item }}" dest: ~/.config/vim/{{ item.dest }}
state: link state: link
force: yes force: yes
loop: loop:
- autoload/plug.vim - src: plug.vim
- vimrc dest: autoload/plug.vim
- src: vimrc
dest: vimrc
- name: Install configured vim plugins - name: Install configured vim plugins
shell: vim -u "~/.config/vim/vimrc" +PlugInstall +qall shell: vim -u "~/.config/vim/vimrc" +PlugInstall +qall