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:41:11 +00:00
|
|
|
- name: Source local vimrc
|
|
|
|
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
|