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:
2026-06-10 14:06:12 -04:00
parent 9d33b45dbc
commit 9942fd94f8
11 changed files with 521 additions and 9 deletions

View 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