2018-11-01 13:40:51 +00:00
|
|
|
---
|
2018-11-18 22:41:11 +00:00
|
|
|
- block:
|
|
|
|
- name: Installing vim
|
|
|
|
package:
|
|
|
|
name: "{{ vim_package_name }}"
|
|
|
|
state: present
|
2018-11-01 13:40:51 +00:00
|
|
|
|
2018-11-18 22:41:11 +00:00
|
|
|
- name: Creating configuration directory
|
|
|
|
file:
|
|
|
|
state: directory
|
|
|
|
dest: /etc/vim
|
|
|
|
owner: root
|
|
|
|
group: root
|
|
|
|
mode: 0755
|
2018-11-01 13:40:51 +00:00
|
|
|
|
2018-11-18 22:41:11 +00:00
|
|
|
- name: Configure vim
|
|
|
|
template:
|
|
|
|
src: etc/vim/vimrc.local.j2
|
|
|
|
dest: /etc/vim/vimrc.local
|
|
|
|
owner: root
|
|
|
|
group: root
|
|
|
|
mode: 0644
|
2018-11-01 13:40:51 +00:00
|
|
|
|
2018-11-18 22:58:12 +00:00
|
|
|
- name: Fix default vim (debian)
|
|
|
|
lineinfile:
|
2018-11-18 23:01:09 +00:00
|
|
|
dest: /etc/vim/vimrc
|
2018-11-18 22:58:12 +00:00
|
|
|
regexp: '^\"\s*let\sg\:skip_defaults_vim.*$'
|
|
|
|
line: 'let g:skip_defaults_vim = 1'
|
|
|
|
when: ansible_os_family == "Debian"
|
|
|
|
|
|
|
|
- name: Source local vimrc (redhat)
|
2018-11-18 22:41:11 +00:00
|
|
|
blockinfile:
|
|
|
|
dest: /etc/vimrc
|
|
|
|
marker: "\" {mark} ANSIBLE MANAGED BLOCK"
|
|
|
|
block: |
|
|
|
|
if filereadable("/etc/vim/vimrc.local")
|
|
|
|
source /etc/vim/vimrc.local
|
|
|
|
endif
|
|
|
|
when: ansible_os_family == "RedHat"
|
2018-11-01 13:40:51 +00:00
|
|
|
become: True
|
2018-11-18 22:41:11 +00:00
|
|
|
become_user: root
|