Skip to content

Instantly share code, notes, and snippets.

@big-samantha
Created June 14, 2012 23:30
Show Gist options
  • Save big-samantha/2933650 to your computer and use it in GitHub Desktop.
Save big-samantha/2933650 to your computer and use it in GitHub Desktop.
2.6.1. The apache::install class
Firstly, we install Apache via the apache::install class:
class apache::install {
package { [ "apache2" ]:
ensure => present,
}
}
This class currently just installs Apache on an Ubuntu host; we could easily add an apache::params class in the style of our SSH module to support multiple platforms.
2.6.2. The apache::service class
For this module we're going to skip a configuration class, because we can just use the default Apache configuration. Let's move right to an apache::service class to manage the Apache service itself.
class apache::service {
service { "apache2":
ensure => running,
hasstatus => true,
hasrestart => true,
enable => true,
require => Class["apache::install"],
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment