Skip to content

Instantly share code, notes, and snippets.

@chitacan
Created March 20, 2014 15:33
Show Gist options
  • Save chitacan/9666484 to your computer and use it in GitHub Desktop.
Save chitacan/9666484 to your computer and use it in GitHub Desktop.
class webserver{
case $operatingsystem {
ubuntu: {
$apache = 'apache2'
$configfile = '/etc/apache2/sites-enabled/000-default'
}
}
package { 'apache':
name => $apache,
ensure => 'installed',
}
file { 'site-config':
path => $configfile,
source => '/vagrant/manifests/site-config',
require => Package['apache'],
}
service { 'apache':
name => $apache,
ensure => 'running',
hasrestart => true,
subscribe => File['site-config']
}
file { '/vagrant/index.html':
content => "<h1> vagrant + puppet + ${apache} + ${operatingsystem}</h1>",
}
if $apache == 'apache2' {
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment