0

I'm trying to install a Kubernetes cluster with kubespray 1.18.0 and I get the error below. I have installed ansible 4.10 with pip3 on centos7.
I've checked everywhere but did not find a solution for it. I even modifyed the value to use version <= and the step was skipped but in the end it give another error.

TASK [kubernetes/preinstall : Stop if kernel version is too low] ********** 
fatal: [master1]: FAILED! => {
   "assertion": "ansible_kernel.split('-')[0] is version('4.9.17', '>=')",
   "changed": false,
   "evaluated_to": false,
   "msg": "Assertion failed"
}
fatal: [master2]: FAILED! => {
    "assertion": "ansible_kernel.split('-')[0] is version('4.9.17', '>=')",
    "changed": false,
    "evaluated_to": false,
    "msg": "Assertion failed"
}
fatal: [master3]: FAILED! => {
    "assertion": "ansible_kernel.split('-')[0] is version('4.9.17', '>=')",
    "changed": false,
    "evaluated_to": false,
    "msg": "Assertion failed"
}
fatal: [worker1]: FAILED! => {
    "assertion": "ansible_kernel.split('-')[0] is version('4.9.17', '>=')",
    "changed": false,
    "evaluated_to": false,
    "msg": "Assertion failed"
}
fatal: [worker2]: FAILED! => {
    "assertion": "ansible_kernel.split('-')[0] is version('4.9.17', '>=')",
    "changed": false,
    "evaluated_to": false,
    "msg": "Assertion failed"
}
fatal: [worker3]: FAILED! => {
    "assertion": "ansible_kernel.split('-')[0] is version('4.9.17', '>=')",
    "changed": false,
    "evaluated_to": false,
    "msg": "Assertion failed"
}
fatal: [istio1]: FAILED! => {
    "assertion": "ansible_kernel.split('-')[0] is version('4.9.17', '>=')",
    "changed": false,
    "evaluated_to": false,
    "msg": "Assertion failed"
}
fatal: [monitoring1]: FAILED! => {
    "assertion": "ansible_kernel.split('-')[0] is version('4.9.17', '>=')",
    "changed": false,
    "evaluated_to": false,
    "msg": "Assertion failed"`enter code here`
}

I installed it via pip3 from the kubespray requirements file and then updated to the las version also using pip update.

'''

[root@ansible ~]# pip3 list --uptodate
Package             Version
------------------- -------
ansible             4.10.0
ansible-core        2.11.11
cffi                1.15.0
importlib-resources 5.4.0
Jinja2              3.0.3
jmespath            0.10.0
MarkupSafe          2.0.1
netaddr             0.8.0
packaging           21.3
pbr                 5.8.1
pip                 21.3.1
pycparser           2.21
pyparsing           3.0.8
PyYAML              6.0
resolvelib          0.8.1
ruamel.yaml         0.17.21
ruamel.yaml.clib    0.2.6
setuptools          59.6.0
six                 1.16.0
zipp                3.6.0
[root@ansible ~]#

[root@ansible ~]# ansible --version
[DEPRECATION WARNING]: Ansible will require Python 3.8 or newer on the controller starting with Ansible 2.12. Current version: 3.6.8 (default, Nov 16 2020, 16:55:22) [GCC 4.8.5 20150623 (Red Hat 4.8.5-44)].
This feature will be removed from ansible-core in version 2.12. Deprecation warnings can be disabled by setting deprecation_warnings=False in ansible.cfg.
ansible [core 2.11.11]
  config file = None
  configured module search path = ['/root/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/local/lib/python3.6/site-packages/ansible
  ansible collection location = /root/.ansible/collections:/usr/share/ansible/collections
  executable location = /usr/local/bin/ansible
  python version = 3.6.8 (default, Nov 16 2020, 16:55:22) [GCC 4.8.5 20150623 (Red Hat 4.8.5-44)]
  jinja version = 3.0.3
  libyaml = True
[root@ansible ~]# uname -a
Linux ansible 3.10.0-1160.62.1.el7.x86_64 #1 SMP Tue Apr 5 16:57:59 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
[root@ansible ~]#

''' I did not do troubleshooting because I'm new with ansible. I thnink it's facts gathering because is at the preinstall phase and if all the requirements are not made, it failds. Update was done in ansible VM but not in the other 7. Changed it to smaller then (<=) and the check passed but I see it could impact the network plugin (cilium) and I dont wat that. '''

  • name: Stop if kernel version is too low assert: that: ansible_kernel.split('-')[0] is version('4.9.17', '<=') when:
    • kube_network_plugin == 'cilium' or cilium_deploy_additionally | default(false) | bool
    • not ignore_assert_errors '''
Nea_Johny
  • 1
  • 1
  • `I've checked everywhere but did not find a solution for it` <= you mean even upgrading your kernel on the target machines did not fix it ? – Zeitounator Apr 25 '22 at 16:10
  • 1
    What does `ansibfe --version` gives you? Mind that if you have installed Ansible before via `yum`, you out likely need to remove it via the package manager prior to installing it via pip (`yum remove ansible`). – β.εηοιτ.βε Apr 25 '22 at 21:29
  • Which debug steps have you taken? What is the content of `ansible_kernel` when running on your target? Is the kernel at the required version or is there a problem with the info returned by fact gathering? `but in the end it gives another error` <= [can you please describe this in detail](https://idownvotedbecau.se/itsnotworking/)? Please do not reply in comments: [edit your question](/posts/72002301/edit) – Zeitounator Apr 26 '22 at 08:32
  • Solved after removing ansible that was installed with yum. Made update of centos. Install requirements-2.11 from kubespray. – Nea_Johny May 02 '22 at 07:03

0 Answers0