-
Notifications
You must be signed in to change notification settings - Fork 127
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ansible #642
Comments
@kgfcoder6 which version of the collection are you using? Also, you are using a very old version of ansible. The current version is 2.15. |
yes i am using old version of ansible, its 2.9.27 As i told i have a project requirement to build the rke cluster on this old version |
I still need to know the version of the collection you are using to debug this. Since you are using an old version of ansible, you will have to look in the MANIFEST.json file where the collection is installed to get the version. |
cat MANIFEST.json Its "version": "2.0.1" |
ALso I am unable to update the k8 plugin and getting below error ansible-galaxy collection install kubernetes.core -vvv Traceback (most recent call last): BUt this might be due to version issue and as I told I would not be able to update python and ansible versions, will try with higher rke versions but could you please suggest what changes has to be done to configure k8 plugins for this ansible ? |
It looks like you are using ansible 2.12 here, which is no longer supported. I would strongly suggest using at least ansible 2.13, though preferably higher. |
sorry previously i was looking in community folder, I again checked kubernetes folder inside collections, external_collections/ansible_collections/kubernetes/core$ cat MANIFEST.json and version is 2.4.0 |
I cannot reproduce this. Using the playbook you provided, python 3.6, ansible 2.9.27 and kubernetes.core 2.4.0 it works. |
but still i guess playbooks are taking old version and as you could see when i tried to update it said core 2.12 so i am really confused that even though inside kubernetes folder core says 2.4, it may be using 2.12 core and unable to update as it gives above error |
@kgfcoder6 just hitting your same bug in my playbook using kubernetes.core collection at version 2.4.0 for a 1.28.2 Kubernetes cluster I workarounded the error by removing the 2.4.0 version of the collection and installing the 2.3.2 @gravesm if some other data are needed just ask :) Ansible Version:
Ansible configuration:
The task that cause the error:
EDIT: Tomorrow I will try also to redeploy the kubernetes cluster with fresh vm and test the playbook with the 2.4.0 collections |
SUMMARY
An exception occurred during task execution. To see the full traceback, use -vvv. The error was: ValueError: ansible_collections.kubernetes.core.plugins.module_utils.client.discovery.spec is None
fatal: [rancher01.test1.nbg]: FAILED! => {"msg": "Unexpected failure during module execution.", "stdout": ""}
The full traceback is:
Traceback (most recent call last):
File "/usr/local/lib/python3.6/dist-packages/ansible/executor/task_executor.py", line 147, in run
res = self._execute()
File "/usr/local/lib/python3.6/dist-packages/ansible/executor/task_executor.py", line 665, in _execute
result = self._handler.run(task_vars=variables)
File "/opt/ansible/roles/external_collections/ansible_collections/kubernetes/core/plugins/action/k8s.py", line 398, in run
task_vars=task_vars,
File "/usr/local/lib/python3.6/dist-packages/ansible/plugins/action/init.py", line 825, in _execute_module
(module_style, shebang, module_data, module_path) = self._configure_module(module_name=module_name, module_args=module_args, task_vars=task_vars)
File "/usr/local/lib/python3.6/dist-packages/ansible/plugins/action/init.py", line 211, in _configure_module
**become_kwargs)
File "/usr/local/lib/python3.6/dist-packages/ansible/executor/module_common.py", line 1283, in modify_module
environment=environment)
File "/usr/local/lib/python3.6/dist-packages/ansible/executor/module_common.py", line 1120, in _find_module_utils
py_module_cache, zf)
File "/usr/local/lib/python3.6/dist-packages/ansible/executor/module_common.py", line 911, in recursive_finder
py_module_names, py_module_cache, zf)
File "/usr/local/lib/python3.6/dist-packages/ansible/executor/module_common.py", line 911, in recursive_finder
py_module_names, py_module_cache, zf)
File "/usr/local/lib/python3.6/dist-packages/ansible/executor/module_common.py", line 911, in recursive_finder
py_module_names, py_module_cache, zf)
File "/usr/local/lib/python3.6/dist-packages/ansible/executor/module_common.py", line 751, in recursive_finder
[os.path.join(*py_module_name[:-idx])])
File "/usr/local/lib/python3.6/dist-packages/ansible/executor/module_common.py", line 671, in init
self.get_source()
File "/usr/local/lib/python3.6/dist-packages/ansible/executor/module_common.py", line 687, in get_source
data = pkgutil.get_data(to_native(self._package_name), to_native(self._mod_name + '.py'))
File "/usr/lib/python3.6/pkgutil.py", line 616, in get_data
spec = importlib.util.find_spec(package)
File "/usr/lib/python3.6/importlib/util.py", line 102, in find_spec
raise ValueError('{}.spec is None'.format(name))
ValueError: ansible_collections.kubernetes.core.plugins.module_utils.client.discovery.spec is None
fatal: [rancher01.test1.nbg]: FAILED! => {
"msg": "Unexpected failure during module execution.",
"stdout": ""
}
ISSUE TYPE
COMPONENT NAME
kubernetes.core.k8s
ANSIBLE VERSION
COLLECTION VERSION
CONFIGURATION
OS / ENVIRONMENT
OS - Ubuntu 20
python 3.6
Ansible 2.9
rke_rancher_version: '2.6.3'
rke_version: 'v1.3.3'
rke_kubernetes_version: 'v1.21.7-rancher1-1'
STEPS TO REPRODUCE
If we run any simple playbook to create kubernetes namespace using the kubernetes.core.k8s collection, the error would reoccur and doesnot allow to use module to create namespace and gives error with ansible_collections/kubernetes/core/plugins/module_utils/client/disocovery.py and i didnot find any existing issue here and as i am trying to create a rke cluster in test environment replicating existing prod setup, need this to run on older versions as mentioned above, please help to fix dynamic discovery plugin as it continuously tells spec not found and not sure what to change.
EXPECTED RESULTS
namespace should be created and dynamic module should be configured by the ansible collections
ACTUAL RESULTS
The text was updated successfully, but these errors were encountered: