Rundeck inventory

314 views
Skip to first unread message

Andrew Meyer

unread,
Sep 5, 2023, 1:18:40 PM9/5/23
to rundeck-discuss
I got my rundeck instance in my home lab set up.  Working with postgres now.  I am trying to set it up and created a test project.  I then added all the necessary info to access other machines.  Once I did that I went to add my hosts file/inventory.  I am now getting this error:
The Node Source had an error:
com.dtolabs.rundeck.core.resources.format.ResourceFormatParserException: com.dtolabs.rundeck.core.common.NodeFileParserException: java.lang.ClassCastException: class java.lang.String cannot be cast to class java.util.Map (java.lang.String and java.util.Map are in module java.base of loader 'bootstrap')

I also went and downloaded the rundeck-bootstrap rpm file.  The hosts/inventory file I'm using does not have a .yaml/yml extension on it but is in the proper ansible grouping format for that file.

Any help is greatly appreciated!

rac...@rundeck.com

unread,
Sep 5, 2023, 2:02:23 PM9/5/23
to rundeck-discuss
Hi Andrew,

It seems a problem with your model source file format. Some questions to understand better:

1. Which Rundeck version are you using?
2. What do you mean with "rundeck-bootstrap rpm file"? (you don't need extra packages).
3. Could you share your project model source config and the yaml file content to take a look?

Regards!

Andrew Meyer

unread,
Sep 5, 2023, 2:27:29 PM9/5/23
to rundeck-discuss
Sorry about that.
I am using rundeck 4.15.0
I had some issues with it reading the file and researched -  found out that I needed this - https://github.com/rundeck/plugin-bootstrap/releases/download/0.4.11/rundeck-plugin-bootstrap-0.4.11-1.noarch.rpm

Here is the project config file:

#Tue Sep 05 13:26:58 CDT 2023
#edit below
ansible-binaries-dir-path=/usr/bin
project.ansbile-inventory=/opt/syseng/automation/ansible1/hosts
project.ansible-become-method=sudo
project.ansible-become-user=ansible
project.ansible-become=true
project.ansible-config-file-path=/opt/syseng/automation/ansible1/ansible.cfg
project.ansible-executable=/usr/bin/bash
project.ansible-generate-inventory=true
project.ansible-ssh-auth-type=privateKey
project.ansible-ssh-keypath=/var/lib/rundeck/.ssh/id_rsa
project.ansible-ssh-passphrase-option=option.password
project.ansible-ssh-user=ansible
project.description=
project.disable.executions=false
project.disable.schedule=false
project.execution.history.cleanup.batch=500
project.execution.history.cleanup.enabled=false
project.execution.history.cleanup.retention.days=60
project.execution.history.cleanup.retention.minimum=50
project.execution.history.cleanup.schedule=0 0 0 1/1 * ? *
project.jobs.gui.groupExpandLevel=1
project.label=
project.later.executions.disable=false
project.later.executions.enable=false
project.later.schedule.disable=false
project.later.schedule.enable=false
project.name=ASM_Test_Ansible_01
project.nodeCache.enabled=true
project.nodeCache.firstLoadSynch=true
project.output.allowUnsanitized=false
project.ssh-authentication=privateKey
project.ssh-command-timeout=0
project.ssh-connect-timeout=0
project.ssh-keypath=/var/lib/rundeck/.ssh/id_rsa
resources.source.1.type=local
resources.source.2.config.ansible-become-method=sudo
resources.source.2.config.ansible-become-user=ansible
resources.source.2.config.ansible-become=true
resources.source.2.config.ansible-binaries-dir-path=/usr/bin/
resources.source.2.config.ansible-config-file-path=/opt/syseng/automation/ansible1.cfg
resources.source.2.config.ansible-gather-facts=true
resources.source.2.config.ansible-ignore-errors=true
resources.source.2.config.ansible-inventory=/opt/syseng/automation/ansible1/hosts
resources.source.2.config.ansible-ssh-auth-type=privateKey
resources.source.2.config.ansible-ssh-keypath=/var/lib/rundeck/.ssh/id_rsa
resources.source.2.config.ansible-ssh-user=ansible
resources.source.2.type=com.batix.rundeck.plugins.AnsibleResourceModelSourceFactory
resources.source.3.config.file=/opt/syseng/automation/ansible1/hosts
resources.source.3.config.format=resourceyaml
resources.source.3.config.generateFileAutomatically=true
resources.source.3.config.includeServerNode=true
resources.source.3.config.writeable=true
resources.source.3.type=file
service.FileCopier.default.provider=jsch-scp
service.NodeExecutor.default.provider=com.batix.rundeck.plugins.AnsibleNodeExecutor

rac...@rundeck.com

unread,
Sep 5, 2023, 3:44:45 PM9/5/23
to rundeck-discuss
I see, Could you post your inventory file to test it? (change/edit any potentially sensitive information).

Thanks!

Andrew Meyer

unread,
Sep 5, 2023, 3:56:29 PM9/5/23
to rundeck...@googlegroups.com
Do you want the format it is in?  How much of it should I change?  It has all internal hostnames....


Please remember to reply to all if there are multiple recipients.

Andrew Meyer
andre...@gmail.com
314-266-4837 (Google Voice)


--
You received this message because you are subscribed to a topic in the Google Groups "rundeck-discuss" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/rundeck-discuss/UF_iU0CsvgM/unsubscribe.
To unsubscribe from this group and all its topics, send an email to rundeck-discu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rundeck-discuss/05b2cc74-0e4e-463e-9ad3-7bf3588afd65n%40googlegroups.com.

rac...@rundeck.com

unread,
Sep 5, 2023, 4:20:08 PM9/5/23
to rundeck-discuss
Yes, an example file (with fake data) to reproduce the issue.

Greetings.

Andrew Meyer

unread,
Sep 5, 2023, 4:24:16 PM9/5/23
to rundeck-discuss
Message has been deleted

rac...@rundeck.com

unread,
Sep 5, 2023, 6:45:55 PM9/5/23
to rundeck-discuss
For any reason, my last message was deleted by Google Groups.

So, checking your config you have a third model source pointing to the ansible inventory file, look:

resources.source.3.config.file=/opt/syseng/automation/ansible1/hosts

That file model source isn't for ansible (that's is the root cause of the "parsing error"), only works for Rundeck yaml model source file

Delete this model source and keep the second one (Ansible model source) properly configured to use the Ansible inventory, take a look at this guide to check how to configure it.

Hope it helps!

Andrew Meyer

unread,
Sep 5, 2023, 10:22:05 PM9/5/23
to rundeck...@googlegroups.com
I removed the config lines and didn't make a difference.



Please remember to reply to all if there are multiple recipients.

Andrew Meyer
andre...@gmail.com
314-266-4837 (Google Voice)

Andrew Meyer

unread,
Sep 5, 2023, 10:44:21 PM9/5/23
to rundeck-discuss
Also I did set the inventory up this way....maybe I need to remove it and start over?

rac...@rundeck.com

unread,
Sep 6, 2023, 7:58:58 AM9/6/23
to rundeck-discuss
Remove the model source (YAML File) from the gui (Project Configuration > Edit Nodes). Keep only the local node and the ansible model source.

Andrew Meyer

unread,
Sep 6, 2023, 9:54:25 AM9/6/23
to rundeck-discuss
Like this?


Screenshot from 2023-09-06 08-52-28.pngScreenshot from 2023-09-06 08-53-04.png

rac...@rundeck.com

unread,
Sep 6, 2023, 10:22:10 AM9/6/23
to rundeck-discuss
Yes, and make sure the ansible.cfg file contains the inventory as follows:

inventory     = /path/to/your/inventory/file

Do you get the same error in the nodes page if you remove the YAML file model source?

Regards.

Andrew Meyer

unread,
Sep 6, 2023, 11:02:49 AM9/6/23
to rundeck...@googlegroups.com
I don't get the error any more but I also don't have any hosts loaded to run playbooks against.



Please remember to reply to all if there are multiple recipients.

Andrew Meyer
andre...@gmail.com
314-266-4837 (Google Voice)

rac...@rundeck.com

unread,
Sep 6, 2023, 12:01:14 PM9/6/23
to rundeck-discuss

Let me share my config, probably your ansible.cfg needs some change:

My ansible.cfg, nothing special, almost the default one. I ommited the commented lines:

[defaults] inventory = /home/user/Deployments/Ansible/config/hosts nocows = 1 [inventory] [privilege_escalation] [paramiko_connection] [ssh_connection] [persistent_connection] [sudo_become_plugin] [selinux] [colors] [diff] [galaxy]

My inventory test file (hosts), I ommited the commented lines.

[the_farm] 192.168.56.20 192.168.56.21 192.168.56.22 [the_farm:vars] ansible_user=vagrant

My node executor config (the config file path is hidden, that bug was reported)
My file copier config
My model source config.

You will see your nodes on the “Nodes” page and dispatch any job/command (ansible playbook based or not) against the ansible inventory.

Also: make sure the rundeck user can read the ansible config and inventory files.

Regards.

Andrew Meyer

unread,
Sep 6, 2023, 12:28:12 PM9/6/23
to rundeck-discuss
So I changed my config to match yours.  I even changed the inventory line in the ansible.cfg and refreshed the page.  Does it take a minute to refresh the inventory from the file?  Does it read it once every minute?  I'm still not seeing any hosts in the nodes page yet.

rac...@rundeck.com

unread,
Sep 6, 2023, 12:29:41 PM9/6/23
to rundeck-discuss
Do you see any clue in the service.log file?

Andrew Meyer

unread,
Sep 6, 2023, 12:32:30 PM9/6/23
to rundeck-discuss
rundeck.log
[2023-09-06T11:29:44,195] WARN  lib.Repository [main] - close() called when useCnt is already zero for Repository[/var/lib/rundeck/projects/ASM_Test_01/ScmImport/.git]
[2023-09-06T11:29:45,169] WARN  lib.Repository [pool-12-thread-2] - close() called when useCnt is already zero for Repository[/var/lib/rundeck/projects/ASM_Test_01/ScmImport/.git]
[2023-09-06T11:29:47,591] ERROR events.UserActionService [qtp384565349-23] - Null authentication on event
[2023-09-06T11:29:47,591] ERROR events.UserActionService [qtp384565349-23] - Null user name on logout event
[2023-09-06T11:29:47,591] ERROR audit.AuditEventsService [qtp384565349-23] - Null authentication on logout event. Cancelling event dispatch.
[2023-09-06T11:30:05,043] WARN  lib.Repository [pool-12-thread-2] - close() called when useCnt is already zero for Repository[/var/lib/rundeck/projects/ASM_Test_01/ScmImport/.git]

service.log
[2023-09-06T11:31:37,981] ERROR interceptors.SetUserInterceptor - Invalid API token used: <TOKE****
[2023-09-06T11:31:37,981] ERROR interceptors.AuthorizationInterceptor - (Token:<TOKE****) UNAUTHORIZED for execution/apiExecutionModeStatus
[2023-09-06T11:31:39,998] ERROR interceptors.SetUserInterceptor - Invalid API token used: <TOKE****
[2023-09-06T11:31:39,999] ERROR interceptors.AuthorizationInterceptor - (Token:<TOKE****) UNAUTHORIZED for execution/apiExecutionModeStatus
[2023-09-06T11:31:42,015] ERROR interceptors.SetUserInterceptor - Invalid API token used: <TOKE****
[2023-09-06T11:31:42,015] ERROR interceptors.AuthorizationInterceptor - (Token:<TOKE****) UNAUTHORIZED for execution/apiExecutionModeStatus
[2023-09-06T11:31:44,033] ERROR interceptors.SetUserInterceptor - Invalid API token used: <TOKE****
[2023-09-06T11:31:44,033] ERROR interceptors.AuthorizationInterceptor - (Token:<TOKE****) UNAUTHORIZED for execution/apiExecutionModeStatus
[2023-09-06T11:31:45,069] WARN  lib.Repository - close() called when useCnt is already zero for Repository[/var/lib/rundeck/projects/ASM_Test_01/ScmImport/.git]
[2023-09-06T11:31:46,051] ERROR interceptors.SetUserInterceptor - Invalid API token used: <TOKE****
[2023-09-06T11:31:46,051] ERROR interceptors.AuthorizationInterceptor - (Token:<TOKE****) UNAUTHORIZED for execution/apiExecutionModeStatus
[2023-09-06T11:31:48,072] ERROR interceptors.SetUserInterceptor - Invalid API token used: <TOKE****
[2023-09-06T11:31:48,073] ERROR interceptors.AuthorizationInterceptor - (Token:<TOKE****) UNAUTHORIZED for execution/apiExecutionModeStatus
[2023-09-06T11:31:50,092] ERROR interceptors.SetUserInterceptor - Invalid API token used: <TOKE****
[2023-09-06T11:31:50,093] ERROR interceptors.AuthorizationInterceptor - (Token:<TOKE****) UNAUTHORIZED for execution/apiExecutionModeStatus
[2023-09-06T11:31:52,110] ERROR interceptors.SetUserInterceptor - Invalid API token used: <TOKE****
[2023-09-06T11:31:52,111] ERROR interceptors.AuthorizationInterceptor - (Token:<TOKE****) UNAUTHORIZED for execution/apiExecutionModeStatus
[2023-09-06T11:31:54,129] ERROR interceptors.SetUserInterceptor - Invalid API token used: <TOKE****
[2023-09-06T11:31:54,129] ERROR interceptors.AuthorizationInterceptor - (Token:<TOKE****) UNAUTHORIZED for execution/apiExecutionModeStatus
[2023-09-06T11:31:56,147] ERROR interceptors.SetUserInterceptor - Invalid API token used: <TOKE****
[2023-09-06T11:31:56,148] ERROR interceptors.AuthorizationInterceptor - (Token:<TOKE****) UNAUTHORIZED for execution/apiExecutionModeStatus
[2023-09-06T11:31:58,165] ERROR interceptors.SetUserInterceptor - Invalid API token used: <TOKE****
[2023-09-06T11:31:58,166] ERROR interceptors.AuthorizationInterceptor - (Token:<TOKE****) UNAUTHORIZED for execution/apiExecutionModeStatus
[2023-09-06T11:32:00,183] ERROR interceptors.SetUserInterceptor - Invalid API token used: <TOKE****
[2023-09-06T11:32:00,183] ERROR interceptors.AuthorizationInterceptor - (Token:<TOKE****) UNAUTHORIZED for execution/apiExecutionModeStatus
[2023-09-06T11:32:02,200] ERROR interceptors.SetUserInterceptor - Invalid API token used: <TOKE****
[2023-09-06T11:32:02,200] ERROR interceptors.AuthorizationInterceptor - (Token:<TOKE****) UNAUTHORIZED for execution/apiExecutionModeStatus
[2023-09-06T11:32:04,219] ERROR interceptors.SetUserInterceptor - Invalid API token used: <TOKE****
[2023-09-06T11:32:04,220] ERROR interceptors.AuthorizationInterceptor - (Token:<TOKE****) UNAUTHORIZED for execution/apiExecutionModeStatus
[2023-09-06T11:32:05,015] WARN  lib.Repository - close() called when useCnt is already zero for Repository[/var/lib/rundeck/projects/ASM_Test_01/ScmImport/.git]
[2023-09-06T11:32:06,237] ERROR interceptors.SetUserInterceptor - Invalid API token used: <TOKE****
[2023-09-06T11:32:06,238] ERROR interceptors.AuthorizationInterceptor - (Token:<TOKE****) UNAUTHORIZED for execution/apiExecutionModeStatus
[2023-09-06T11:32:08,255] ERROR interceptors.SetUserInterceptor - Invalid API token used: <TOKE****
[2023-09-06T11:32:08,256] ERROR interceptors.AuthorizationInterceptor - (Token:<TOKE****) UNAUTHORIZED for execution/apiExecutionModeStatus
[2023-09-06T11:32:10,272] ERROR interceptors.SetUserInterceptor - Invalid API token used: <TOKE****
[2023-09-06T11:32:10,273] ERROR interceptors.AuthorizationInterceptor - (Token:<TOKE****) UNAUTHORIZED for execution/apiExecutionModeStatus

Andrew Meyer

unread,
Sep 6, 2023, 12:41:09 PM9/6/23
to rundeck-discuss
Got it!  Had to turn off gather facts!
Reply all
Reply to author
Forward
0 new messages