Add ansible LSP

This commit is contained in:
Valeriy Filippov
2026-03-11 16:34:25 +03:00
parent bfffd20873
commit 59c0722f25
4 changed files with 36 additions and 0 deletions

26
nvim/lsp/ansiblels.lua Normal file
View File

@@ -0,0 +1,26 @@
-- https://github.com/neovim/nvim-lspconfig/blob/master/lsp/ansiblels.lua
return {
cmd = { "ansible-language-server", "--stdio" },
filetypes = { "yaml.ansible" },
root_markers = { "ansible.cfg", ".ansible-lint" },
settings = {
ansible = {
python = {
interpreterPath = "python",
},
ansible = {
path = "ansible",
},
executionEnvironment = {
enabled = false,
},
validation = {
enabled = true,
lint = {
enabled = true,
path = "ansible-lint",
},
},
},
},
}

View File

@@ -1,4 +1,5 @@
vim.lsp.enable({ vim.lsp.enable({
"ansiblels",
"dockerls", "dockerls",
"gitlabcils", "gitlabcils",
"helmls", "helmls",

View File

@@ -0,0 +1,8 @@
-- https://github.com/mfussenegger/nvim-ansible/tree/main
return {
"mfussenegger/nvim-ansible",
ft = "yaml.ansible",
opts = {
-- leave empty or see below
},
}

View File

@@ -21,6 +21,7 @@ return {
"WhoIsSethDaniel/mason-tool-installer.nvim", "WhoIsSethDaniel/mason-tool-installer.nvim",
opts = { opts = {
ensure_installed = { ensure_installed = {
"ansible-language-server", -- https://github.com/ansible/vscode-ansible
"docker-language-server", -- https://github.com/docker/docker-language-server "docker-language-server", -- https://github.com/docker/docker-language-server
"gitlab-ci-ls", -- https://github.com/alesbrelih/gitlab-ci-ls "gitlab-ci-ls", -- https://github.com/alesbrelih/gitlab-ci-ls
"helm-ls", -- https://github.com/mrjosh/helm-ls "helm-ls", -- https://github.com/mrjosh/helm-ls