# Ansible ping ok on ubuntu servers not working on redhat and centos servers

**URL:** <https://forum.ansible.com/t/ansible-ping-ok-on-ubuntu-servers-not-working-on-redhat-and-centos-servers/38885>\
**Category:** Get Help\
**Tags:** vmware, ubuntu\
**Created:** [December 4, 2024, 2:52pm UTC](https://forum.ansible.com/t/ansible-ping-ok-on-ubuntu-servers-not-working-on-redhat-and-centos-servers/38885 "2024-12-04T14:52:16Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Coll77](https://avatars.discourse-cdn.com/v4/letter/c/8e8cbc/32.png) [@Coll77](https://forum.ansible.com/u/Coll77)\
**Post date:** [December 4, 2024, 2:52pm UTC](https://forum.ansible.com/t/ansible-ping-ok-on-ubuntu-servers-not-working-on-redhat-and-centos-servers/38885/1 "2024-12-04T14:52:16Z")

</div>

Hello,

Below the information where ansible is installed

SERVER:  
Virtualization: vmware  
Operating System: Ubuntu 22.04.4 LTS  
Kernel: Linux 5.15.0-118-generic  
Architecture: x86-64

ANSIBLE:  
ansible [core 2.17.6]  
config file = /etc/ansible/ansible.cfg  
configured module search path = [‘/var/lib/rundeck/.ansible/plugins/modules’, ‘/usr/share/ansible/plugins/modules’]  
ansible python module location = /usr/lib/python3/dist-packages/ansible  
ansible collection location = /var/lib/rundeck/.ansible/collections:/usr/share/ansible/collections  
executable location = /usr/bin/ansible  
python version = 3.10.12 (main, Nov 6 2024, 20:22:13) [GCC 11.4.0] (/usr/bin/python3)  
jinja version = 3.0.3  
libyaml = True

DESCRIPTION:  
I copied my ssh public key from my user rundeck to my user of my servers ubuntu and redhat/centos  
On my server rundeck When i try to connect with ssh on my servers (ubuntu and redhat/centos) it’s working

However when i’m using the command : ansible myser.mydomain -m ping -vvv  
only ubuntu servers it’s correct the others one not working

Do you have an idea?

Below the result with error for redhat and centos:

myserver | FAILED! =\> {  
“ansible\_facts”: {  
“discovered\_interpreter\_python”: “/usr/bin/python3”  
},  
“changed”: false,  
“module\_stderr”: “Shared connection to plbdd009.edit.gallimard.groupe closed.\r\n”,  
“module\_stdout”: “Traceback (most recent call last):\r\n File "/home/operateur/.ansible/tmp/ansible-tmp-1733318915.5148103-58959-103119498999386/AnsiballZ\_setup.py", line 107, in \r\n \_ansiballz\_main()\r\n File "/home/operateur/.ansible/tmp/ansible-tmp-1733318915.5148103-58959-103119498999386/AnsiballZ\_setup.py", line 99, in \_ansiballz\_main\r\n invoke\_module(zipped\_mod, temp\_path, ANSIBALLZ\_PARAMS)\r\n File "/home/operateur/.ansible/tmp/ansible-tmp-1733318915.5148103-58959-103119498999386/AnsiballZ\_setup.py", line 44, in invoke\_module\r\n from ansible.module\_utils import basic\r\n File "", line 971, in \_find\_and\_load\r\n File "", line 951, in \_find\_and\_load\_unlocked\r\n File "", line 894, in \_find\_spec\r\n File "", line 1157, in find\_spec\r\n File "", line 1131, in \_get\_spec\r\n File "", line 1112, in \_legacy\_get\_spec\r\n File "", line 441, in spec\_from\_loader\r\n File "", line 544, in spec\_from\_file\_location\r\n File "/tmp/ansible\_ansible.builtin.setup\_payload\_auvrazzd/ansible\_ansible.builtin.setup\_payload.zip/ansible/module\_utils/basic.py", line 5\r\nSyntaxError: future feature annotations is not defined\r\n”,  
“msg”: “MODULE FAILURE\nSee stdout/stderr for the exact error”,  
“rc”: 1  
}

Thanks in advance for your help

---

<div class="post-metadata">

**Author:** ![bcoca](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/bcoca/32/9269_2.png) [@bcoca](https://forum.ansible.com/u/bcoca)\
**Post date:** [December 4, 2024, 4:29pm UTC](https://forum.ansible.com/t/ansible-ping-ok-on-ubuntu-servers-not-working-on-redhat-and-centos-servers/38885/2 "2024-12-04T16:29:43Z")

</div>

Check the Python version present on the target vs the Python versions supported by that version of Ansible

---

<div class="post-metadata">

**Author:** ![felixfontein](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/felixfontein/32/7530_2.png) [@felixfontein](https://forum.ansible.com/u/felixfontein)\
**Post date:** [December 4, 2024, 8:35pm UTC](https://forum.ansible.com/t/ansible-ping-ok-on-ubuntu-servers-not-working-on-redhat-and-centos-servers/38885/3 "2024-12-04T20:35:52Z")

</div>

The ansible-core support matrix shows which Python versions are supported on controller and target: [Releases and maintenance — Ansible Core Documentation](https://docs.ansible.com/ansible-core/devel/reference_appendices/release_and_maintenance.html#ansible-core-support-matrix)

---

<div class="post-metadata">

**Author:** ![Coll77](https://avatars.discourse-cdn.com/v4/letter/c/8e8cbc/32.png) [@Coll77](https://forum.ansible.com/u/Coll77)\
**Post date:** [December 5, 2024, 10:08am UTC](https://forum.ansible.com/t/ansible-ping-ok-on-ubuntu-servers-not-working-on-redhat-and-centos-servers/38885/4 "2024-12-05T10:08:06Z")

</div>

Hello  
Thanks bcoca and felixfontein, it’s exactly this.  
I have installed correct (or compatible) python version on my remote host and it’s working.

Thanks yet
