puppetlabs / puppetlabs-servicenow_cmdb_integration

Other
1 stars 15 forks source link

Add dry test to validate credentials #44

Closed ekinanp closed 4 years ago

ekinanp commented 4 years ago

Currently if a user provides invalid credentials, the error will be reported at runtime (when the servicenow.rb script is executed on the node) instead of during the trusted external data setup. The work here should add a dry test in init.pp that makes a ServiceNow API call to the specified {{cmdb_table}} (it's probably enough to just invoke the servicenow.rb script with an arbitrary certname since the script returns an empty hash for those certnames). So something like exec 'servicenow.rb foo' is enough.