Skip to content

Instantly share code, notes, and snippets.

@adionditsak
Created December 25, 2013 00:04
Show Gist options
  • Save adionditsak/8118974 to your computer and use it in GitHub Desktop.
Save adionditsak/8118974 to your computer and use it in GitHub Desktop.
Maintain Apache2
class apache {
notify {'Apache2':
before => Service['apache2']
}
exec {'apt-get update':
command => '/usr/bin/apt-get update'
}
package {'apache2':
ensure => 'installed',
require => Exec['apt-get update']
}
service {'apache2':
ensure => 'running',
enable => true,
hasrestart => true,
hasstatus => true,
require => Package['apache2']
}
notify{'All done':
require => Service['apache2']
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment