No inventory was parsed

445 views
Skip to first unread message

vasanth G

unread,
Dec 11, 2018, 8:21:26 AM12/11/18
to rundeck...@googlegroups.com
Hi Racuna,
     I created a project named test_rundeck and added source by using ec2 plugin.
     in my node area, i got two nodes(by using private ip filtering. for ex:10.10.10.11,10.10.10.12).
     In my aws testmachine, I have ansible  script into testproject folder. There I have the below files.
  • hosts
  • group_vars/all.yml
  • main.yml
 In the host file I put only one node.(private ip. this node is same as one of the node what I get by ec2 plugin in rundeck. for ex:10.10.10.11)

Afterthat I created a job into test_rundeck name test_job.
This job step is ansible workflow node step. Here I mentioned main.yml path. And passed extra-argument as -i /etc/ansible/tetsproject/host.
    But I got the below Error.
Here my doubt is, is it possible to get the nodes from ec2 plugin and run ansible script.? If yes, how can I?
    In other words, I don't want to use my ansible inventory hosts But run the ansible main.yml script(need group_vars/all.yml). I wants to use the inventory as source nodes(What I got from rundeck aws ec2 plugin) in rundeck. 

17:48:49Skava-Internal-Golden-AMI-test-3 1. test_job
17:48:49 [WARNING]: Unable to parse /etc/ansible/hosts as an inventory source
17:48:49 [WARNING]: No inventory was parsed, only implicit localhost is available
17:48:49 [WARNING]: provided hosts list is empty, only localhost is available. Note
17:48:49that the implicit localhost does not match 'all'
17:48:49 [WARNING]: Could not match supplied host pattern, ignoring: Internal-
17:48:49Golden-AMI-test-3
17:48:50
17:48:50PLAY [calling setups] **********************************************************
17:48:50skipping: no hosts matched
17:48:50
17:48:50PLAY RECAP *********************************************************************
17:48:50
17:48:50Tuesday 11 December 2018 12:18:50 +0000 (0:00:00.114) 0:00:00.114 ******
17:48:50===============================================================================
17:48:50Playbook run took 0 days, 0 hours, 0 minutes, 0 seconds

Thanks & Regards,
    G.Vasantha Kumar
    Mobile : 86950 09298

rac...@rundeck.com

unread,
Dec 11, 2018, 11:32:09 AM12/11/18
to rundeck-discuss
Hi Vasantha,

Seems that your host file is unreadable, check the permissions of /etc/ansible/tetsproject/host file, ensure that 'rundeck' user can reach it.

About use nodes of EC2 plugin you have a 'tricky' option to play using and the ec2.py script (https://raw.githubusercontent.com/ansible/ansible/devel/contrib/inventory/ec2.py).

Basically, the idea is create a script that using the ec2.py to make the resource model file and make that Ansible plugin can get this from Inventory.


You have more information about Ansible Dynamic Inventory here:


And here how works ec2.py script:


Regards!
Reply all
Reply to author
Forward
0 new messages