clean up, refactor, documentation

- reducing amount of splitting in configs
- documenting configuration
This commit is contained in:
Matthew Stobbs
2025-01-24 23:23:24 -07:00
parent f8585192d5
commit 2f3690aded
34 changed files with 425 additions and 307 deletions

View File

@@ -1,36 +1,55 @@
- ansible.builtin.include_vars:
file: neovim.yml
name: _neovim
- name: create temp path
ansible.builtin.tempfile:
state: directory
prefix: nvim.
register: d_nvim_tmp
- name: clone neovim git repository
ansible.builtin.git:
depth: 1
dest: "{{ d_nvim_tmp.path }}/neovim"
repo: "{{ _neovim.git_repo }}"
version: "v{{ _neovim.version }}"
- name: build neovim
ansible.builtin.command:
chdir: "{{ d_nvim_tmp.path }}/neovim"
cmd:
- make
- "CMAKE_BUILD_Type={{ _neovim.build_type }}"
- "CMAKE_INSTALL_PREFIX={{ _neovim.install_prefix }}"
---
- name: build neovim from source
block:
- name: create temp path
ansible.builtin.tempfile:
state: directory
prefix: nvim.
register: d_nvim_tmp
- name: clone neovim git repository
ansible.builtin.git:
depth: 1
dest: "{{ d_nvim_tmp.path }}/neovim"
repo: "{{ pkgconfig.neovim.git_repo }}"
version: "{{ pkgconfig.neovim.version }}"
- name: build and install neovim
ansible.builtin.make:
chdir: "{{ d_nvim_tmp.path }}/neovim"
params:
CMAKE_BUILD_TYPE: "{{ pkgconfig.neovim.build_type }}"
CMAKE_INSTALL_PREFIX: "{{ pkgconfig.neovim.install_prefix }}"
target: install
become: "{{ pkgconfig.neovim.become }}"
become_user: "{% if pkgconfig.neovim.become %}{{ pkgconfig.neovim.owner }}{% else %}~{% endif %}"
when: not pkgconfig.neovim.use_appimage
- name: install neovim appimage
become: true
ansible.builtin.get_url:
url: https://github.com/neovim/neovim/releases/download/v{{ _neovim.version }}/nvim.appimage
dest: /usr/local/bin/nvim
checksum: sha256:6a021e9465fe3d3375e28c3e94c1c2c4f7d1a5a67e4a78cf52d18d77b1471390
tags:
- RedHat
- linux
- package
block:
- ansible.builin.file:
state: directory
mode: "0755"
path: "{{ pkgconfig.neovim.install_dir }}"
owner: "{{ pkgconfig.neovim.owner }}"
group: "{{ pkgconfig.neovim.group }}"
- ansible.builtin.get_url:
mode: "0755"
decompress: false
backup: true
url: "{{ pkgconfig.neovim.appimage_url_pfx }}/{{ pkgconfig.neovim.version }}/nvim.appimage"
checksum: "sha256:{{ pkgconfig.neovim.appimage_url_pfx }}/{{ pkgconfig.neovim.version }}/nvim.appimage.sha256sum"
dest: "{{ pkgconfig.neovim.install_dir }}/nvim.appimage.{{ pkgconfig.neovim.version }}"
owner: "{{ pkgconfig.neovim.owner }}"
group: "{{ pkgconfig.neovim.group }}"
- ansible.builtin.file:
state: link
src: "{{ pkgconfig.neovim.install_dir }}/nvim.appimage.{{ pkgconfig.neovim.version }}"
path: "{{ pkgconfig.neovim.install_prefix }}/bin/nvim"
when:
- pkgconfig.neovim.use_appimage
become: "{{ pkgconfig.neovim.become }}"
become_user: "{% if pkgconfig.neovim.become %}{{ pkgconfig.neovim.owner }}{% else %}~{% endif %}"