Created
September 9, 2012 11:49
-
-
Save abhishekkr/3683955 to your computer and use it in GitHub Desktop.
Puppet Module : No Code In Data ~ Externalize into Params Manifest
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
# $MODULEPATH/httpd/manifests/git.pp | |
class httpd::git { | |
include httpd::params | |
$is_cgi = $httpd::params::is_cgi | |
$path = $httpd::params::path | |
$url = $httpd::params::url | |
file { | |
"${httpd::params::conf_path}/git.conf": | |
ensure => 'present', | |
content => template('httpd/mynode.conf.erb'), | |
} | |
} |
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
# $MODULEPATH/httpd/templates/mynode.conf.erb | |
Alias <%= url %> <%= path %> | |
<Directory <%= path %>> | |
<% if is_cgi %> | |
Options +ExecCGI | |
AddHandler cgi-script .cgi | |
DirectoryIndex gitweb.cgi | |
<% end %> | |
</Directory> |
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
# $MODULEPATH/httpd/manifests/params.pp | |
class httpd::params { | |
$conf_path = '/etc/httpd/conf.d/' | |
$is_cgi = true | |
$path = '/var/www/git' | |
$url = '/mygit' | |
} |
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
puppet apply --modulepath=$MODULEPATH -e "include httpd::git" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment