#Question 1:
class apache {
package {'apache2':
ensure => installed,
require => Service['apache2'],
}
service {'apache2':
ensure => running,
subscribe => File['/etc/apache2/apache2.conf'],
}
file {'/etc/apache2/apache2.conf':
ensure => present,
require => Package['apache2']
}
}
#Question 2:
class foofile {
file {'/etc/foo/file':
ensure => file,
}
}
class ssh::service {
service{'ssh':
ensure => running,
}
}
class ntp {
package {'ntp':
ensure => installed,
}
}