diff --git a/tasks/main.yml b/tasks/main.yml index 0245955..e32ba9a 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -1,3 +1,4 @@ --- -- include_vars: "os_{{ ansible_os_family }}.yml" -- import_tasks: setup.yml \ No newline at end of file +- include_vars: "os_{{ ansible_os_family | lower }}.yml" + +- import_tasks: setup.yml diff --git a/tasks/setup.yml b/tasks/setup.yml index 468e421..b384a04 100644 --- a/tasks/setup.yml +++ b/tasks/setup.yml @@ -1,34 +1,34 @@ --- -- name: Setup vim environment - block: - - name: Installing vim - package: - name: "{{ vim_package_name }}" - state: latest +- block: + - name: Installing vim + package: + name: "{{ vim_package_name }}" + state: present - - name: Creating configuration directory - file: - state: directory - dest: /etc/vim - owner: root - group: root - mode: 0755 + - 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: 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" + - 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 + become_user: root diff --git a/vars/os_Debian.yml b/vars/os_debian.yml similarity index 100% rename from vars/os_Debian.yml rename to vars/os_debian.yml diff --git a/vars/os_RedHat.yml b/vars/os_redhat.yml similarity index 100% rename from vars/os_RedHat.yml rename to vars/os_redhat.yml