Rundeck Ansible integration

57 views
Skip to first unread message

Jitendra Ingale

unread,
Oct 18, 2021, 2:11:02 PM10/18/21
to rundeck-discuss
Hi,

I have setup Rundeck-Ansible integration using below article and with SSH Passowrd method.


I am getting below error after adding Ansible node to rundeck.

Rundeck version is 3.4..4 running on Windows Server 2016
Ansible Controller is running on Ubuntu 20.x


rundeck_node_command_error_18102021-3.PNG

rac...@rundeck.com

unread,
Oct 18, 2021, 2:49:05 PM10/18/21
to rundeck-discuss
Hi Jitendra,

Rundeck and Ansible must coexist in the same server to achieve the integration, checking your config, you're calling the configuration (`ansible.cfg` file) and inventory (`hosts`) in a UNIX path `/etc/ansible/xxxx` and your Rundeck instance is running in a Windows Node.

Ansible doesn't work on Windows natively, check this.

Please take a look at this first to get more information about the Rundeck Ansible plugin.

Hope it helps!

Jitendra Ingale

unread,
Oct 18, 2021, 3:32:13 PM10/18/21
to rundeck-discuss
Thanks for the response.

I have installed Rundeck on same Ubuntu 20.x server (2 vCPU, 4 GB RAM) where Ansible is running.

I am getting attached error while accessing it within local network. Rundeck service is running and also there does not exists any proxy or restrictions in this network.

rundeck_node_command_error_18102021-4.PNGrundeck_running.png

Jitendra Ingale

unread,
Oct 18, 2021, 4:05:34 PM10/18/21
to rundeck-discuss
PLEASE IGNORE MY EARLIER MESSAGE IN THIS REGARD AND REFER THIS ONE. EARLIER ONE HAD SCREENSHOTS WRONGLY ATTACHED.

Rundeck is installed and If I browse http://<IP_ADdress>:4440 it immediately redirected to http://localhost:4440/menu/home

I am unable to understand this behavior.

Please guide.

rac...@rundeck.com

unread,
Oct 18, 2021, 4:12:15 PM10/18/21
to rundeck-discuss

Hi Jitendra,

  1. Make sure that the 4440 port is open and accessible (maybe you need to define the port on the security group?).
  2. Make sure that Rundeck can listen from outside connections and configure using the external IP/domain name.

For example, these parameters on the rundeck-config.properties file:

server.address=0.0.0.0
grails.serverURL=http://172.20.10.190:4440

And the framework.properties file:

framework.server.name = 172.20.10.190
framework.server.hostname = 172.20.10.190
framework.server.port = 4440
framework.server.url = http://172.20.10.190:4440

Hope it helps!

Jitendra Ingale

unread,
Oct 18, 2021, 4:55:45 PM10/18/21
to rundeck-discuss
Yes I have resolved it by making chnages in  rundeck-config.properties and  framework.properties file

Now as my both Rundeck and Ansible running on same Ubuntu machine and further Ansible client is Windows 2016 machine. I am trying to add node by following below article and its failing with multiple errors.


===============
/usr/lib/python3.8/getpass.py:91: GetPassWarning: Can not control echo on the terminal.
passwd = fallback_getpass(prompt, stream)
Warning: Password input may be echoed.
PLAY [test playbook] ***********************************************************
TASK [Gathering Facts] *********************************************************
SSH password:
fatal: [localhost]: FAILED! => {"msg": "to use the 'ssh' connection type with passwords, you must install the sshpass program"}
PLAY RECAP *********************************************************************
localhost : ok=0 changed=0 unreachable=0 failed=1 skipped=0 rescued=0 ignored=0
Failed: AnsibleNonZero: ERROR: Ansible execution returned with non zero code.
===============

Please help me understand what will happen when I node and how does it work exactly ?
My Windows client machine will be added as node in Rundeck ?
And then Rundeck will execute Ansible commands to this node .. right ?

Jitendra Ingale

unread,
Oct 18, 2021, 5:01:00 PM10/18/21
to rundeck-discuss
Further to my queries,

As my Ansible controller can reach Windows client. Do I again need to establish SSH Authentication (private key or password) from Rundeck ?
I also tried with -None Selected option from SSH Authentication and it gives me below error,
========
PLAY [test playbook] ***********************************************************
TASK [Gathering Facts] *********************************************************
fatal: [localhost]: UNREACHABLE! => {"changed": false, "msg": "Failed to connect to the host via ssh: ansibleadmin@localhost: Permission denied (publickey,password).", "unreachable": true}
PLAY RECAP *********************************************************************
localhost : ok=0 changed=0 unreachable=1 failed=0 skipped=0 rescued=0 ignored=0
Failed: AnsibleNonZero: ERROR: Ansible execution returned with non zero code.
========

Also I am not sure about significance of KEY STORAGE section from Project Settings

rac...@rundeck.com

unread,
Oct 18, 2021, 5:24:48 PM10/18/21
to rundeck-discuss

Hi Jitendra,

The Rundeck/Ansible integration works to dispatch commands/playbooks to your Ansible inventory as Rundeck nodes (and I think that is your goal), is a way to use Rundeck to manage your Ansible server.

The example is focused on SSH Linux nodes.

If you’re trying to use a Windows machine as a target node, the best way is to use the WinRM protocol (you can achieve this not only using the ansible integration, you can use the pywinrm plugin directly on Rundeck).

An Ansible Inventory example of that windows box could be:

[mywindows]
192.168.1.84 ansible_shell_type=powershell

[mywindows:vars]
ansible_user=windowsuser
ansible_password=password
ansible_port=5985
ansible_connection=winrm
ansible_winrm_scheme=http
ansible_winrm_server_cert_validation=ignore

This specific windows protocol needs some steps from the windows target node side, please take a look at this.

Some tips:

  1. Make that you can reach the windows or any target node from the Rundeck server.
  2. Then make sure that the Ansible works using your inventory and that is the moment of integration with Rundeck.

Greetings.

Reply all
Reply to author
Forward
0 new messages