initial commit

This commit is contained in:
Robert Kaussow 2018-11-01 14:40:51 +01:00
parent dfd6d34714
commit bc508faa21
6 changed files with 51 additions and 0 deletions

5
defaults/main.yml Normal file
View File

@ -0,0 +1,5 @@
---
vim_config:
- 'set background=dark'
- 'set tabstop=4 shiftwidth=4 expandtab'
- 'syntax on'

3
tasks/main.yml Normal file
View File

@ -0,0 +1,3 @@
---
- include_vars: "os_{{ ansible_os_family }}.yml"
- import_tasks: setup.yml

34
tasks/setup.yml Normal file
View File

@ -0,0 +1,34 @@
---
- name: Setup vim environment
block:
- name: Installing vim
package:
name: "{{ vim_package_name }}"
state: latest
- name: Creating configuration directory
file:
state: directory
dest: /etc/vim
owner: root
group: root
mode: 0755
- name: Configure vim
template:
src: etc/vim/vimrc.local.j2
dest: /etc/vim/vimrc.local
owner: root
group: root
mode: 0644
- 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"
become: True

View File

@ -0,0 +1,5 @@
" {{ ansible_managed }}
{% for item in vim_config %}
{{ item }}
{% endfor %}

2
vars/os_Debian.yml Normal file
View File

@ -0,0 +1,2 @@
---
vim_package_name: vim

2
vars/os_RedHat.yml Normal file
View File

@ -0,0 +1,2 @@
---
vim_package_name: vim-enhanced