Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I am looking for advice on writing a bash script to put new server that we spin-up in AWS and get them added to our Stingrays.

We are creating a new environment in AWS that will be muilt-AZ in AWS autoscaling groups as we are building it with failure in mind. As we will be using the Stringrays in front of these systems for Load Balancing, WAF, URL re-writing etc as we spin up a new machine I want to be able to add the IP address on the Stingray. We are using Cloudforamtion and Puppet as part of this new system and the idea would be to get Puppet to execute a bash script to add them in.

If anyone has done this before and point me in the right direction that would be most helpful.

Thanks.

share|improve this question

1 Answer 1

up vote 1 down vote accepted

The Stingray Traffic Managers have a REST API which can be used for that.
If I recall correctly the REST API is currently included in all licenses but not enabled by default.

There is extensive documentation here: https://support.riverbed.com/content/support/software/stingray/traffic-manager.html under "references" -> "REST API Guide".
That PDF includes a section of common tasks such as "adding a node to a pool" - which is exactly what you need.
It also includes the source of a perl script implementing that.

Running such a script on a newly deployed node of course means that you will need to provide an account in it with sufficient rights to add a node.
That may not be a good idea depending on your infrastructure/security needs.
It might be a better idea to periodically check via mcollective or other means for webserver and add them from a central location.

And of course there is a autoscaling feature in Traffic Manager which automatically spins up AWS instances for you.

share|improve this answer
    
Thanks for this, it is somewhat helpful in regards that it points me in the place I want to go, if I just wanted to use BASH script to do this and execute a Curl command to PUT a new node in. Is that possible? –  djo Mar 13 at 3:33
    
@djo Yes, it's possible but not very easy. As you can see in the perl script you need to first retrieve the existing pool configuration and re-upload it with the extra node. Alternatively there is also a CLI interface at $ZEUS_HOME/bin/zcli and existing puppet manifests by Riverbed: forge.puppetlabs.com/riverbed/stingray –  faker Mar 13 at 8:54
    
I have had a look at the zcli tool also the Puppet module, I might look at using Puppet plus look at writing what I want in Python. I think I can learn Python easier than Perl :) I tried some stuff with curl and you are right it is a pain in the ass. –  djo Mar 13 at 11:34

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.