This Ansible role installs the latest version of Vim from source on the following Linux distributions:
- Alma Linux 8 and 9
- Ubuntu 20.04, 22.04 and 24.04
It will probably work for intermediate or alternate versions of the above, for example, CentOS Stream 8, RHEL 9, Fedora 34+, Ubuntu 24.10, etc..
Vim is installed to /usr/local/bin/vim, and the role creates a
/etc/profile.d/vim.sh file to ensure that it takes precedence over
package-managed instances.
As of 2024 it is probably simpler to install Vim via the default package manager as most modern distributions make a recent enough version of Vim available. The original motivation for this project was to install newer versions of Vim on the once popular, but now end-of-life, CentOS 7 which was version locked to version 7.4.
Now this role is now more of a learning exercise for Ansible, Ansible Galaxy and Ansible Molecule.
- sudo-to-root for Ansible user on target host.
None.
Install the role to so it is available to all projects via ~/.ansible/roles:
ansible-galaxy install V01dDweller.vim_installUse -p to install to your Ansible project directory, for example:
ansible-galaxy install V01dDweller.vim_install -p <path-to-project>/rolesmkdir -p ~/.ansible/roles
git clone https://github.com/V01dDweller/vim_install.git ~/.ansible/rolesgit clone https://github.com/V01dDweller/vim_install.git <path-to-project>/rolestouch vim_install.yml... and add the following:
# file: vim_install.yml
---
- name: Install Vim
hosts: all
become: true
roles:
- role: V01dDweller.vim_install
tags: vimansible-playbook vim_install.yml$ vim -version
VIM - Vi IMproved 9.1 (2024 Jan 02, compiled Nov 11 2024 20:26:13)
Garbage after option argument: "-version"
More info with: "vim -h"BSD
By V01dDweller