small refactoring
This commit is contained in:
parent
fff2b96f3e
commit
301565018a
@ -1,3 +1,4 @@
|
|||||||
---
|
---
|
||||||
- include_vars: "os_{{ ansible_os_family }}.yml"
|
- include_vars: "os_{{ ansible_os_family | lower }}.yml"
|
||||||
- import_tasks: setup.yml
|
|
||||||
|
- import_tasks: setup.yml
|
||||||
|
@ -1,34 +1,34 @@
|
|||||||
---
|
---
|
||||||
- name: Setup vim environment
|
- block:
|
||||||
block:
|
- name: Installing vim
|
||||||
- name: Installing vim
|
package:
|
||||||
package:
|
name: "{{ vim_package_name }}"
|
||||||
name: "{{ vim_package_name }}"
|
state: present
|
||||||
state: latest
|
|
||||||
|
|
||||||
- name: Creating configuration directory
|
- name: Creating configuration directory
|
||||||
file:
|
file:
|
||||||
state: directory
|
state: directory
|
||||||
dest: /etc/vim
|
dest: /etc/vim
|
||||||
owner: root
|
owner: root
|
||||||
group: root
|
group: root
|
||||||
mode: 0755
|
mode: 0755
|
||||||
|
|
||||||
- name: Configure vim
|
- name: Configure vim
|
||||||
template:
|
template:
|
||||||
src: etc/vim/vimrc.local.j2
|
src: etc/vim/vimrc.local.j2
|
||||||
dest: /etc/vim/vimrc.local
|
dest: /etc/vim/vimrc.local
|
||||||
owner: root
|
owner: root
|
||||||
group: root
|
group: root
|
||||||
mode: 0644
|
mode: 0644
|
||||||
|
|
||||||
- name: Source local vimrc
|
- name: Source local vimrc
|
||||||
blockinfile:
|
blockinfile:
|
||||||
dest: /etc/vimrc
|
dest: /etc/vimrc
|
||||||
marker: "\" {mark} ANSIBLE MANAGED BLOCK"
|
marker: "\" {mark} ANSIBLE MANAGED BLOCK"
|
||||||
block: |
|
block: |
|
||||||
if filereadable("/etc/vim/vimrc.local")
|
if filereadable("/etc/vim/vimrc.local")
|
||||||
source /etc/vim/vimrc.local
|
source /etc/vim/vimrc.local
|
||||||
endif
|
endif
|
||||||
when: ansible_os_family == "RedHat"
|
when: ansible_os_family == "RedHat"
|
||||||
become: True
|
become: True
|
||||||
|
become_user: root
|
||||||
|
Loading…
Reference in New Issue
Block a user