This commit is contained in:
do
2013-02-02 14:35:50 +01:00
commit 57b7e4b122
72 changed files with 4145 additions and 0 deletions

View File

@@ -0,0 +1,27 @@
# $Id$
define puppet::env_fact(
$factname="",
$value,
$ensure="present"
){
$factname_real = $factname ? {
"" => upcase($name),
default => upcase($factname)
}
if defined(Exec["create-env_fact.sh"]){
debug("already defined.")
}else{
exec{"create-env_fact.sh":
command => "echo \"#/bin/sh\n\" >>/etc/profile.d/env_facts.sh && chmod a+xr /etc/profile.d/env_facts.sh",
onlyif => "test ! -e /etc/profile.d/env_facts.sh",
before => Line["env_fact-${factname_real}"],
}
}
line{"env_fact-${factname_real}":
line => "export FACTER_${factname_real}=${value}",
file => "/etc/profile.d/env_facts.sh",
ensure => $ensure,
}
}

View File

@@ -0,0 +1,21 @@
##########################################################################
## define puppet::puppetmaster::privatedir
## $l_fqdn : hostname - lower case letters only
## $title : hostname - as given in hosts client-cert
##
## $puppet_privdir (declared in site.pp) must already exist!
define puppet::puppetmaster::privatedir ( $l_fqdn ) {
file { "${puppet_privdir}/${l_fqdn}":
ensure => directory,
owner => puppet
} # file
## create link if cert-hostname and DNS-provided fqdn differ
if $title != $l_fqdn {
file { "${puppet_privdir}/${title}":
ensure => "${puppet_privdir}/${l_fqdn}",
require => File["${puppet_privdir}/${l_fqdn}"]
} # file
} # if
} # define puppet::puppetmaster::privatedir