-
-
Save jfryman/3659922 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bundle agent httpd_server { | |
vars: | |
"packages" slist => { | |
"httpd", | |
"mod_ssl", | |
"mod_perl", | |
"mod_authz_ldap", | |
}; | |
"services" slist => { | |
"httpd", | |
}; | |
"files" slist => { | |
"/etc/httpd/vhost.d/localhost/default", | |
"/etc/httpd/vhost.d/localhost/dummy.conf", | |
"/etc/httpd/vhost.d/public/default", | |
"/etc/httpd/vhost.d/public/dummy.conf", | |
"/etc/httpd/vhost.d/ssl/default", | |
"/etc/httpd/vhost.d/ssl/dummy.conf", | |
"/etc/httpd/include/ssl.inc", | |
"/etc/httpd/Apache2/PassSSLVars.pm", | |
"/etc/httpd/Apache2/FilterSnoop.pm", | |
"/etc/httpd/Apache2/FilterObfuscate.pm", | |
"/etc/httpd/conf.d/adauth.cf", | |
"/etc/httpd/conf.d/authz_ldap.conf", | |
"/etc/httpd/conf.d/ssl.conf", | |
"/etc/httpd/conf.d/vhost.conf", | |
"/etc/httpd/vhost.d/localhost", | |
"/etc/pki/tls/certs/Thawte_SSL_CA_Bundle.pem", | |
"/usr/local/sbin/git2web", | |
"/usr/local/sbin/httpd_aliases" | |
}; | |
"dirs" slist => { | |
"/etc/httpd/vhost.d/.", | |
"/etc/httpd/vhost.d/localhost/.", | |
"/etc/httpd/vhost.d/public/.", | |
"/etc/httpd/vhost.d/ssl/.", | |
"/etc/httpd/include/.", | |
"/usr/local/sbin/.", | |
}; | |
packages: | |
httpd_server:: | |
"$(packages)" | |
package_policy => "add", | |
package_architectures => { "i386" }, | |
action => everyfourhours, | |
package_method => yum; | |
files: | |
"$(dirs)" | |
comment => "deploy directories required for httpd configuration", | |
perms => mog("755", "root", "root"), | |
create => 'true', | |
classes => if_repaired("restart_httpd"); | |
"$(files)" | |
comment => "deploy files required for httpd configuration", | |
copy_from => local_dcp("${g.masterfiles}/config/httpd_server/$(files)"), | |
perms => mog("755", "root", "root"), | |
classes => if_repaired("restart_httpd"); | |
processes: | |
"$(services)" | |
comment => "Check processes running for $(services)", | |
restart_class => "restart_$(services)"; | |
commands: | |
restart_httpd:: | |
"/sbin/service $(services) restart"; | |
httpd_server:: | |
"/usr/local/sbin/httpd_aliases", | |
classes => if_ok("restart_httpd"); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class httpd_server { | |
File { | |
owner => 'root', | |
group => 'root', | |
mode => '0755', | |
} | |
define httpd_server::file($file) { | |
file { $file: | |
ensure => present, | |
source => 'puppet:///modules/httpd_server/$file' | |
notify => Service['httpd'], | |
} | |
} | |
$files = [ "/etc/httpd/vhost.d/localhost/dummy.conf", | |
"/etc/httpd/vhost.d/public/default", | |
"/etc/httpd/vhost.d/public/dummy.conf", | |
"/etc/httpd/vhost.d/ssl/default", | |
"/etc/httpd/vhost.d/ssl/dummy.conf", | |
"/etc/httpd/include/ssl.inc", | |
"/etc/httpd/Apache2/PassSSLVars.pm", | |
"/etc/httpd/Apache2/FilterSnoop.pm", | |
"/etc/httpd/Apache2/FilterObfuscate.pm", | |
"/etc/httpd/conf.d/adauth.cf", | |
"/etc/httpd/conf.d/authz_ldap.conf", | |
"/etc/httpd/conf.d/ssl.conf", | |
"/etc/httpd/conf.d/vhost.conf", | |
"/etc/httpd/vhost.d/localhost", | |
"/etc/pki/tls/certs/Thawte_SSL_CA_Bundle.pem", | |
"/usr/local/sbin/git2web", | |
"/usr/local/sbin/httpd_aliases" | |
] | |
$packages = ["httpd", "mod_ssl", "mod_perl", "mod_authz_ldap"] | |
$directories = [ "/etc/httpd/vhost.d/.", | |
"/etc/httpd/vhost.d/localhost/.", | |
"/etc/httpd/vhost.d/public/.", | |
"/etc/httpd/vhost.d/ssl/.", | |
"/etc/httpd/include/.", | |
"/usr/local/sbin/." | |
] | |
httpd_server::file($files) | |
file { $directories: | |
ensure => directory, | |
notify => Service['httpd'] | |
} | |
service { 'httpd': | |
ensure => running, | |
enable => true, | |
hasstatus => true, | |
hasrestart => true, | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment