On Sat, Dec 24, 2022 at 11:45 AM tor eng <[email protected]> wrote: > > Hello all, > I am new to ansible, trying to learn the basis so I can use it to > automate some of my networking stuffs. I currently have setup a small lab > with for Ubuntu and 2 CentOS systems. Anything I do on the Ubuntu works fine > be the CentOS is always given me issues. I have pretty setup everything > regarding connectivity but below is the error I get with one of the CentOS > system when running an ad-hoc command to test ping. > ! > } > 10.18.13.17 | FAILED! => { > "changed": false, > "module_stderr": "Shared connection to 10.18.13.17 closed.\r\n", > "module_stdout": "/bin/sh: /usr/bin/python: No such file or > directory\r\n", > "msg": "The module failed to execute correctly, you probably need to set > the interpreter.\nSee stdout/stderr for the exact error", > "rc": 127 > } > > This is the version of CentOS that I am running on the remote server > ! > NAME="CentOS Stream" > VERSION="8" > ID="centos" > ID_LIKE="rhel fedora" > VERSION_ID="8" > PLATFORM_ID="platform:el8" > PRETTY_NAME="CentOS Stream 8" > ANSI_COLOR="0;31" > CPE_NAME="cpe:/o:centos:centos:8" > HOME_URL="https://centos.org/" > BUG_REPORT_URL="https://bugzilla.redhat.com/" > REDHAT_SUPPORT_PRODUCT="Red Hat Enterprise Linux 8" > REDHAT_SUPPORT_PRODUCT_VERSION="CentOS Stream" > ! > > This is also the version of ansible and python I am running on both remote > server and ansible control host > ! > remote host > Python 3.6.8 > > ansible-control-host > ansible 2.7.7 > config file = /home/user/ansible_training/ansible.cfg > configured module search path = ['/home/user/.ansible/plugins/modules', > '/usr/share/ansible/plugins/modules'] > ansible python module location = /usr/lib/python3/dist-packages/ansible > executable location = /usr/bin/ansible > python version = 3.7.3 (default, Oct 31 2022, 14:04:00) [GCC 8.3.0]
Stop right there. That "ansible" is from well before it was split to ansible-core, which has the ansible scripts and binaries, and is now up to version 2.13 in RPMs available for RHEL and CentOS 8. And the "ansible" package, itself, is no longer ansible. It's a collection of more than 100 "ansible_collections" modules, in a tarball called "ansible", and yes it is amazingly confusing. Don't install the "ansible" package anymore on RHEL. There is no official RPM published for it from Red Hat, there is only the "ansible-core" package. The only one who publishes a workable RPM, or RPM building tools for it on RHEL, is me over at https://github.com/nkadel/ansiblerepo/. To get the right tool via RPM, use this. sudo dnf remove ansible sudo dnf install ansible-core This should help. The split of python to "python2" and "python3" caused a lot of confusion, and I'm afraid that older versions of ansible are not as consistent about using "python3" by default. ! > Can anybody help me with this error ? > Thank you. > > -- > You received this message because you are subscribed to the Google Groups > "Ansible Project" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/ansible-project/1e9791f0-5dd9-495b-bb91-fd56de14dd27n%40googlegroups.com. -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/CAOCN9ryG7VmbRcybr3dKcOUV1xTuOvo2VKa4Ac5tX_hM0QnYMA%40mail.gmail.com.
