absolute import error for centos 5 environment

1,161 views
Skip to first unread message

Oğuz Yarımtepe

unread,
Dec 20, 2017, 8:48:28 AM12/20/17
to Ansible Project
Hi,

While i am just testing ping adhoc command for my Centos5 environment below is the error i got


$ ansible all -i tmp3.txt -m ping -u root -k

TESTSRV | FAILED! => {
    "changed": false,
    "failed": true,
    "module_stderr": "",
    "module_stdout": "  File \"/tmp/ansible_nEiCUn/ansible_module_ping.py\", line 8\r\n    from __future__ import absolute_import, division, print_function\r\nSyntaxError: future feature absolute_import is not defined\r\n",
    "msg": "MODULE FAILURE",
    "rc": 0
}

✗ pip show ansible
Name: ansible
Version: 2.4.1.0
Summary: Radically simple IT automation
Author: Ansible, Inc.
Author-email: in...@ansible.com
License: GPLv3+
Location: /Users/foo/ansible-playbooks/venv/lib/python2.7/site-packages
Requires: jinja2, PyYAML, setuptools, cryptography, paramiko

at the TESTSRV

 # cat /etc/redhat-release 
CentOS release 5.4 (Final)

# python
Python 2.4.3 (#1, Jan  9 2013, 06:47:03) 
[GCC 4.1.2 20080704 (Red Hat 4.1.2-54)] on linux2
Type "help", "copyright", "credits" or "license" for more information.

Any idea what is missing at the remote side?

Toshio Kuratomi

unread,
Dec 20, 2017, 9:59:17 AM12/20/17
to ansible...@googlegroups.com
You need a newer version of python or an older version of ansible.  Ansible-2.3 was the last release series to support python-2.4 on the managed machines (it still required python-2.6 or greater on the controller but you could manage machines with only python 2.4 installed ).

-Toshio

--
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 ansible-project+unsubscribe@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/803d6d46-87c2-46d6-ba0b-db96e711fd43%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Oğuz Yarımtepe

unread,
Dec 21, 2017, 8:28:10 AM12/21/17
to ansible...@googlegroups.com
Installing Python 2.7 and setting the right path solved the issue. Thank you.

--
You received this message because you are subscribed to a topic in the Google Groups "Ansible Project" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ansible-project/r-_mx2mJNMs/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ansible-project+unsubscribe@googlegroups.com.

To post to this group, send email to ansible-project@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
Oğuz Yarımtepe
http://about.me/oguzy
Reply all
Reply to author
Forward
0 new messages