Closed cts-dev closed 3 years ago
It should work as long as you are not using enhanced inventory, the plugin uses the Table API which supports database views. I would recommend using the REST API Explorer on the ServiceNow instance to see if your view returns the data you expect.
It should work as long as you are not using enhanced inventory, the plugin uses the Table API which supports database views. I would recommend using the REST API Explorer on the ServiceNow instance to see if your view returns the data you expect.
That's interesting. To answer your question, yes we are able to curl the data as well and we get the correct JSON output we're looking for. But Tower is refusing to import.
If you use the inventory plug-in from a command-line playbook do you see inventory returned?
You may need to define the selection_order
option in your inventory file. By default, it looks to add the host to inventory by the first valid value from the fields ip_address,fqdn,host_name,name
. If your database view does not have any fields with exactly those names, no hosts will be added to inventory.
Please re-open if you still have questions.
Currently on a project integrating Red Hat Ansible Tower 3.7.3 with Service Now as the inventory source. We're able to pull data directly in through SN_TABLE: cmdb_ci_server etc. However, we're unable to pull anything from a view we created SN_TABLE: u_server_linked_app_report_list
As far as the plugin is concerned, are database views treated any differently? I cannot seem to find any examples or anywhere specifically in the plugin code at first glance that would prevent the import. Thank you.