Group vars refactor
This commit is contained in:
parent
f7eb8dc56d
commit
755493d155
31 changed files with 355 additions and 398 deletions
|
|
@ -1,26 +0,0 @@
|
|||
stages:
|
||||
- lint
|
||||
- test
|
||||
|
||||
cache:
|
||||
key: $CI_COMMIT_REF_SLUG
|
||||
paths:
|
||||
- .cache/pip
|
||||
- node_modules/
|
||||
|
||||
lint:
|
||||
stage: lint
|
||||
image: node:current-alpine
|
||||
before_script:
|
||||
- npm install
|
||||
script:
|
||||
- npx prettier '**/*.yml' --check
|
||||
|
||||
syntax-test:
|
||||
stage: test
|
||||
image: python:latest
|
||||
before_script:
|
||||
- pip install ansible --quiet
|
||||
- ansible-galaxy install --role-file requirements.yml
|
||||
script:
|
||||
- ansible-playbook playbook.yml --syntax-check
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
singleQuote: true
|
||||
printWidth: 90
|
||||
tabWidth: 2
|
||||
useTabs: false
|
||||
bracketSpacing: true
|
||||
|
|
@ -1,5 +1,6 @@
|
|||
[defaults]
|
||||
roles_path = ./roles
|
||||
inventory = inventory.yml
|
||||
|
||||
[privilege_escalation]
|
||||
become_ask_pass = True
|
||||
|
|
|
|||
|
|
@ -1,39 +0,0 @@
|
|||
- hosts: localhost
|
||||
pre_tasks:
|
||||
- name: install packages
|
||||
become: true
|
||||
package:
|
||||
name: '{{ item }}'
|
||||
state: present
|
||||
loop: '{{ packages }}'
|
||||
- name: add git forge to known hosts
|
||||
include_role:
|
||||
name: common
|
||||
tasks_from: 'known_hosts.yml'
|
||||
vars:
|
||||
user: '{{ ansible_user_id }}'
|
||||
items:
|
||||
- { domain: '{{ git_domain }}', key: '{{ git_host_key }}' }
|
||||
roles:
|
||||
- common
|
||||
tasks:
|
||||
- import_tasks: 'tasks/dotfiles.yml'
|
||||
|
||||
- name: Include neovim tasks
|
||||
import_tasks: 'tasks/neovim.yml'
|
||||
tags: neovim
|
||||
|
||||
- name: gather package facts
|
||||
package_facts:
|
||||
manager: pacman
|
||||
- import_tasks: 'tasks/aur.yml'
|
||||
- import_tasks: 'tasks/docker.yml'
|
||||
|
||||
- name: setup python versions
|
||||
include_tasks: 'tasks/python.yml'
|
||||
loop: '{{ python_versions }}'
|
||||
|
||||
- import_tasks: 'tasks/nvm.yml'
|
||||
vars_files:
|
||||
- 'vars/main.yml'
|
||||
- 'vars/archlinux.yml'
|
||||
14
debian.yml
14
debian.yml
|
|
@ -1,14 +0,0 @@
|
|||
- hosts: localhost
|
||||
pre_tasks:
|
||||
- name: install packages
|
||||
become: true
|
||||
package:
|
||||
name: '{{ item }}'
|
||||
state: present
|
||||
loop: '{{ packages }}'
|
||||
tasks:
|
||||
- import_tasks: 'tasks/dotfiles.yml'
|
||||
- import_tasks: 'tasks/neovim.yml'
|
||||
vars_files:
|
||||
- 'vars/main.yml'
|
||||
- 'vars/debian.yml'
|
||||
4
group_vars/all/git.yml
Normal file
4
group_vars/all/git.yml
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
dotfiles_repo: 'git@forgejo.fudiggity.nl:sonny/dotfiles.git'
|
||||
|
||||
git_domain: 'forgejo.fudiggity.nl'
|
||||
git_host_key: 'forgejo.fudiggity.nl ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBqEej87ukSK7KGi7e0q+oTrru4h7Fm6fK8GgiMtu01+'
|
||||
46
group_vars/all/neovim.yml
Normal file
46
group_vars/all/neovim.yml
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
neovim_plugins:
|
||||
- url: 'https://forgejo.fudiggity.nl/sonny/source-link.lua'
|
||||
name: 'source-link'
|
||||
- url: 'https://github.com/nvim-tree/nvim-tree.lua'
|
||||
name: 'nvim-tree'
|
||||
- url: 'https://github.com/nvim-tree/nvim-web-devicons'
|
||||
name: 'nvim-tree-icons'
|
||||
- url: 'https://github.com/neovim/nvim-lspconfig'
|
||||
name: 'nvim-lspconfig'
|
||||
- url: 'https://github.com/hrsh7th/nvim-cmp'
|
||||
name: 'nvim-cmp'
|
||||
- url: 'https://github.com/hrsh7th/cmp-buffer'
|
||||
name: 'cmp-buffer'
|
||||
- url: 'https://github.com/hrsh7th/cmp-path'
|
||||
name: 'cmp-path'
|
||||
- url: 'https://github.com/hrsh7th/cmp-omni'
|
||||
name: 'cmp-omni'
|
||||
- url: 'https://github.com/hrsh7th/cmp-nvim-lsp'
|
||||
name: 'cmp-nvim-lsp'
|
||||
- url: 'https://github.com/hrsh7th/cmp-nvim-lua'
|
||||
name: 'cmp-nvim-lua'
|
||||
- url: 'https://github.com/nvim-treesitter/nvim-treesitter'
|
||||
name: 'nvim-treesitter'
|
||||
- url: 'https://github.com/nvim-lua/plenary.nvim'
|
||||
name: 'plenary.nvim'
|
||||
- url: 'https://github.com/nvim-telescope/telescope-fzf-native.nvim'
|
||||
name: 'telescope-fzf-native.nvim'
|
||||
- url: 'https://github.com/nvim-telescope/telescope.nvim'
|
||||
name: 'telescope.nvim'
|
||||
version: '0.1.x'
|
||||
- url: 'https://github.com/L3MON4D3/LuaSnip'
|
||||
name: 'luasnip'
|
||||
version: 'v1.0.0'
|
||||
- url: 'https://github.com/lewis6991/gitsigns.nvim'
|
||||
name: 'gitsigns.nvim'
|
||||
version: 'v0.9.0'
|
||||
- url: 'https://github.com/nvim-lualine/lualine.nvim'
|
||||
name: 'lualine'
|
||||
- url: 'https://github.com/lukas-reineke/indent-blankline.nvim'
|
||||
name: 'indent-blankline.nvim'
|
||||
version: 'v3.7.2'
|
||||
- url: 'https://github.com/projekt0n/github-nvim-theme.git'
|
||||
name: 'github-colors'
|
||||
version: 'v1.1.2'
|
||||
|
||||
language_servers: []
|
||||
4
group_vars/all/system.yml
Normal file
4
group_vars/all/system.yml
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
xdg_config_dir: '{{ ansible_env.HOME }}/.config'
|
||||
xdg_data_dir: '{{ ansible_env.HOME }}/.local/share'
|
||||
|
||||
packages: []
|
||||
40
group_vars/arch/aur.yml
Normal file
40
group_vars/arch/aur.yml
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
aur_packages:
|
||||
- url: 'https://aur.archlinux.org/nvm.git'
|
||||
name: 'nvm'
|
||||
package_name: 'nvm'
|
||||
version: '0.40.0-1'
|
||||
arch: 'any'
|
||||
|
||||
aur_build_dir: '/usr/local/src'
|
||||
python_build_dir: '/usr/local/src'
|
||||
python_install_dir: '/opt'
|
||||
|
||||
python_download_url: 'https://www.python.org/ftp/python'
|
||||
python_versions:
|
||||
- version: 3.12.9
|
||||
path: 'python3.12'
|
||||
binary: 'python3.12'
|
||||
|
||||
- version: 3.11.9
|
||||
path: 'python3.11'
|
||||
binary: 'python3.11'
|
||||
|
||||
- version: 3.10.0
|
||||
path: 'python3.10'
|
||||
binary: 'python3.10'
|
||||
|
||||
- version: 3.9.14
|
||||
path: 'python3.9'
|
||||
binary: 'python3.9'
|
||||
|
||||
- version: 3.8.14
|
||||
path: 'python3.8'
|
||||
binary: 'python3.8'
|
||||
|
||||
- version: 3.7.14
|
||||
path: 'python3.7'
|
||||
binary: 'python3.7'
|
||||
|
||||
- version: 3.6.15
|
||||
path: 'python3.6'
|
||||
binary: 'python3.6'
|
||||
48
group_vars/arch/neovim.yml
Normal file
48
group_vars/arch/neovim.yml
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
language_servers:
|
||||
- package: ansible-language-server
|
||||
server_name: 'ansiblels'
|
||||
auto_setup: true
|
||||
|
||||
- package: typescript-language-server
|
||||
server_name: 'ts_ls'
|
||||
auto_setup: true
|
||||
|
||||
- package: vscode-json-languageserver
|
||||
server_name: 'jsonls'
|
||||
auto_setup: true
|
||||
|
||||
- package: vscode-css-languageserver
|
||||
server_name: 'cssls'
|
||||
auto_setup: true
|
||||
|
||||
- package: bash-language-server
|
||||
server_name: 'bashls'
|
||||
auto_setup: true
|
||||
|
||||
- package: marksman
|
||||
server_name: 'marksman'
|
||||
auto_setup: true
|
||||
|
||||
- package: esbonio
|
||||
server_name: 'esbonio'
|
||||
auto_setup: true
|
||||
|
||||
- package: lua-language-server
|
||||
server_name: 'lua_ls'
|
||||
auto_setup: true
|
||||
|
||||
- package: yaml-language-server
|
||||
server_name: 'yamlls'
|
||||
auto_setup: false
|
||||
|
||||
- package: vscode-html-languageserver
|
||||
server_name: 'html'
|
||||
auto_setup: false
|
||||
|
||||
- package: ruff-lsp
|
||||
server_name: 'ruff'
|
||||
auto_setup: false
|
||||
|
||||
- package: pyright
|
||||
server_name: 'pyright'
|
||||
auto_setup: false
|
||||
17
group_vars/arch/system.yml
Normal file
17
group_vars/arch/system.yml
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
packages:
|
||||
- python
|
||||
- git
|
||||
- vim
|
||||
- neovim
|
||||
- python-pynvim
|
||||
- wl-clipboard
|
||||
- npm
|
||||
- docker
|
||||
- docker-compose
|
||||
- iptables-nft
|
||||
- fuse-overlayfs
|
||||
- ttf-ibm-plex
|
||||
- slirp4netns
|
||||
- tree-sitter
|
||||
- ripgrep
|
||||
- uv
|
||||
|
|
@ -1,19 +1,3 @@
|
|||
ansible_connection: local
|
||||
ansible_python_interpreter: '/usr/bin/python3'
|
||||
|
||||
packages:
|
||||
- python3
|
||||
- git
|
||||
- vim
|
||||
- npm
|
||||
- libtree-sitter0
|
||||
- ripgrep
|
||||
|
||||
neovim:
|
||||
version: 'v0.10.4'
|
||||
install_path: '/opt/nvim'
|
||||
download_checksum: sha256:95aaa8e89473f5421114f2787c13ae0ec6e11ebbd1a13a1bd6fcf63420f8073f
|
||||
|
||||
# TODO: add lua language server, see https://github.com/LuaLS/lua-language-server?
|
||||
language_servers:
|
||||
- package: '@ansible/ansible-language-server'
|
||||
|
|
@ -27,3 +11,8 @@ language_servers:
|
|||
- package: bash-language-server
|
||||
server_name: 'bashls'
|
||||
auto_setup: true
|
||||
|
||||
neovim:
|
||||
version: 'v0.10.4'
|
||||
install_path: '/opt/nvim'
|
||||
download_checksum: sha256:95aaa8e89473f5421114f2787c13ae0ec6e11ebbd1a13a1bd6fcf63420f8073f
|
||||
7
group_vars/debian/system.yml
Normal file
7
group_vars/debian/system.yml
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
packages:
|
||||
- python3
|
||||
- git
|
||||
- vim
|
||||
- npm
|
||||
- libtree-sitter0
|
||||
- ripgrep
|
||||
22
inventory.yml
Normal file
22
inventory.yml
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
personal:
|
||||
hosts:
|
||||
xps: &xps
|
||||
ansible_connection: local
|
||||
ansible_become_method: community.general.run0
|
||||
desktop: &desktop
|
||||
ansible_connection: local
|
||||
ansible_become_method: community.general.run0
|
||||
fudiggity: &fudiggity
|
||||
ansible_connection: local
|
||||
|
||||
debian:
|
||||
hosts:
|
||||
fudiggity:
|
||||
<<: *fudiggity
|
||||
|
||||
arch:
|
||||
hosts:
|
||||
xps:
|
||||
<<: *xps
|
||||
desktop:
|
||||
<<: *desktop
|
||||
33
package-lock.json
generated
33
package-lock.json
generated
|
|
@ -1,33 +0,0 @@
|
|||
{
|
||||
"name": "development",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"dependencies": {
|
||||
"prettier": "^2.6.2"
|
||||
}
|
||||
},
|
||||
"node_modules/prettier": {
|
||||
"version": "2.6.2",
|
||||
"resolved": "https://registry.npmjs.org/prettier/-/prettier-2.6.2.tgz",
|
||||
"integrity": "sha512-PkUpF+qoXTqhOeWL9fu7As8LXsIUZ1WYaJiY/a7McAQzxjk82OF0tibkFXVCDImZtWxbvojFjerkiLb0/q8mew==",
|
||||
"bin": {
|
||||
"prettier": "bin-prettier.js"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=10.13.0"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/prettier/prettier?sponsor=1"
|
||||
}
|
||||
}
|
||||
},
|
||||
"dependencies": {
|
||||
"prettier": {
|
||||
"version": "2.6.2",
|
||||
"resolved": "https://registry.npmjs.org/prettier/-/prettier-2.6.2.tgz",
|
||||
"integrity": "sha512-PkUpF+qoXTqhOeWL9fu7As8LXsIUZ1WYaJiY/a7McAQzxjk82OF0tibkFXVCDImZtWxbvojFjerkiLb0/q8mew=="
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
{
|
||||
"dependencies": {
|
||||
"prettier": "^2.6.2"
|
||||
}
|
||||
}
|
||||
72
playbook.yml
Normal file
72
playbook.yml
Normal file
|
|
@ -0,0 +1,72 @@
|
|||
- name: Development provisioning
|
||||
hosts:
|
||||
- xps
|
||||
- desktop
|
||||
- fudiggity
|
||||
pre_tasks:
|
||||
- name: Verifying that a limit is set
|
||||
ansible.builtin.fail:
|
||||
msg: 'This playbook cannot be run with no limit'
|
||||
run_once: true
|
||||
when: ansible_limit is not defined
|
||||
|
||||
- name: Install packages
|
||||
become: true
|
||||
ansible.builtin.package:
|
||||
name: '{{ item }}'
|
||||
state: present
|
||||
loop: '{{ packages }}'
|
||||
|
||||
- name: Add git forge to known hosts
|
||||
ansible.builtin.include_role:
|
||||
name: common
|
||||
tasks_from: 'known_hosts.yml'
|
||||
vars:
|
||||
user: '{{ ansible_user_id }}'
|
||||
items:
|
||||
- domain: '{{ git_domain }}'
|
||||
key: '{{ git_host_key }}'
|
||||
roles:
|
||||
- common
|
||||
tasks:
|
||||
- name: Setup dotfiles
|
||||
ansible.builtin.import_tasks: 'tasks/dotfiles.yml'
|
||||
tags: dotfiles
|
||||
|
||||
- name: Include generic neovim tasks
|
||||
ansible.builtin.import_tasks: 'tasks/neovim.yml'
|
||||
tags: neovim
|
||||
|
||||
- name: Include debian neovim tasks
|
||||
ansible.builtin.import_tasks: 'tasks/debian/neovim.yml'
|
||||
when: "'debian' in group_names"
|
||||
tags: neovim
|
||||
|
||||
- name: Provision Archlinux hosts
|
||||
when: "'arch' in group_names"
|
||||
block:
|
||||
- name: Gather package facts
|
||||
ansible.builtin.package_facts:
|
||||
manager: pacman
|
||||
|
||||
- name: Include arch neovim tasks
|
||||
ansible.builtin.import_tasks: 'tasks/arch/neovim.yml'
|
||||
when: "'arch' in group_names"
|
||||
tags: neovim
|
||||
|
||||
- name: Install AUR packages
|
||||
ansible.builtin.import_tasks: 'tasks/arch/aur.yml'
|
||||
tags: aur
|
||||
|
||||
- name: Setup docker
|
||||
ansible.builtin.import_tasks: 'tasks/arch/docker.yml'
|
||||
tags: docker
|
||||
|
||||
- name: Setup python versions
|
||||
ansible.builtin.include_tasks: 'tasks/arch/python.yml'
|
||||
loop: '{{ python_versions }}'
|
||||
tags: python
|
||||
|
||||
- name: Setup NVM
|
||||
ansible.builtin.import_tasks: 'tasks/arch/nvm.yml'
|
||||
tags: nvm
|
||||
|
|
@ -1,8 +1,8 @@
|
|||
- name: set package directory
|
||||
set_fact:
|
||||
- name: Set package directory
|
||||
ansible.builtin.set_fact:
|
||||
build_dir: '{{ aur_build_dir }}/{{ item.name }}'
|
||||
|
||||
- name: 'retrieve package name for {{ item.name }}'
|
||||
- name: 'Retrieve package name for {{ item.name }}'
|
||||
command:
|
||||
argv:
|
||||
- grep
|
||||
|
|
@ -12,7 +12,7 @@
|
|||
- "{{ build_dir }}/PKGBUILD"
|
||||
register: pkg_name
|
||||
|
||||
- name: 'retrieve package version for {{ item.name }}'
|
||||
- name: 'Retrieve package version for {{ item.name }}'
|
||||
command:
|
||||
argv:
|
||||
- grep
|
||||
|
|
@ -22,7 +22,7 @@
|
|||
- "{{ build_dir }}/PKGBUILD"
|
||||
register: pkg_version
|
||||
|
||||
- name: 'retrieve package release for {{ item.name }}'
|
||||
- name: 'Retrieve package release for {{ item.name }}'
|
||||
command:
|
||||
argv:
|
||||
- grep
|
||||
|
|
@ -32,21 +32,22 @@
|
|||
- "{{ build_dir }}/PKGBUILD"
|
||||
register: pkg_release
|
||||
|
||||
- set_fact:
|
||||
- name: Set package filename & version
|
||||
ansible.builtin.set_fact:
|
||||
package_filename: '{{ pkg_name.stdout }}-{{ pkg_version.stdout }}-{{ pkg_release.stdout }}-{{ item.arch }}.pkg.tar.zst'
|
||||
installed_version: ansible_facts.packages[item.package_name].version|default('')
|
||||
|
||||
- name: 'build package {{ item.name }}'
|
||||
command: 'makepkg --syncdeps --rmdeps --clean --noconfirm --force'
|
||||
- name: 'Build package {{ item.name }}'
|
||||
ansible.builtin.command: 'makepkg --syncdeps --rmdeps --clean --noconfirm --force'
|
||||
args:
|
||||
chdir: '{{ build_dir }}'
|
||||
creates: '{{ build_dir }}/{{ package_filename }}'
|
||||
register: package_build
|
||||
when: item.version != installed_version
|
||||
|
||||
- name: 'install {{ item.name }}'
|
||||
- name: 'Install {{ item.name }}'
|
||||
become: true
|
||||
pacman:
|
||||
community.general.pacman:
|
||||
name: '{{ build_dir }}/{{ package_filename }}'
|
||||
state: present
|
||||
when: item.version != installed_version
|
||||
|
|
@ -1,19 +1,19 @@
|
|||
- name: retrieve directory stats
|
||||
stat:
|
||||
- name: Retrieve directory stats
|
||||
ansible.builtin.stat:
|
||||
path: '{{ aur_build_dir }}/{{ item.name }}'
|
||||
loop: '{{ aur_packages }}'
|
||||
|
||||
- name: clone aur packages
|
||||
- name: Clone aur packages
|
||||
become: true
|
||||
git:
|
||||
ansible.builtin.git:
|
||||
repo: '{{ item.url }}'
|
||||
dest: '{{ aur_build_dir }}/{{ item.name }}'
|
||||
update: true
|
||||
loop: '{{ aur_packages }}'
|
||||
|
||||
- name: change aur package directories owner
|
||||
- name: Change aur package directories owner
|
||||
become: true
|
||||
file:
|
||||
ansible.builtin.file:
|
||||
path: '{{ aur_build_dir }}/{{ item.name }}'
|
||||
state: directory
|
||||
owner: '{{ ansible_user_id }}'
|
||||
|
|
@ -21,6 +21,6 @@
|
|||
recurse: true
|
||||
loop: '{{ aur_packages }}'
|
||||
|
||||
- name: build & install aur packages
|
||||
include_tasks: 'tasks/aur-package.yml'
|
||||
- name: Build & install aur packages
|
||||
ansible.builtin.include_tasks: 'tasks/arch/aur-package.yml'
|
||||
loop: '{{ aur_packages }}'
|
||||
|
|
@ -10,7 +10,7 @@
|
|||
- name: Setup desktop configuration
|
||||
become: true
|
||||
ansible.builtin.file:
|
||||
path: 'files/docker-daemon.json'
|
||||
path: 'files/desktop/docker-daemon.json'
|
||||
dest: '/etc/docker/daemon.json'
|
||||
mode: '0755'
|
||||
when: ansible_hostname == 'desktop'
|
||||
6
tasks/arch/neovim.yml
Normal file
6
tasks/arch/neovim.yml
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
- name: Install language servers
|
||||
become: true
|
||||
community.general.pacman:
|
||||
name: '{{ item }}'
|
||||
state: present
|
||||
loop: '{{ language_servers | map(attribute="package") | list }}'
|
||||
|
|
@ -1,13 +1,14 @@
|
|||
- set_fact:
|
||||
- name: Set NVM install directory
|
||||
ansible.builtin.set_fact:
|
||||
install_dir: '{{ xdg_config_dir }}/nvm'
|
||||
|
||||
- name: remove manually installed nvm install directory
|
||||
file:
|
||||
- name: Remove manually installed nvm install directory
|
||||
ansible.builtin.file:
|
||||
path: '{{ install_dir }}'
|
||||
state: absent
|
||||
|
||||
- name: remove nvm entry from bashrc
|
||||
lineinfile:
|
||||
- name: Remove nvm entry from bashrc
|
||||
ansible.builtin.lineinfile:
|
||||
path: '{{ ansible_env.HOME }}/.bashrc.override'
|
||||
line: >
|
||||
[ -s "{{ install_dir }}/nvm.sh" ] && \. "{{ install_dir }}/nvm.sh" # This loads nvm
|
||||
57
tasks/debian/neovim.yml
Normal file
57
tasks/debian/neovim.yml
Normal file
|
|
@ -0,0 +1,57 @@
|
|||
- name: Install language servers on debian hosts
|
||||
become: true
|
||||
community.general.npm:
|
||||
name: '{{ item }}'
|
||||
global: true
|
||||
loop: '{{ language_servers | map(attribute="package") | list }}'
|
||||
|
||||
- name: Create neovim install directory
|
||||
become: true
|
||||
ansible.builtin.file:
|
||||
state: directory
|
||||
path: '{{ neovim.install_path }}'
|
||||
owner: '{{ ansible_user_id }}'
|
||||
group: '{{ ansible_user_gid }}'
|
||||
mode: '0755'
|
||||
|
||||
- name: Register the current neovim version
|
||||
ansible.builtin.command:
|
||||
argv:
|
||||
- '{{ neovim.install_path }}/bin/nvim'
|
||||
- '--version'
|
||||
register: neovim_stats
|
||||
changed_when: false
|
||||
ignore_errors: true
|
||||
|
||||
- name: Parse the current neovim version
|
||||
ansible.builtin.set_fact:
|
||||
neovim_installed_version: neovim_stats.stdout_lines[0] | regex_search('(v\d+\.\d+\.\d+)')
|
||||
when: neovim_stats.rc == 0
|
||||
|
||||
- name: Download neovim {{ neovim.version }}
|
||||
ansible.builtin.get_url:
|
||||
url: 'https://github.com/neovim/neovim/releases/download/{{ neovim.version }}/nvim-linux-x86_64.tar.gz'
|
||||
dest: /tmp/nvim-linux64.tar.gz
|
||||
mode: '0755'
|
||||
checksum: '{{ neovim.download_checksum }}'
|
||||
when: neovim_stats.rc > 0 or neovim_installed_version != neovim.version
|
||||
register: neovim_download
|
||||
|
||||
- name: Extract downloaded neovim version
|
||||
ansible.builtin.unarchive:
|
||||
src: /tmp/nvim-linux64.tar.gz
|
||||
dest: '{{ neovim.install_path }}'
|
||||
extra_opts:
|
||||
- '--strip-components=1'
|
||||
- '--show-stored-names'
|
||||
- '--overwrite'
|
||||
when: |
|
||||
neovim_download.state == 'file'
|
||||
and (neovim_installed_version is undefined or neovim_installed_version != neovim.version)
|
||||
|
||||
- name: Add neovim to PATH
|
||||
become: true
|
||||
ansible.builtin.template:
|
||||
src: 'templates/debian/nvim.profile.j2'
|
||||
dest: '/etc/profile.d/neovim.sh'
|
||||
mode: '0755'
|
||||
|
|
@ -37,22 +37,6 @@
|
|||
name: neovim
|
||||
global: true
|
||||
|
||||
- name: Install language servers
|
||||
become: true
|
||||
ansible.builtin.package:
|
||||
name: '{{ item }}'
|
||||
state: present
|
||||
loop: '{{ language_servers | map(attribute="package") | list }}'
|
||||
when: ansible_facts['os_family'] == 'Archlinux'
|
||||
|
||||
- name: Install language servers on debian hosts
|
||||
become: true
|
||||
community.general.npm:
|
||||
name: '{{ item }}'
|
||||
global: true
|
||||
loop: '{{ language_servers | map(attribute="package") | list }}'
|
||||
when: ansible_facts['os_family'] == 'Debian'
|
||||
|
||||
- name: Remove old neovim configuration file
|
||||
ansible.builtin.file:
|
||||
path: '{{ xdg_config_dir }}/nvim/init.vim'
|
||||
|
|
@ -136,57 +120,3 @@
|
|||
|
||||
- src: 'templates/nvim/lua/filetype.lua.j2'
|
||||
dest: '{{ xdg_config_dir }}/nvim/lua/_filetype.lua'
|
||||
|
||||
- name: Install neovim from archive
|
||||
when: ansible_facts['os_family'] == 'Debian'
|
||||
block:
|
||||
- name: Create neovim install directory
|
||||
become: true
|
||||
ansible.builtin.file:
|
||||
state: directory
|
||||
path: '{{ neovim.install_path }}'
|
||||
owner: '{{ ansible_user_id }}'
|
||||
group: '{{ ansible_user_gid }}'
|
||||
mode: '0755'
|
||||
|
||||
- name: Register the current neovim version
|
||||
ansible.builtin.command:
|
||||
argv:
|
||||
- '{{ neovim.install_path }}/bin/nvim'
|
||||
- '--version'
|
||||
register: neovim_stats
|
||||
changed_when: false
|
||||
ignore_errors: true
|
||||
|
||||
- name: Parse the current neovim version
|
||||
ansible.builtin.set_fact:
|
||||
neovim_installed_version: neovim_stats.stdout_lines[0] | regex_search('(v\d+\.\d+\.\d+)')
|
||||
when: neovim_stats.rc == 0
|
||||
|
||||
- name: Download neovim {{ neovim.version }}
|
||||
ansible.builtin.get_url:
|
||||
url: 'https://github.com/neovim/neovim/releases/download/{{ neovim.version }}/nvim-linux-x86_64.tar.gz'
|
||||
dest: /tmp/nvim-linux64.tar.gz
|
||||
mode: '0755'
|
||||
checksum: '{{ neovim.download_checksum }}'
|
||||
when: neovim_stats.rc > 0 or neovim_installed_version != neovim.version
|
||||
register: neovim_download
|
||||
|
||||
- name: Extract downloaded neovim version
|
||||
ansible.builtin.unarchive:
|
||||
src: /tmp/nvim-linux64.tar.gz
|
||||
dest: '{{ neovim.install_path }}'
|
||||
extra_opts:
|
||||
- '--strip-components=1'
|
||||
- '--show-stored-names'
|
||||
- '--overwrite'
|
||||
when: |
|
||||
neovim_download.state == 'file'
|
||||
and (neovim_installed_version is undefined or neovim_installed_version != neovim.version)
|
||||
|
||||
- name: Add neovim to PATH
|
||||
become: true
|
||||
ansible.builtin.template:
|
||||
src: 'templates/nvim.profile.j2'
|
||||
dest: '/etc/profile.d/neovim.sh'
|
||||
mode: '0755'
|
||||
|
|
|
|||
|
|
@ -1 +0,0 @@
|
|||
{{ ansible_user_id }}:231072:65536
|
||||
|
|
@ -1 +0,0 @@
|
|||
{{ ansible_user_id }}:231072:65536
|
||||
|
|
@ -1,111 +0,0 @@
|
|||
ansible_connection: local
|
||||
ansible_python_interpreter: '/usr/bin/python'
|
||||
|
||||
packages:
|
||||
- python
|
||||
- git
|
||||
- vim
|
||||
- neovim
|
||||
- python-pynvim
|
||||
- wl-clipboard
|
||||
- npm
|
||||
- docker
|
||||
- docker-compose
|
||||
- iptables-nft
|
||||
- fuse-overlayfs
|
||||
- ttf-ibm-plex
|
||||
- slirp4netns
|
||||
- tree-sitter
|
||||
- ripgrep
|
||||
- uv
|
||||
|
||||
aur_packages:
|
||||
- url: 'https://aur.archlinux.org/nvm.git'
|
||||
name: 'nvm'
|
||||
package_name: 'nvm'
|
||||
version: '0.40.0-1'
|
||||
arch: 'any'
|
||||
|
||||
aur_build_dir: '/usr/local/src'
|
||||
python_build_dir: '/usr/local/src'
|
||||
python_install_dir: '/opt'
|
||||
|
||||
language_servers:
|
||||
- package: ansible-language-server
|
||||
server_name: 'ansiblels'
|
||||
auto_setup: true
|
||||
|
||||
- package: typescript-language-server
|
||||
server_name: 'ts_ls'
|
||||
auto_setup: true
|
||||
|
||||
- package: vscode-json-languageserver
|
||||
server_name: 'jsonls'
|
||||
auto_setup: true
|
||||
|
||||
- package: vscode-css-languageserver
|
||||
server_name: 'cssls'
|
||||
auto_setup: true
|
||||
|
||||
- package: bash-language-server
|
||||
server_name: 'bashls'
|
||||
auto_setup: true
|
||||
|
||||
- package: marksman
|
||||
server_name: 'marksman'
|
||||
auto_setup: true
|
||||
|
||||
- package: esbonio
|
||||
server_name: 'esbonio'
|
||||
auto_setup: true
|
||||
|
||||
- package: lua-language-server
|
||||
server_name: 'lua_ls'
|
||||
auto_setup: true
|
||||
|
||||
- package: yaml-language-server
|
||||
server_name: 'yamlls'
|
||||
auto_setup: false
|
||||
|
||||
- package: vscode-html-languageserver
|
||||
server_name: 'html'
|
||||
auto_setup: false
|
||||
|
||||
- package: ruff-lsp
|
||||
server_name: 'ruff'
|
||||
auto_setup: false
|
||||
|
||||
- package: pyright
|
||||
server_name: 'pyright'
|
||||
auto_setup: false
|
||||
|
||||
|
||||
python_download_url: 'https://www.python.org/ftp/python'
|
||||
python_versions:
|
||||
- version: 3.12.9
|
||||
path: 'python3.12'
|
||||
binary: 'python3.12'
|
||||
|
||||
- version: 3.11.9
|
||||
path: 'python3.11'
|
||||
binary: 'python3.11'
|
||||
|
||||
- version: 3.10.0
|
||||
path: 'python3.10'
|
||||
binary: 'python3.10'
|
||||
|
||||
- version: 3.9.14
|
||||
path: 'python3.9'
|
||||
binary: 'python3.9'
|
||||
|
||||
- version: 3.8.14
|
||||
path: 'python3.8'
|
||||
binary: 'python3.8'
|
||||
|
||||
- version: 3.7.14
|
||||
path: 'python3.7'
|
||||
binary: 'python3.7'
|
||||
|
||||
- version: 3.6.15
|
||||
path: 'python3.6'
|
||||
binary: 'python3.6'
|
||||
|
|
@ -1,53 +0,0 @@
|
|||
ansible_connection: local
|
||||
ansible_python_interpreter: '/usr/bin/env python'
|
||||
|
||||
xdg_config_dir: '{{ ansible_env.HOME }}/.config'
|
||||
xdg_data_dir: '{{ ansible_env.HOME }}/.local/share'
|
||||
|
||||
dotfiles_repo: 'git@forgejo.fudiggity.nl:sonny/dotfiles.git'
|
||||
public_dotfiles_repo: 'https://forgejo.fudiggity.nl/sonny/dotfiles.git'
|
||||
|
||||
neovim_plugins:
|
||||
- { url: 'https://forgejo.fudiggity.nl/sonny/source-link.lua', name: 'source-link' }
|
||||
- { url: 'https://github.com/nvim-tree/nvim-tree.lua', name: 'nvim-tree' }
|
||||
- {
|
||||
url: 'https://github.com/nvim-tree/nvim-web-devicons', name: 'nvim-tree-icons'
|
||||
}
|
||||
- { url: 'https://github.com/neovim/nvim-lspconfig', name: 'nvim-lspconfig' }
|
||||
- { url: 'https://github.com/hrsh7th/nvim-cmp', name: 'nvim-cmp' }
|
||||
- { url: 'https://github.com/hrsh7th/cmp-buffer', name: 'cmp-buffer' }
|
||||
- { url: 'https://github.com/hrsh7th/cmp-path', name: 'cmp-path' }
|
||||
- { url: 'https://github.com/hrsh7th/cmp-omni', name: 'cmp-omni' }
|
||||
- { url: 'https://github.com/hrsh7th/cmp-nvim-lsp', name: 'cmp-nvim-lsp' }
|
||||
- { url: 'https://github.com/hrsh7th/cmp-nvim-lua', name: 'cmp-nvim-lua' }
|
||||
- { url: 'https://github.com/nvim-treesitter/nvim-treesitter', name: 'nvim-treesitter' }
|
||||
- { url: 'https://github.com/nvim-lua/plenary.nvim', name: 'plenary.nvim' }
|
||||
- {
|
||||
url: 'https://github.com/nvim-telescope/telescope-fzf-native.nvim',
|
||||
name: 'telescope-fzf-native.nvim',
|
||||
}
|
||||
- {
|
||||
url: 'https://github.com/nvim-telescope/telescope.nvim',
|
||||
name: 'telescope.nvim',
|
||||
version: '0.1.x',
|
||||
}
|
||||
- { url: 'https://github.com/L3MON4D3/LuaSnip', name: 'luasnip', version: 'v1.0.0' }
|
||||
- {
|
||||
url: 'https://github.com/lewis6991/gitsigns.nvim',
|
||||
name: 'gitsigns.nvim',
|
||||
version: 'v0.9.0',
|
||||
}
|
||||
- { url: 'https://github.com/nvim-lualine/lualine.nvim', name: 'lualine' }
|
||||
- {
|
||||
url: 'https://github.com/lukas-reineke/indent-blankline.nvim',
|
||||
name: 'indent-blankline.nvim',
|
||||
version: 'v3.7.2',
|
||||
}
|
||||
- {
|
||||
url: 'https://github.com/projekt0n/github-nvim-theme.git',
|
||||
name: 'github-colors',
|
||||
version: 'v1.1.2',
|
||||
}
|
||||
|
||||
git_domain: 'forgejo.fudiggity.nl'
|
||||
git_host_key: 'forgejo.fudiggity.nl ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBqEej87ukSK7KGi7e0q+oTrru4h7Fm6fK8GgiMtu01+'
|
||||
Loading…
Add table
Add a link
Reference in a new issue