03-22-2015 01:40 AM - edited 03-01-2019 06:33 AM
Task Name | Infoblox_Host_Registration |
Description | I’ve just finished creating custom workflow tasks for integration into Infoblox Grid Manager. The attached workflows request the next free IP address from an Infoblox network range. A host is then registered as a DNS host record for that address. Rollback is also integrated. There is also a ‘delete record’ workflow task too. |
Prerequisites |
|
Category | Workflow (and tasks) |
Components | It has a custom task and sample test workflow.. |
Update 23/03/2015 | I've updated the 'Infoblox_Get_Next_Available_IP' workflow task so that it also retrieves the network comment field from the Infoblox Grid Manager and have named it 'Infoblox_Get_Next_Available_IP_v2'. New workflow task attached. |
Update 27/11/2015 | Please find attached a modified set of workflow tasks (InfoBlox_Workflows_UCSD_5_4_0_0_plus.wfdx) for use with UCS Director 5.4.0.0 and beyond. These are not compatible with UCS Director releases prior to 5.4.0.0. |
Instructions for Regular Workflow Use:
This could be combined with Orf’s 'VM with IP Input' tasks to provide VM creation with IP supplied by Infoblox.
Pictures speak louder than words, so here you go:
Infoblox IPAM configured networks:
Next free address for network 192.168.55.0/24:
Workflow ‘Infoblox Register New Host’:
…in action:
…
…
…Rollback:
…
…
Addendum to this awesome work by Russ...
In case the comment field in Infoblox contains the VLAN number, the number can be pulled out as well (version 2). This in turn could be used to assertion the vSwitch in UCSD for the VM (VM Deployment with USER IP INPUT)
NOTES for 5.4 Plus tasks from Russ.....
Important the comment field has to be filled out!!!!
Password masking Notes:
The log file before a little fix up:
The log after the fix up:
Here are the steps to mask the password in the log:
The custom task both columns have to have the password classification enabled:
Here is the place to enable that:
In the workflow properties section the password type has to be set:
it's very explicited!
Thank you for your submission. This workflow works sometimes but not all as I am receiving an error. Here is the error from the log; "
Sep 28, 2016 16:39:02 PDT Error occured at line # 278
Sep 28, 2016 16:39:02 PDT [Line#278] var netComment = jsonResponse.get(0).get('comment').getAsString();
Sep 28, 2016 16:39:02 PDT Task: Infoblox Register New Host 5_4_0_0_plus (custom_Infoblox_Get_Next_Available_IP_v3_5.4.0.0) failed with error - TypeError: null has no such function 'getAsString' in <eval> at line number 278, selectedContext=<None>
Sep 28, 2016 16:39:02 PDT Task #2 (Infoblox Register New Host 5_4_0_0_plus (custom_Infoblox_Get_Next_Available_IP_v3_5.4.0.0)) failed after 2 seconds"
I also noticed that the password is masked only in the last part of the workflow but not when it first starts up.
What is your UCSD version?
You ran the register workflow first right? On second look it looks like it is failing on your comment field. Is your comment field empty and the code does not handle it right?
The password mask should be enabled in the custom task and the Variable needs to be set to password vs. text.
These should be good with 6.0 correct?
Yes - I just ran this in Dec with 6.0.
I'm using UCSD 6.0 with the Infoblox-module, only the rollback functionality of the register-host task isn't working:
I get the message:
Rollback ***workflowname (SR xx)*** (custom_Infoblox_Delete_Record_v3_5.4.0.0) failed with error - Index: 0, Size: 0 in <eval> at line number 259, selectedContext=<None>
I dont have the code in front of me, but what is happening in the custom task around line 259?
Were any variables re-named?
May 03, 2017 13:30:09 UTC Executing custom script for Infoblox_Delete_Record_v3_5.4.0.0
May 03, 2017 13:30:09 UTC Error occured at line # 259
May 03, 2017 13:30:09 UTC [Line#259] var refStr = resp.get(0).get('_ref').getAsString();
One line – hmm – looks like it cant pull in variable resp as a string because it is probably empty…
Did any of the variable names change for the custom task?
Orf Gelbrich
Check out UCS Director Workflow INDEX<https://communities.cisco.com/docs/DOC-56419> on Cisco Communities Site (Twitter @UCSDGURU)
no changes of the code whatsoever.
(a consolidated portion of) the script is:
function infobloxDeleteRecord(ibIP,ibUser,ibPassword,fqdn) {
this.ibIP = ibIP;
this.ibUser = ibUser;
this.ibPassword = ibPassword;
this.fqdn = fqdn;
var request = new httpRequest();
request.setup(this.ibIP,"https",this.ibUser,this.ibPassword);
request.getRequest('/wapi/v1.2/record:host?name~='+fqdn);
request.contentType("json");
var statusCode = request.execute();
var getResponse = new InputStreamReader(request.getResponse("asStream"));
var resp = JSON.getJsonElement(getResponse, null);
var refStr = resp.get(0).get("_ref").getAsString();
// more
}
Did the API on the Infoblox change?
request.getRequest('/wapi/v1.2/record:host?name~='+fqdn);
the path?
Orf Gelbrich
Check out UCS Director Workflow INDEX<https://communities.cisco.com/docs/DOC-56419> on Cisco Communities Site (Twitter @UCSDGURU)
justed checked on https://community.infoblox.com/t5/API-Integration/The-definitive-list-of-REST-examples/td-p/1214
but no .. it has not been changed.
Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: