vCO Workflow Script to Add Multiple REST Hosts for Puppet

The following script enables adding multiple REST Hosts for Puppet

 

 

var arrPuppetHosts;
	arrPuppetHosts = new Array();
	arrPuppetHosts.push( "puppet-master-01" );
	arrPuppetHosts.push( "puppet-master-02" );
for ( var i = 0; i < arrPuppetHosts.length; i++ )
{
 var strPuppetHost;
 strPuppetHost = arrPuppetHosts[i];

 var objRESTHost;
 objRESTHost = new RESTHost(strPuppetHost);
 objRESTHost.url = "https://" + strPuppetHost + ".vcoflow.co.uk:8140";
 objRESTHost.connectionTimeout = 30.0;
 objRESTHost.operationTimeout = 60.0;

 objRESTHost = RESTHostManager.addHost(objRESTHost);
}

Leave a Reply