Configure Windows python winrm plugin to use non default python

600 views
Skip to first unread message

ADALZISO FRANCISCHINE

unread,
Sep 25, 2018, 7:48:51 AM9/25/18
to rundeck-discuss
I would like to use the Windows python winrm plugin to use non default python.
Use /usr/local/bin/python2.7 instead of /usr/bin/python
Does anyone has any hint how to do this ? 

edu...@rundeck.com

unread,
Sep 25, 2018, 10:26:18 AM9/25/18
to rundeck-discuss
Hi,

You can set the python path, e.g creating a .bashrc file in your /var/lib/rundeck directory ('rundeck' user home).

Hope it helps!

edu...@rundeck.com

unread,
Sep 25, 2018, 10:55:14 AM9/25/18
to rundeck-discuss
wrong link.



Cheers!

ADALZISO FRANCISCHINE

unread,
Oct 1, 2018, 8:26:10 AM10/1/18
to rundeck-discuss


On Tuesday, September 25, 2018 at 10:55:14 AM UTC-4, edu...@rundeck.com wrote:
wrong link.



Cheers!

 Thanks for your hint.

I have rundeck  rundeck-2.11.5-1.56 installed in Red Hat Enterprise Linux Server release 6.10 (Santiago)
Red Hat 6 has default python 2.6 under /usr/bin

I plan to use Windows pyhton winrm plugin to manage from linux rundeck server, windows nodes that uses kerberos protocol
Requirements for the python plugin do not install well with python 2.6.6 that is required for REdHat 6. So  I have to install an alternate python 2.7 for this purpose.

I installed the alternate python 2.7.15  in /usr/local/bin/python2.7

Everything works well when I rename the default system python to a link to /usr/local/bin/python2.7
  [12:17:10 UTC] -> ls -al /usr/bin/python
lrwxrwxrwx 1 root root 24 Sep 28 15:50 /usr/bin/python27.link -> /usr/local/bin/python2.7


But after the undoing  the above hack and adding  the following line to the file /var/lib/rundeck/.bashrc
export PATH=/usr/local/bin:$PATH
alias python='/usr/local/bin/python2.7'
I still have the same issue from rundeck when invoking python (still points to python 2.6)

When I log as rundeck user through command line, I see python 2.7 as default one
 [12:09:46 UTC] -> whoami
root
root@x00106 [x00106.diomain.com]:~
  [12:09:48 UTC] -> su - rundeck
rundeck@x00106 [x00106.domain.com]:~
  [12:09:56 UTC] -> python -V
Python 2.7.15
rundeck@x00106 [x00106.domain.com]:~

But from rundeck scripts, and windows python winrm plugin, it still points to the 2.6 one, default /usr/bin/ptyhon

Is there any additional config required inside rundeck ?

Thanks again

ADALZISO FRANCISCHINE

unread,
Oct 1, 2018, 4:17:11 PM10/1/18
to rundeck-discuss
I found a solution that does not require to overwrite  system default python

Create file:
/etc/sysconfig/rundeckd
with the following contents:
export PATH=/usr/local/bin:$PATH

In the directory
/usr/local/bin
create a python symbolic link:
python -> python2.7

python wirnrm plugin works fine with non default python
/usr/local/bin/python2.7
Reply all
Reply to author
Forward
0 new messages