Created
September 28, 2015 20:14
-
-
Save robinbowes/7592d7be9803df32baa4 to your computer and use it in GitHub Desktop.
Add a content parameter to config
This file contains hidden or 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
# Installs RackTables | |
class racktables::config ( | |
$secretfile = $::racktables::secretfile, | |
$apacheuser = $::racktables::apacheuser, | |
$datadir = $::racktables::datadir, | |
$secretfile_content = $::racktables::secretfile_content | |
) { | |
validate_string($secretfile) | |
validate_string($apacheuser) | |
validate_string($datadir) | |
$real_content = defined($secretfile_content) ? { | |
true => template('racktables/secret.erb'), | |
default => $secretfile_content, | |
} | |
case $secretfile { | |
'template': { | |
file { "${datadir}/wwwroot/inc/secret.php": | |
ensure => present, | |
owner => $apacheuser, | |
mode => '0400', | |
seluser => 'system_u', | |
selrole => 'object_r', | |
seltype => 'httpd_sys_content_t', | |
content => $real_content, | |
require => Vcsrepo[$datadir], | |
} | |
} |
This file contains hidden or 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 racktables ( | |
$secretfile = undef, | |
$secretfile_content = undef, | |
$vhost = $racktables::params::vhost, |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment