In my previous article, titled,“Puppet : Writing Complex dynamic “Motd” module using facts” , I wrote about how to write complex “motd” module to display motd when someone login to any server in the environment.
In this article, we are going to see how to use “Puppet Forge” to Download and use pre-written community modules.
We will see how can we can download and use “nginx” module and configure nginx on Puppet-Client .
Please follow below steps in sequence:
- Visit “https://forge.puppet.com/” and search for module called “nginx”.
2. Now Login to Puppet Master server and run below command to download “nginx” module:
puppet module install puppet-nginx
Note : Here Puppet refers to the user who owns the module on Puppet-Forge website and nginx is the actual module name.
3. Now go to “/etc/puppetlabs/code/environments/production/modules” directory , you will see nginx module downloaded there:
4. Now go to “/etc/puppetlabs/code/environments/production/manifests” directory and modify site.pp to look like below.
5. Now run below command to validate if there’s syntax error in site.pp:
puppet parser validate site.pp
6. Now login to Puppet-client and run below command:
puppet agent -t
7. Now Validate if Nginx has been installed and if the Nginx services are up and running on puppet-client.
8. Now go to your web browser and type the ip of the puppet-client. You will see the Nginx web server up and running.
That’s It. We are done !!