winrm or requests is not installed: No module named winrm

621 views
Skip to first unread message

Sathishs Subramani

unread,
Jan 16, 2023, 7:05:30 AM1/16/23
to rundeck-discuss
Hi Team,

I couldn't able to run windows commands and windows playbook from rundeck. can anyone please help.

rac...@rundeck.com

unread,
Jan 16, 2023, 7:07:25 AM1/16/23
to rundeck-discuss
Hi!

Could you elaborate?

Take a look at this guide, also, this case could help you.

Regards.
Message has been deleted

Sathishs Subramani

unread,
Jan 17, 2023, 10:31:41 AM1/17/23
to rundeck...@googlegroups.com
I couldn't able to control windows server using rundeck application whereas i can able to control it from ansible.

# su rundeck -s /bin/bash -c "ansible all -m ping"

[WARNING]: Unhandled error in Python interpreter discovery for host : winrm or requests is not installed: No module named winrm

 | FAILED! => {

    "msg": "winrm or requests is not installed: No module named winrm"

rac...@rundeck.com

unread,
Jan 17, 2023, 10:52:58 AM1/17/23
to rundeck-discuss
Hi Satish,

Make sure to have all python dependencies in the rundeck account, take a look at this.

Regards.

Sathishs Subramani

unread,
Jan 17, 2023, 12:11:09 PM1/17/23
to rundeck-discuss
Thank for the update, I still have the issue to connect from rundeck.

Can you possible to provide steps make fresh installation to control windows servers from rundeck. 

rac...@rundeck.com

unread,
Jan 17, 2023, 5:46:59 PM1/17/23
to rundeck-discuss
Hi Satish, basically follow this to integrate Ansible and Rundeck and then, you can use this windows inventory to connect to your windows boxes (you can see the step by step in both links).

Regards!

Sathishs Subramani

unread,
Jan 19, 2023, 8:03:24 AM1/19/23
to rundeck-discuss
Hello, 

I have replicate the same steps which you have provided the links but no luck. Still getting the same issue. Can you please help.

Sathishs Subramani

unread,
Jan 19, 2023, 8:26:51 AM1/19/23
to rundeck-discuss

[rundeck@hostname~]$ ansible-playbook /var/lib/rundeck/projects/automation/folder.yml 

Traceback (most recent call last):

  File "/usr/local/bin/ansible-playbook", line 34, in <module>

    from ansible import context

ModuleNotFoundError: No module named 'ansible'

rac...@rundeck.com

unread,
Jan 19, 2023, 8:45:41 AM1/19/23
to rundeck-discuss

Hi Satish, have you installed the ansible module for the rundeck user? It seems that you're facing this.

Make sure to have an ansible environment reachable by the rundeck user (this applies for ansible.cfg and inventory file too). Check this.

Greetings!

Sathishs Subramani

unread,
Jan 19, 2023, 1:43:10 PM1/19/23
to rundeck-discuss
Hello,

I could see ansible is installed on the server while check with root user whereas rundeck user getting error.

# pip list

Package            Version

------------------ ---------

ansible            4.10.0

ansible-core       2.11.12

# pip3 list

Package            Version

------------------ ---------

ansible            4.10.0

ansible-core       2.11.12

[rundeck@hostname~]$ pip3 list

Traceback (most recent call last):

  File "/usr/local/bin/pip3", line 7, in <module>

    from pip._internal.cli.main import main

  File "/usr/lib/python3.6/site-packages/pip/__init__.py", line 42, in <module>

    from pip.utils import get_installed_distributions, get_prog

  File "/usr/lib/python3.6/site-packages/pip/utils/__init__.py", line 27, in <module>

    from pip._vendor import pkg_resources

  File "/usr/lib/python3.6/site-packages/pip/_vendor/pkg_resources/__init__.py", line 3018, in <module>

    @_call_aside

  File "/usr/lib/python3.6/site-packages/pip/_vendor/pkg_resources/__init__.py", line 3004, in _call_aside

    f(*args, **kwargs)

  File "/usr/lib/python3.6/site-packages/pip/_vendor/pkg_resources/__init__.py", line 3031, in _initialize_master_working_set

    working_set = WorkingSet._build_master()

  File "/usr/lib/python3.6/site-packages/pip/_vendor/pkg_resources/__init__.py", line 651, in _build_master

    ws = cls()

  File "/usr/lib/python3.6/site-packages/pip/_vendor/pkg_resources/__init__.py", line 644, in __init__

    self.add_entry(entry)

  File "/usr/lib/python3.6/site-packages/pip/_vendor/pkg_resources/__init__.py", line 700, in add_entry

    for dist in find_distributions(entry, True):

  File "/usr/lib/python3.6/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2017, in find_on_path

    if len(os.listdir(fullpath)) == 0:

PermissionError: [Errno 13] Permission denied: '/usr/lib/python3.6/site-packages/xmltodict-0.13.0.dist-info'

I am trying to connect windows servers using kerberos method. What i am missing here. Can you please help. 

rac...@rundeck.com

unread,
Jan 23, 2023, 1:15:31 PM1/23/23
to rundeck-discuss
Hi Satish,

This definitely will help you. It includes a repo with all steps and examples

Regards.
Reply all
Reply to author
Forward
0 new messages