initial commit
This commit is contained in:
parent
dfd6d34714
commit
bc508faa21
5
defaults/main.yml
Normal file
5
defaults/main.yml
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
vim_config:
|
||||||
|
- 'set background=dark'
|
||||||
|
- 'set tabstop=4 shiftwidth=4 expandtab'
|
||||||
|
- 'syntax on'
|
3
tasks/main.yml
Normal file
3
tasks/main.yml
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
---
|
||||||
|
- include_vars: "os_{{ ansible_os_family }}.yml"
|
||||||
|
- import_tasks: setup.yml
|
34
tasks/setup.yml
Normal file
34
tasks/setup.yml
Normal 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
|
5
templates/etc/vim/vimrc.local.j2
Normal file
5
templates/etc/vim/vimrc.local.j2
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
" {{ ansible_managed }}
|
||||||
|
|
||||||
|
{% for item in vim_config %}
|
||||||
|
{{ item }}
|
||||||
|
{% endfor %}
|
2
vars/os_Debian.yml
Normal file
2
vars/os_Debian.yml
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
---
|
||||||
|
vim_package_name: vim
|
2
vars/os_RedHat.yml
Normal file
2
vars/os_RedHat.yml
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
---
|
||||||
|
vim_package_name: vim-enhanced
|
Loading…
Reference in New Issue
Block a user