O'Reilly logo

Learning Puppet by Jussi Heinonen

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Adding parameters to the loadbalancer class

The load balancer node is now working, but the configuration is quite static in the sense that the HTTP end points /nagios and /webapp are bound to back-end services defined in the class loadbalancer. What if the web server's IP address changes or we wanted to change the name of the end points? We could adjust the loadbalancer class, but the better option is to make the loadbalancer class to accept parameters that enables us to specify the end points and backend service URLs when we call the class.

We currently use the following "hardcoded" URL mappings in the class loadbalancer:

{ 'path' => '/nagios', 'url' => 'http://192.168.56.11/nagios' }

This links the resource /nagios with URL http://192.168.56.11/nagios ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required