created new package tasks for handler-based inclusions, otehrwise got username and home directory of SSH login for path purposes
This commit is contained in:
36
roles/init-server/tasks/contingent/pkg/neovim.yml
Normal file
36
roles/init-server/tasks/contingent/pkg/neovim.yml
Normal file
@@ -0,0 +1,36 @@
|
||||
---
|
||||
- name: Acquiring home of current user
|
||||
when: ansible_facts["system"] == "Linux"
|
||||
ansible.builtin.shell:
|
||||
cmd: "echo ~{{ ansible_user }}"
|
||||
register: ansible_user_home
|
||||
- name: Acquiring current user
|
||||
when: ansible_facts["system"] == "Linux"
|
||||
ansible.builtin.shell:
|
||||
cmd: "echo {{ ansible_user }}"
|
||||
- name: Copy system ViM configuration to home directory
|
||||
become: true
|
||||
ansible.builtin.copy:
|
||||
remote_src: /root/.vimrc
|
||||
dest: "{{ ansible_user_home.stdout }}/.vimrc"
|
||||
owner: "{{ ansible_user }}"
|
||||
group: "{{ ansible_user }}"
|
||||
mode: "644"
|
||||
state: present
|
||||
- name: Creating directory tree for NeoViM configuration files
|
||||
ansible.builtin.file:
|
||||
path: "{{ ansible_user_home.stdout }}/.config/nvim"
|
||||
recurse: true
|
||||
owner: "{{ ansible_user }}"
|
||||
group: "{{ ansible_user }}"
|
||||
state: directory
|
||||
- name: Configuring NeoViM
|
||||
become: true
|
||||
become_user: "{{ current_user.stdout }}"
|
||||
ansible.builtin.copy:
|
||||
src: user/config/nvim/init.vim
|
||||
dest: "{{ ansible_user_home.stdout }}/.config/nvim/init.vim"
|
||||
owner: "{{ ansible_user }}"
|
||||
group: "{{ ansible_user }}"
|
||||
mode: "644"
|
||||
state: present
|
||||
Reference in New Issue
Block a user