Closed sojjan1337 closed 1 year ago
Hi, I haven't performed any update tasks on coc-ansible that could potentially be the cause of your issue. I believe the issue lies within your environment, but I'm not sure of the cause.
Could you please follow the steps below and check if there are any logs indicating a possible cause?
:CocCommand workspace.showOutput
.ansibleServer
and press Enter. Or Select ansible-client
and press EnterHi! There are no selection for either ansibleServer or ansible-client in the list. I can see git/Prettier/vimlsp/snippets/watchman
Thanks for your support!
If ansible-client is not included in the selection options, I believe coc-ansible is not working at all. The ansibleServer also won't start. It seems to be an issue with your PC or Vim environment, so I recommend trying it out in a minimal configuration using virtual machines or docker, for example.
I managed to see it now. This is the output:
########## ansible-client
==== environment ====
pythonCommandPaths(env): /usr/bin/python3 pythonCommandPaths(real): /usr/bin/python3.11 pythonInterpreterPath(custom): None existsAnsibleCmd: true existsAnsibleLintCmd: true existsAnsibleDocCmd: true forceBuiltinTools:
Thanks for the adjustments. As I believe the issue has been resolved and is now working, I will close this issue.
Hi i don't get it to work. Not sure what i'm doing wrong
It could be related to the version of Ansible you are using. Could you try creating a Python virtual environment and testing it there?
e.g.:
mkdir -p $HOME/ansible-check
cd $HOME/ansible-check
python3 -m venv venv
source venv/bin/activate
pip install ansible ansible-lint
touch site.yml
nvim site.yml
Thanks for your effort. Still it won't work.
But i get this line at the top: --- /-> Ansible Schemas Bundle 22.4 (ansible.json)
pip list | grep ansible ansible 7.1.0 ansible-compat 2.2.7 ansible-core 2.14.1 ansible-lint 6.16.2
ansible --version ansible [core 2.14.1] config file = None
I tried the following steps with docker's fedora:latest. It worked fine in my environment. Unfortunately, I couldn't reproduce your issue.
Prepare:
docker run -it --rm fedora:latest bash
dnf upgrade -y && dnf install vim-enhanced git -y
dnf install nodejs -y
npm i -g yarn
curl -fLo ~/.vim/autoload/plug.vim --create-dirs \
https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
cat <<EOF > ~/.vimrc
syntax on
filetype plugin indent on
call plug#begin('~/.vim/plugged')
Plug 'neoclide/coc.nvim', {'branch': 'master', 'do': 'yarn install --frozen-lockfile'}
Plug 'yaegassy/coc-ansible', {'do': 'yarn install --frozen-lockfile'}
Plug 'pearofducks/ansible-vim'
call plug#end()
let g:coc_filetype_map = {
\ 'yaml.ansible': 'ansible',
\ }
EOF
mkdir -p $HOME/check
cd $HOME/check
python3 -m venv venv
source venv/bin/activate
pip install ansible ansible-lint
Plugin Install and Check:
$HOME/check
and execute the command :PlugInstall
.:e playbook.yml
.Screen shot:
np. but thanks anyway :)
Hi!
Having trouble to make the auto-completion to work for ansible. I can see that the ansibleServer is started but when i'm coding the tab "auto-completion" won't appear.
When i open a .yaml file the filetype is "yaml.ansible"
I have noticed though that i have two dirs: /plugged/coc.nvim /plugged/coc-ansible
added into init.vim:
CocInfo: