Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Write a puppet module to accomplish the following: Automatically install and run

ID: 3833313 • Letter: W

Question

Write a puppet module to accomplish the following: Automatically install and run apache with a default HTML page that gives information about the system. That information should be: Operating System name, uptime, load averages, and 3 others of your choice from the facter command.

Some Helpful steps:

Shutdown httpd if running.

Test your module to see if nginx is installed successfully.

Ensure that nginx is running as well. ---- systemctl status …?

Find out where the default index.html page is stored.-------- Somewhere in /var?

Modify your puppet module to use a template for said index.html

Create a template file for index.html to include the information from facter.

DON’T MODIFY THE /VAR ONE, create a template file in your module.

Recall the brief mention of the tag language stuff from the lecture.

Operating System name

Uptime

Load averages

and 3 other facts you find interesting from facter.

Explanation / Answer

apache intallation

$ mkdir -p puppet/modules/apache2/manifests
$ cd puppet/
$ nano modules/apache2/manifests/init.pp

apache run

class apache2 {
        package {'apache2':
                ensure => present,
        }

        service {'apache2':
                ensure => "running",
                enable => "true",
                require => Package["apache2"],
        }

        file { '/etc/apache2/mods-enabled/userdir.load':
                ensure => 'link',
                target => '/etc/apache2/mods-available/userdir.load',
                notify => Service["apache2"],
                require => Package["apache2"],
        }

        file { '/etc/apache2/mods-enabled/userdir.conf':
                ensure => 'link',
                target => '/etc/apache2/mods-available/userdir.conf',
                notify => Service["apache2"],
                require => Package["apache2"],
        }
}

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote