Ansible inventory passed by Rundeck dont work

444 views
Skip to first unread message

Stefano Leandro

unread,
Mar 26, 2019, 6:05:29 PM3/26/19
to rundeck-discuss
Hi Folks,

When i passing the ansible inventory file via extra vars Rundeck box dont work.

If i run the playbook passing the same inventory ,works.

Someone help me

Im passing the inveroty typing -i vm_hosts into extra vars rundeck box and return me :
ERROR! Specified hosts and/or --limit does not match any hosts


Thank you

rac...@rundeck.com

unread,
Mar 26, 2019, 6:57:21 PM3/26/19
to rundeck-discuss
Hi Stefano,

Maybe you are specified the inventory on Resource Model.


Another option, add --limit=all in your extra vars like:

Untitled.png



Hope it helps!

Stefano Leandro

unread,
Mar 26, 2019, 7:19:39 PM3/26/19
to rundeck-discuss
Hi,

Well,

this how configured the job :



and this is the ansible step extra vars :

"-i ${file.inventory.fileName}"  -e "vc_username=${option.vc_username} vc_password=${option.vc_password}"


what obtain right now is :

[WARNING]: Unable to parse /etc/ansible/ vm_hosts as an inventory source
17:12:10 [WARNING]: No inventory was parsed, only implicit localhost is available
17:12:10 [WARNING]: provided hosts list is empty, only localhost is available. Note
17:12:10that the implicit localhost does not match 'all'
17:12:11
17:12:11PLAY [Create a VM from a template] *********************************************
17:12:11skipping: no hosts matched
17:12:11
17:12:11PLAY RECAP *********************************************************************
17:12:11



Also obtain this one if i create a shell script inline

But if i run by shell works.

What im trying to implement is :
Passing via option file type the ansible inventory for provisioning multi vmware vm
This is means that ansible need to connect locally / rundeck node /localhost.


Thank you

rac...@rundeck.com

unread,
Mar 27, 2019, 8:51:48 AM3/27/19
to rundeck-discuss
Hi Stefano,

Check that Rundeck user can be access to Ansible config and host/groups files (check the permission)

And make sure that you've defined the hosts/groups correctly:


Another tip, check that:


Regards!

Hope it helps!

Stefano Leandro

unread,
Mar 31, 2019, 11:05:15 AM3/31/19
to rundeck-discuss
I fixed anything using shell scripting :)


Stefano

Jason Lehman

unread,
Apr 9, 2019, 3:59:06 PM4/9/19
to rundeck-discuss
Shouldn't need a shell script for this, just change whom the users is executing as.

ansible-playbook playme.yml --i /inventories/myinventory.yml -u USERWITHACCESS
Reply all
Reply to author
Forward
0 new messages