Service now dynamic inventory

Has anyone written a dynamic inventory script that integrates with service now's cmdb/discovery? My company has decided to use service now's cmdb so I guess I should leverage it for our inventory.

Hello Michael,

We have published a dynamic inventory script for generating inventory from ServiceNow’s CMDB that can be used by Ansible playbooks. Here it is:
https://github.com/juniper-it/ansible-jnpr-modules/tree/master/inventory_plugins

Thanks,
Rohit

Thanks for sharing this has several improvements on mine. I hadn’t taken the time to implement a cache (our queries are really slow) or make the the query parameters generic.

Hello All,

As of July 27, 2015, please refer to this updated github link for ServiceNow dynamic inventory script:
https://github.com/juniper-it/ansible-modules-juniper-it/tree/master/inventory_plugins

Thanks,
Rohit

Hello Rohit,

The link you provide does not seem to be anymore available.
Is it still available elsewhere ?

Nicolas

Nicolas,

I found a copy here:

https://github.com/perzizzle/ansible-jnpr-modules/blob/master/inventory_plugins/service_now_inventory.py

I haven’t tested if this still works with a current ServiceNow version, though.

Best regards.