Powered By Blogger

2014/08/19

Ansible Hosts / Install alternate upgraded Python version

Following the highlighted error below which happened while trying to configure a RHEL4 node to be manageable by ansible (and that i rightly attributed to the old Python 2.3.4 which is the default version of Python for RHEL4), i've decided to install an alternate Python version on the same RHEL node without impacting the already existing environment. Below i'm sharing the 8 steps I followed to have that working.
Note that although i'm describing this Python Installation in  relation with Ansible Integration, Step 1 to Step 6 can be used for the installation of an alternate Python Environment on any other Linux Systems.

Ansible's Error:
[stivesso@ansible-server ~]$ ansible my_ansible_node -m ping  --ask-pass
SSH password:
my_ansible_node | FAILED >> {
    "failed": true,
    "msg": "\r\nSUDO-SUCCESS-josewbugtgyoijxrgkuxihoejbjsbiuq\r\n  File \"/home/esso_s/.ansible/tmp/ansible-tmp-1406122775.05-117998270117858/ping\", line 1177\r\n    clean_args = \" \".join(pipes.quote(arg) for arg in args)\r\n
     ^\r\nSyntaxError: invalid syntax\r\n", 
    "parsed": false
}


1. Install Prerequisites on the target host



2. Get an updated python package



3. Untar/unzip the package on the target node



4. configure with the alternate path as option (here, i'm planning to install the alternate environment in /opt/python2.7) and compile/install




5. Export Shared Library and Bin Library in PATH and LD_LIBRARY_PATH on User profile 



6. Create ld.so.conf configuration file and run ldconfig to have library loaded system wide



7. Add the following to /etc/ansible/hosts on the Ansible Control Machine for the target node

 

8. Test again the ping module from ansible-server...

No comments:

Post a Comment