I am writing this post as part of course Linuxin keskitetty hallinta held by Tero Karvinen. In this article I will install Varnish reverse proxy and change its port by Puppet parametrized class. Double weeks ago I did article for how you install Apache with Puppet: http://nikokiuru.com/2013/11/puppet-package-file-service-example/.
Create new module
Remember first start by hello world! http://nikokiuru.com/2013/11/hello-puppet/
Code in init.pp:
Run module:
Create templates
First copy and modify varnish default config-file:
Change port 6081 to variable @varnish_port:
And next copy and modify varnish backend service config-file:
Change backend port to variable @backend_port:
And last add two file method in init.pp
And code in init.pp:
Finally run command:
Test
Result: