Fixing puppet-lint errors.

This commit is contained in:
Timo Mkinen 2012-03-27 14:41:39 +03:00
parent 2f83cb7d4a
commit 34c36045fa
59 changed files with 995 additions and 990 deletions

View file

@ -84,7 +84,7 @@ class abusehelper {
realize(User["abusehel"], Group["abusehel"]) realize(User["abusehel"], Group["abusehel"])
if $abusehelper_datadir { if $abusehelper_datadir {
file { "${abusehelper_datadir}": file { $abusehelper_datadir:
ensure => directory, ensure => directory,
mode => 0750, mode => 0750,
owner => "root", owner => "root",
@ -94,8 +94,8 @@ class abusehelper {
file { "/var/lib/ah2": file { "/var/lib/ah2":
ensure => link, ensure => link,
target => "${abusehelper_datadir}", target => $abusehelper_datadir,
require => File["${abusehelper_datadir}"], require => File[$abusehelper_datadir],
} }
} else { } else {
file { "/var/lib/ah2": file { "/var/lib/ah2":

View file

@ -9,7 +9,7 @@ class alpine {
$mail_server = "mail.${domain}" $mail_server = "mail.${domain}"
} }
if ! $mail_domain { if ! $mail_domain {
$mail_domain = "${domain}" $mail_domain = $domain
} }
file { "/usr/bin/pine": file { "/usr/bin/pine":

View file

@ -55,7 +55,7 @@ class amanda::client inherits amanda::common {
if $amanda_clientkey { if $amanda_clientkey {
@@ssh_authorized_key { "amrecover@${homename}": @@ssh_authorized_key { "amrecover@${homename}":
ensure => present, ensure => present,
key => "${amanda_clientkey}", key => $amanda_clientkey,
type => "ssh-rsa", type => "ssh-rsa",
user => "amandabackup", user => "amandabackup",
tag => "amandaclient", tag => "amandaclient",
@ -75,7 +75,7 @@ class amanda::server inherits amanda::common {
if $amanda_serverkey { if $amanda_serverkey {
@@ssh_authorized_key { "amdump@${homename}": @@ssh_authorized_key { "amdump@${homename}":
ensure => present, ensure => present,
key => "${amanda_serverkey}", key => $amanda_serverkey,
type => "ssh-rsa", type => "ssh-rsa",
user => "amandabackup", user => "amandabackup",
tag => "amandaserver", tag => "amandaserver",

View file

@ -104,7 +104,7 @@ define apache::debian::site($aliases, $root, $redirect) {
file { "/srv/www/http/${site_fqdn}": file { "/srv/www/http/${site_fqdn}":
ensure => link, ensure => link,
target => $root, target => $root,
before => File["${site_conf}"], before => File[$site_conf],
} }
} else { } else {
file { "/srv/www/http/${site_fqdn}": file { "/srv/www/http/${site_fqdn}":
@ -112,7 +112,7 @@ define apache::debian::site($aliases, $root, $redirect) {
mode => 0755, mode => 0755,
owner => root, owner => root,
group => root, group => root,
before => File["${site_conf}"], before => File[$site_conf],
} }
} }
@ -121,12 +121,12 @@ define apache::debian::site($aliases, $root, $redirect) {
mode => 0755, mode => 0755,
owner => root, owner => root,
group => root, group => root,
before => File["${site_conf}"], before => File[$site_conf],
} }
} }
} }
file { "${site_conf}": file { $site_conf:
ensure => present, ensure => present,
mode => 0644, mode => 0644,
owner => root, owner => root,
@ -135,14 +135,14 @@ define apache::debian::site($aliases, $root, $redirect) {
} }
if $redirect { if $redirect {
File["${site_conf}"] { File[$site_conf] {
content => "<VirtualHost *:80>\n ServerName ${site_fqdn}\n Redirect permanent / ${redirect}\n</VirtualHost>\n", content => "<VirtualHost *:80>\n ServerName ${site_fqdn}\n Redirect permanent / ${redirect}\n</VirtualHost>\n",
} }
} else { } else {
File["${site_conf}"] { File[$site_conf] {
content => template("apache/site.http.conf.erb"), content => template("apache/site.http.conf.erb"),
} }
file { "${site_confdir}": file { $site_confdir:
ensure => directory, ensure => directory,
mode => 0644, mode => 0644,
owner => root, owner => root,
@ -152,7 +152,7 @@ define apache::debian::site($aliases, $root, $redirect) {
recurse => true, recurse => true,
source => [ "puppet:///files/apache/sites/${site_fqdn}", source => [ "puppet:///files/apache/sites/${site_fqdn}",
"puppet:///modules/custom/empty", ], "puppet:///modules/custom/empty", ],
before => File["${site_conf}"], before => File[$site_conf],
notify => Service["apache2"], notify => Service["apache2"],
} }
} }
@ -256,7 +256,7 @@ define apache::debian::sslsite($ipaddr, $root, $ssl_cert, $ssl_key, $ssl_chain)
$site_conf = "/etc/apache2/sites-enabled/${site_fqdn}-ssl.conf" $site_conf = "/etc/apache2/sites-enabled/${site_fqdn}-ssl.conf"
$site_confdir = "/etc/apache2/sites-enabled/${site_fqdn}-ssl.d" $site_confdir = "/etc/apache2/sites-enabled/${site_fqdn}-ssl.d"
file { "${site_conf}": file { $site_conf:
ensure => present, ensure => present,
content => template("apache/site.https.conf.erb"), content => template("apache/site.https.conf.erb"),
mode => 0644, mode => 0644,
@ -267,7 +267,7 @@ define apache::debian::sslsite($ipaddr, $root, $ssl_cert, $ssl_key, $ssl_chain)
File["/etc/ssl/private/${site_fqdn}.key"], ], File["/etc/ssl/private/${site_fqdn}.key"], ],
} }
file { "${site_confdir}": file { $site_confdir:
ensure => directory, ensure => directory,
mode => 0644, mode => 0644,
owner => root, owner => root,
@ -277,7 +277,7 @@ define apache::debian::sslsite($ipaddr, $root, $ssl_cert, $ssl_key, $ssl_chain)
recurse => true, recurse => true,
source => [ "puppet:///files/apache/sslsites/${site_fqdn}", source => [ "puppet:///files/apache/sslsites/${site_fqdn}",
"puppet:///modules/custom/empty", ], "puppet:///modules/custom/empty", ],
before => File["${site_conf}"], before => File[$site_conf],
notify => Service["apache2"], notify => Service["apache2"],
} }

View file

@ -21,7 +21,7 @@ class apache::common {
} }
if $apache_datadir { if $apache_datadir {
file { "${apache_datadir}": file { $apache_datadir:
ensure => directory, ensure => directory,
mode => 0755, mode => 0755,
owner => "root", owner => "root",
@ -31,8 +31,8 @@ class apache::common {
file { "/srv/www": file { "/srv/www":
ensure => link, ensure => link,
target => "${apache_datadir}", target => $apache_datadir,
require => File["${apache_datadir}"], require => File[$apache_datadir],
} }
} else { } else {
file { "/srv/www": file { "/srv/www":
@ -55,7 +55,7 @@ class apache::common {
if $apache_datadir { if $apache_datadir {
selinux::manage_fcontext { "${apache_datadir}(/.*)?": selinux::manage_fcontext { "${apache_datadir}(/.*)?":
type => "httpd_sys_content_t", type => "httpd_sys_content_t",
before => File["${apache_datadir}"], before => File[$apache_datadir],
} }
} }
} }
@ -70,11 +70,11 @@ class apache::common {
} }
file { "/usr/local/sbin/www-logrotate.sh": file { "/usr/local/sbin/www-logrotate.sh":
ensure => present, ensure => present,
source => "puppet:///modules/apache/www-logrotate.sh", source => "puppet:///modules/apache/www-logrotate.sh",
mode => 0755, mode => 0755,
owner => root, owner => root,
group => root, group => root,
seluser => "system_u", seluser => "system_u",
selrole => "object_r", selrole => "object_r",
seltype => "httpd_rotatelogs_exec_t", seltype => "httpd_rotatelogs_exec_t",
@ -155,14 +155,14 @@ define apache::site($aliases="", $root="", $redirect="") {
case $operatingsystem { case $operatingsystem {
debian,ubuntu: { debian,ubuntu: {
apache::debian::site { "${name}": apache::debian::site { $name:
aliases => $aliases, aliases => $aliases,
root => $root, root => $root,
redirect => $redirect, redirect => $redirect,
} }
} }
centos,fedora: { centos,fedora: {
apache::redhat::site { "${name}": apache::redhat::site { $name:
aliases => $aliases, aliases => $aliases,
root => $root, root => $root,
redirect => $redirect, redirect => $redirect,
@ -175,8 +175,8 @@ define apache::site($aliases="", $root="", $redirect="") {
if !$redirect { if !$redirect {
$site_fqdn = $name ? { $site_fqdn = $name ? {
"default" => "${homename}", "default" => $homename,
default => "${name}", default => $name,
} }
apache::webalizer::site { "http/${site_fqdn}": apache::webalizer::site { "http/${site_fqdn}":
site_proto => "http", site_proto => "http",
@ -268,7 +268,7 @@ define apache::sslsite($ipaddr="_default_", $root="", $ssl_cert="", $ssl_key="",
case $operatingsystem { case $operatingsystem {
debian,ubuntu: { debian,ubuntu: {
$apache_ssldir = "/etc/ssl" $apache_ssldir = "/etc/ssl"
apache::debian::sslsite { "${name}": apache::debian::sslsite { $name:
ipaddr => $ipaddr, ipaddr => $ipaddr,
root => $root, root => $root,
ssl_cert => $ssl_cert, ssl_cert => $ssl_cert,
@ -279,7 +279,7 @@ define apache::sslsite($ipaddr="_default_", $root="", $ssl_cert="", $ssl_key="",
} }
centos,fedora: { centos,fedora: {
$apache_ssldir = "/etc/pki/tls" $apache_ssldir = "/etc/pki/tls"
apache::redhat::sslsite { "${name}": apache::redhat::sslsite { $name:
ipaddr => $ipaddr, ipaddr => $ipaddr,
root => $root, root => $root,
ssl_cert => $ssl_cert, ssl_cert => $ssl_cert,
@ -294,8 +294,8 @@ define apache::sslsite($ipaddr="_default_", $root="", $ssl_cert="", $ssl_key="",
} }
$site_fqdn = $name ? { $site_fqdn = $name ? {
"default" => "${homename}", "default" => $homename,
default => "${name}", default => $name,
} }
apache::webalizer::site { "https/${site_fqdn}": apache::webalizer::site { "https/${site_fqdn}":
site_proto => "https", site_proto => "https",
@ -335,17 +335,17 @@ define apache::configfile($source="", $content="", $http=true, $https=true) {
case $operatingsystem { case $operatingsystem {
debian,ubuntu: { debian,ubuntu: {
apache::debian::configfile { "${name}": apache::debian::configfile { $name:
source => "${source}", source => $source,
content => "${content}", content => $content,
http => $http, http => $http,
https => $https, https => $https,
} }
} }
centos,fedora: { centos,fedora: {
apache::redhat::configfile { "${name}": apache::redhat::configfile { $name:
source => "${source}", source => $source,
content => "${content}", content => $content,
http => $http, http => $http,
https => $https, https => $https,
} }
@ -418,7 +418,7 @@ class apache::mod::fcgid {
ubuntu => "libapache2-mod-fcgid", ubuntu => "libapache2-mod-fcgid",
default => "mod_fcgid", default => "mod_fcgid",
}, },
ensure => installed, ensure => installed,
require => Package["httpd"], require => Package["httpd"],
} }
@ -485,7 +485,7 @@ class apache::mod::perl {
ubuntu => "libapache2-mod-perl2", ubuntu => "libapache2-mod-perl2",
default => "mod_perl", default => "mod_perl",
}, },
ensure => installed, ensure => installed,
require => Package["httpd"], require => Package["httpd"],
} }
@ -518,7 +518,7 @@ class apache::mod::php {
ubuntu => "libapache2-mod-php5", ubuntu => "libapache2-mod-php5",
default => "php", default => "php",
}, },
ensure => installed, ensure => installed,
require => Package["httpd"], require => Package["httpd"],
} }
@ -608,7 +608,7 @@ class apache::mod::python {
ubuntu => "libapache2-mod-python", ubuntu => "libapache2-mod-python",
default => "mod_python", default => "mod_python",
}, },
ensure => installed, ensure => installed,
require => Package["httpd"], require => Package["httpd"],
} }

View file

@ -57,7 +57,7 @@ define apache::redhat::site($aliases, $root, $redirect) {
file { "/srv/www/http/${site_fqdn}": file { "/srv/www/http/${site_fqdn}":
ensure => link, ensure => link,
target => $root, target => $root,
before => File["${site_conf}"], before => File[$site_conf],
} }
} else { } else {
file { "/srv/www/http/${site_fqdn}": file { "/srv/www/http/${site_fqdn}":
@ -65,7 +65,7 @@ define apache::redhat::site($aliases, $root, $redirect) {
mode => 0755, mode => 0755,
owner => root, owner => root,
group => root, group => root,
before => File["${site_conf}"], before => File[$site_conf],
} }
} }
@ -74,12 +74,12 @@ define apache::redhat::site($aliases, $root, $redirect) {
mode => 0755, mode => 0755,
owner => root, owner => root,
group => root, group => root,
before => File["${site_conf}"], before => File[$site_conf],
} }
} }
} }
file { "${site_conf}": file { $site_conf:
ensure => present, ensure => present,
mode => 0644, mode => 0644,
owner => root, owner => root,
@ -88,14 +88,14 @@ define apache::redhat::site($aliases, $root, $redirect) {
} }
if $redirect { if $redirect {
File["${site_conf}"] { File[$site_conf] {
content => "<VirtualHost *:80>\n ServerName ${site_fqdn}\n Redirect permanent / ${redirect}\n</VirtualHost>\n", content => "<VirtualHost *:80>\n ServerName ${site_fqdn}\n Redirect permanent / ${redirect}\n</VirtualHost>\n",
} }
} else { } else {
File["${site_conf}"] { File[$site_conf] {
content => template("apache/site.http.conf.erb"), content => template("apache/site.http.conf.erb"),
} }
file { "${site_confdir}": file { $site_confdir:
ensure => directory, ensure => directory,
mode => 0644, mode => 0644,
owner => root, owner => root,
@ -105,7 +105,7 @@ define apache::redhat::site($aliases, $root, $redirect) {
recurse => true, recurse => true,
source => [ "puppet:///files/apache/sites/${site_fqdn}", source => [ "puppet:///files/apache/sites/${site_fqdn}",
"puppet:///modules/custom/empty", ], "puppet:///modules/custom/empty", ],
before => File["${site_conf}"], before => File[$site_conf],
notify => Service["httpd"], notify => Service["httpd"],
} }
} }
@ -257,7 +257,7 @@ define apache::redhat::sslsite($ipaddr, $root, $ssl_cert, $ssl_key, $ssl_chain)
$site_conf = "/etc/httpd/site.https.d/${site_fqdn}.conf" $site_conf = "/etc/httpd/site.https.d/${site_fqdn}.conf"
$site_confdir = "/etc/httpd/site.https.d/${site_fqdn}.d" $site_confdir = "/etc/httpd/site.https.d/${site_fqdn}.d"
file { "${site_conf}": file { $site_conf:
ensure => present, ensure => present,
content => template("apache/site.https.conf.erb"), content => template("apache/site.https.conf.erb"),
mode => 0644, mode => 0644,
@ -268,7 +268,7 @@ define apache::redhat::sslsite($ipaddr, $root, $ssl_cert, $ssl_key, $ssl_chain)
File["/etc/pki/tls/private/${site_fqdn}.key"], ], File["/etc/pki/tls/private/${site_fqdn}.key"], ],
} }
file { "${site_confdir}": file { $site_confdir:
ensure => directory, ensure => directory,
mode => 0644, mode => 0644,
owner => root, owner => root,
@ -278,7 +278,7 @@ define apache::redhat::sslsite($ipaddr, $root, $ssl_cert, $ssl_key, $ssl_chain)
recurse => true, recurse => true,
source => [ "puppet:///files/apache/sslsites/${site_fqdn}", source => [ "puppet:///files/apache/sslsites/${site_fqdn}",
"puppet:///modules/custom/empty", ], "puppet:///modules/custom/empty", ],
before => File["${site_conf}"], before => File[$site_conf],
notify => Service["httpsd"], notify => Service["httpsd"],
} }
@ -289,7 +289,7 @@ define apache::redhat::configfile($source, $content, $http, $https) {
if defined(Service["httpd"]) { if defined(Service["httpd"]) {
file { "/etc/httpd/conf.http.d/${name}": file { "/etc/httpd/conf.http.d/${name}":
ensure => $http ? { ensure => $http ? {
true => present, true => present,
default => absent, default => absent,
}, },
@ -322,7 +322,7 @@ define apache::redhat::configfile($source, $content, $http, $https) {
if defined(Service["httpsd"]) { if defined(Service["httpsd"]) {
file { "/etc/httpd/conf.https.d/${name}": file { "/etc/httpd/conf.https.d/${name}":
ensure => $https ? { ensure => $https ? {
true => present, true => present,
default => absent, default => absent,
}, },

View file

@ -4,13 +4,13 @@
class apcupsd { class apcupsd {
package { "apcupsd": package { "apcupsd":
ensure => installed, ensure => installed,
} }
service { "apcupsd": service { "apcupsd":
ensure => running, ensure => running,
enable => true, enable => true,
require => Package["apcupsd"], require => Package["apcupsd"],
} }
file { "/etc/apcupsd/apcupsd.conf": file { "/etc/apcupsd/apcupsd.conf":

View file

@ -223,7 +223,7 @@ define apt::package($ensure, $source) {
require => File["/var/cache/apt/local-archives"], require => File["/var/cache/apt/local-archives"],
} }
package { "${name}": package { $name:
ensure => $ensure, ensure => $ensure,
source => "/var/cache/apt/local-archives/${filename}", source => "/var/cache/apt/local-archives/${filename}",
provider => dpkg, provider => dpkg,

View file

@ -2,26 +2,26 @@
class autofs { class autofs {
package { "autofs": package { "autofs":
ensure => installed, ensure => installed,
} }
service { "autofs": service { "autofs":
ensure => running, ensure => running,
enable => true, enable => true,
hasstatus => true, hasstatus => true,
require => Package["autofs"], require => Package["autofs"],
} }
file { "/etc/auto.master": file { "/etc/auto.master":
ensure => present, ensure => present,
source => [ "puppet:///files/autofs/auto.master.${fqdn}", source => [ "puppet:///files/autofs/auto.master.${fqdn}",
"puppet:///files/autofs/auto.master", "puppet:///files/autofs/auto.master",
"puppet:///modules/autofs/auto.master", ], "puppet:///modules/autofs/auto.master", ],
mode => 0644, mode => 0644,
owner => root, owner => root,
group => root, group => root,
require => Package["autofs"], require => Package["autofs"],
notify => Service["autofs"], notify => Service["autofs"],
} }
} }

View file

@ -17,17 +17,17 @@
define backuppc::manualclient($ensure = "present", $operatingsystem = "default") { define backuppc::manualclient($ensure = "present", $operatingsystem = "default") {
@@file { "/etc/BackupPC/pc/${name}.pl": @@file { "/etc/BackupPC/pc/${name}.pl":
ensure => "${ensure}", ensure => $ensure,
source => [ "puppet:///files/backuppc/${name}.pl", source => [ "puppet:///files/backuppc/${name}.pl",
"puppet:///files/backuppc/${operatingsystem}.pl", "puppet:///files/backuppc/${operatingsystem}.pl",
"puppet:///files/backuppc/default.pl", "puppet:///files/backuppc/default.pl",
"puppet:///modules/backuppc/default.pl", ], "puppet:///modules/backuppc/default.pl", ],
mode => 0640, mode => 0640,
owner => root, owner => root,
group => backuppc, group => backuppc,
tag => "backuppc", tag => "backuppc",
require => File["/etc/BackupPC/pc"], require => File["/etc/BackupPC/pc"],
notify => Exec["generate-backuppc-hosts"], notify => Exec["generate-backuppc-hosts"],
} }
} }
@ -36,9 +36,9 @@ define backuppc::manualclient($ensure = "present", $operatingsystem = "default")
# #
class backuppc::client { class backuppc::client {
backuppc::manualclient { "${homename}": backuppc::manualclient { $homename:
ensure => present, ensure => present,
operatingsystem => "${operatingsystem}", operatingsystem => $operatingsystem,
} }
include rsync include rsync
@ -57,13 +57,13 @@ class backuppc::server {
realize(User["backuppc"], Group["backuppc"]) realize(User["backuppc"], Group["backuppc"])
package { "BackupPC": package { "BackupPC":
ensure => installed, ensure => installed,
require => [ User["backuppc"], require => [ User["backuppc"],
Group["backuppc"], ], Group["backuppc"], ],
} }
if $backuppc_datadir { if $backuppc_datadir {
file { "${backuppc_datadir}": file { $backuppc_datadir:
ensure => directory, ensure => directory,
mode => 0750, mode => 0750,
owner => "backuppc", owner => "backuppc",
@ -72,10 +72,10 @@ class backuppc::server {
} }
file { "/var/lib/BackupPC": file { "/var/lib/BackupPC":
ensure => "${backuppc_datadir}", ensure => $backuppc_datadir,
force => true, force => true,
backup => ".orig", backup => ".orig",
require => File["${backuppc_datadir}"], require => File[$backuppc_datadir],
before => File["/var/lib/BackupPC/.ssh"], before => File["/var/lib/BackupPC/.ssh"],
} }
} }
@ -128,11 +128,11 @@ class backuppc::server {
} }
file { "/etc/BackupPC/config.pl": file { "/etc/BackupPC/config.pl":
ensure => present, ensure => present,
source => "puppet:///files/backuppc/config.pl", source => "puppet:///files/backuppc/config.pl",
mode => 0440, mode => 0440,
owner => "backuppc", owner => "backuppc",
group => "backuppc", group => "backuppc",
seltype => $operatingsystem ? { seltype => $operatingsystem ? {
"centos" => $operatingsystemrelease ? { "centos" => $operatingsystemrelease ? {
/^5/ => "httpd_sys_script_rw_t", /^5/ => "httpd_sys_script_rw_t",
@ -140,17 +140,17 @@ class backuppc::server {
}, },
default => "httpd_sys_rw_content_t", default => "httpd_sys_rw_content_t",
}, },
require => Package["BackupPC"], require => Package["BackupPC"],
notify => Service["backuppc"], notify => Service["backuppc"],
} }
file { "/etc/BackupPC/hosts.in": file { "/etc/BackupPC/hosts.in":
ensure => present, ensure => present,
source => [ "puppet:///files/backuppc/hosts.in", source => [ "puppet:///files/backuppc/hosts.in",
"puppet:///modules/backuppc/hosts.in", ], "puppet:///modules/backuppc/hosts.in", ],
mode => 0644, mode => 0644,
owner => "root", owner => "root",
group => "backuppc", group => "backuppc",
seltype => $operatingsystem ? { seltype => $operatingsystem ? {
"centos" => $operatingsystemrelease ? { "centos" => $operatingsystemrelease ? {
/^5/ => "httpd_sys_script_rw_t", /^5/ => "httpd_sys_script_rw_t",
@ -158,18 +158,18 @@ class backuppc::server {
}, },
default => "httpd_sys_rw_content_t", default => "httpd_sys_rw_content_t",
}, },
require => Package["BackupPC"], require => Package["BackupPC"],
notify => Exec["generate-backuppc-hosts"], notify => Exec["generate-backuppc-hosts"],
} }
file { "/etc/BackupPC/pc": file { "/etc/BackupPC/pc":
ensure => directory, ensure => directory,
purge => true, purge => true,
force => true, force => true,
recurse => true, recurse => true,
mode => 0640, mode => 0640,
owner => "root", owner => "root",
group => "backuppc", group => "backuppc",
seltype => $operatingsystem ? { seltype => $operatingsystem ? {
"centos" => $operatingsystemrelease ? { "centos" => $operatingsystemrelease ? {
/^5/ => "httpd_sys_script_rw_t", /^5/ => "httpd_sys_script_rw_t",
@ -177,17 +177,17 @@ class backuppc::server {
}, },
default => "httpd_sys_rw_content_t", default => "httpd_sys_rw_content_t",
}, },
source => "puppet:///modules/custom/empty", source => "puppet:///modules/custom/empty",
require => Package["BackupPC"], require => Package["BackupPC"],
notify => Exec["generate-backuppc-hosts"], notify => Exec["generate-backuppc-hosts"],
} }
exec { "generate-backuppc-hosts": exec { "generate-backuppc-hosts":
command => "/bin/sh -c '(cat /etc/BackupPC/hosts.in ; find /etc/BackupPC/pc -name \\*.pl -exec basename {} .pl \\; | sed -e \"s/\$/ 0 adm/\") > /etc/BackupPC/hosts'", command => "/bin/sh -c '(cat /etc/BackupPC/hosts.in ; find /etc/BackupPC/pc -name \\*.pl -exec basename {} .pl \\; | sed -e \"s/\$/ 0 adm/\") > /etc/BackupPC/hosts'",
path => "/bin:/usr/bin:/sbin:/usr/sbin", path => "/bin:/usr/bin:/sbin:/usr/sbin",
refreshonly => true, refreshonly => true,
require => File["/etc/BackupPC/hosts.in"], require => File["/etc/BackupPC/hosts.in"],
notify => Service["backuppc"], notify => Service["backuppc"],
} }
File <<| tag == "backuppc" |>> { File <<| tag == "backuppc" |>> {
@ -201,9 +201,9 @@ class backuppc::server {
} }
service { "backuppc": service { "backuppc":
ensure => running, ensure => running,
enable => true, enable => true,
require => Package["BackupPC"], require => Package["BackupPC"],
} }
file { "/var/lib/BackupPC/.ssh": file { "/var/lib/BackupPC/.ssh":

View file

@ -49,7 +49,7 @@ class clarified::recorder {
} }
if $recorder_datadir { if $recorder_datadir {
file { "${recorder_datadir}": file { $recorder_datadir:
ensure => directory, ensure => directory,
mode => 0700, mode => 0700,
owner => root, owner => root,
@ -58,8 +58,8 @@ class clarified::recorder {
file { "/var/lib/recorder": file { "/var/lib/recorder":
ensure => link, ensure => link,
target => "${recorder_datadir}", target => $recorder_datadir,
require => File["${recorder_datadir}"], require => File[$recorder_datadir],
} }
} else { } else {
file { "/var/lib/recorder": file { "/var/lib/recorder":

View file

@ -4,23 +4,23 @@
class cups::client { class cups::client {
package { "cups": package { "cups":
ensure => installed, ensure => installed,
} }
file { "/etc/cups/client.conf": file { "/etc/cups/client.conf":
ensure => present, ensure => present,
content => template("cups/client.conf.erb"), content => template("cups/client.conf.erb"),
mode => 0644, mode => 0644,
owner => root, owner => root,
group => $operatingsystem ? { group => $operatingsystem ? {
openbsd => wheel, openbsd => wheel,
default => lp, default => lp,
}, },
require => Package["cups"], require => Package["cups"],
} }
case $operatingsystem { case $operatingsystem {
openbsd: { openbsd: {
exec { "cups-enable": exec { "cups-enable":
command => $operatingsystemrelease ? { command => $operatingsystemrelease ? {
/4\.[1-8]/ => "echo y | cups-enable", /4\.[1-8]/ => "echo y | cups-enable",
@ -30,8 +30,8 @@ class cups::client {
user => "root", user => "root",
creates => "/usr/bin/lpr.pre-cups", creates => "/usr/bin/lpr.pre-cups",
require => Package["cups"], require => Package["cups"],
} }
} }
} }
} }
@ -41,7 +41,7 @@ class cups::client {
class cups::server inherits cups::client { class cups::server inherits cups::client {
package { [ "ghostscript", "system-config-printer" ]: package { [ "ghostscript", "system-config-printer" ]:
ensure => installed, ensure => installed,
} }
file { "/etc/cups/cupsd.conf": file { "/etc/cups/cupsd.conf":
@ -57,9 +57,9 @@ class cups::server inherits cups::client {
} }
service { "cups": service { "cups":
ensure => running, ensure => running,
enable => true, enable => true,
require => Package["cups"], require => Package["cups"],
} }
file { "/etc/cups/ppd": file { "/etc/cups/ppd":
@ -71,7 +71,7 @@ class cups::server inherits cups::client {
} }
File["/etc/cups/client.conf"] { File["/etc/cups/client.conf"] {
content => "ServerName 127.0.0.1\n", content => "ServerName 127.0.0.1\n",
} }
} }
@ -157,12 +157,12 @@ class cups::lpd {
include inetd::server include inetd::server
package { "cups-lpd": package { "cups-lpd":
ensure => installed, ensure => installed,
} }
inetd::service { "cups-lpd": inetd::service { "cups-lpd":
ensure => present, ensure => present,
require => Package["cups-lpd"], require => Package["cups-lpd"],
} }
} }
@ -175,26 +175,26 @@ class cups::samba {
include samba::server include samba::server
file { [ "/etc/samba/drivers", file { [ "/etc/samba/drivers",
"/usr/share/cups/drivers", "/usr/share/cups/drivers",
"/usr/share/cups/drivers/x64", ]: "/usr/share/cups/drivers/x64", ]:
ensure => directory, ensure => directory,
mode => 0755, mode => 0755,
owner => root, owner => root,
group => root, group => root,
require => [ Package["samba"], require => [ Package["samba"],
Package["cups"], ], Package["cups"], ],
} }
define driverfile() { define driverfile() {
file { "/usr/share/cups/drivers/${name}": file { "/usr/share/cups/drivers/${name}":
ensure => present, ensure => present,
source => "puppet:///modules/cups/drivers/${name}", source => "puppet:///modules/cups/drivers/${name}",
mode => 0644, mode => 0644,
owner => root, owner => root,
group => root, group => root,
require => [ File["/usr/share/cups/drivers"], require => [ File["/usr/share/cups/drivers"],
File["/usr/share/cups/drivers/x64"], ], File["/usr/share/cups/drivers/x64"], ],
} }
} }
driverfile { "cups6.inf": } driverfile { "cups6.inf": }
@ -218,11 +218,11 @@ class cups::samba {
driverfile { "x64/pscript5.dll": } driverfile { "x64/pscript5.dll": }
file { "/etc/cron.hourly/update-printer-inf.sh": file { "/etc/cron.hourly/update-printer-inf.sh":
ensure => present, ensure => present,
source => "puppet:///modules/cups/update-printer-inf.sh", source => "puppet:///modules/cups/update-printer-inf.sh",
mode => 0755, mode => 0755,
owner => root, owner => root,
group => root, group => root,
} }
} }
@ -233,24 +233,24 @@ class cups::samba {
class cups::snmp { class cups::snmp {
package { "net-snmp-utils": package { "net-snmp-utils":
ensure => installed, ensure => installed,
} }
file { "/etc/cron.hourly/printer-details.py": file { "/etc/cron.hourly/printer-details.py":
ensure => present, ensure => present,
source => "puppet:///modules/cups/printer-details.py", source => "puppet:///modules/cups/printer-details.py",
mode => 0755, mode => 0755,
owner => root, owner => root,
group => root, group => root,
require => Package["net-snmp-utils"], require => Package["net-snmp-utils"],
} }
exec { "create-details-dir": exec { "create-details-dir":
command => "umask 022 ; mkdir /usr/share/doc/cups-`rpm -q --queryformat='%{VERSION}' cups`/details", command => "umask 022 ; mkdir /usr/share/doc/cups-`rpm -q --queryformat='%{VERSION}' cups`/details",
path => "/bin:/usr/bin:/sbin:/usr/sbin", path => "/bin:/usr/bin:/sbin:/usr/sbin",
user => root, user => root,
unless => "test -d /usr/share/doc/cups-`rpm -q --queryformat='%{VERSION}' cups`/details", unless => "test -d /usr/share/doc/cups-`rpm -q --queryformat='%{VERSION}' cups`/details",
require => Package["cups"], require => Package["cups"],
} }
} }

View file

@ -50,9 +50,9 @@ define custom::file($ensure, $group="NONE", $mode="NONE", $owner="NONE", $seltyp
$test = regsubst($source, '^([^:]+)://.+$', '\1') $test = regsubst($source, '^([^:]+)://.+$', '\1')
if "${test}" == "${source}" { if "${test}" == "${source}" {
$method = "file" $method = "file"
$path = "${source}" $path = $source
} else { } else {
$method = "${test}" $method = $test
} }
case $method { case $method {
@ -75,33 +75,33 @@ define custom::file($ensure, $group="NONE", $mode="NONE", $owner="NONE", $seltyp
cwd => regsubst($name, '(.*)/[^/]+$', '\1'), cwd => regsubst($name, '(.*)/[^/]+$', '\1'),
command => $fetch_cmd, command => $fetch_cmd,
unless => $diff_cmd, unless => $diff_cmd,
before => File["${name}"], before => File[$name],
} }
} }
} }
file { "${name}": file { $name:
ensure => "${ensure}", ensure => $ensure,
source => "${method}" ? { source => $method ? {
"file" => "${path}", "file" => $path,
"puppet" => "${source}", "puppet" => $source,
default => undef, default => undef,
}, },
mode => "${mode}" ? { mode => $mode ? {
"NONE" => undef,
default => "${mode}",
},
owner => "${owner}" ? {
"NONE" => undef, "NONE" => undef,
default => "${owner}", default => $mode,
}, },
group => "${group}" ? { owner => $owner ? {
"NONE" => undef, "NONE" => undef,
default => "${group}", default => $owner,
}, },
seltype => "${seltype}" ? { group => $group ? {
"NONE" => undef, "NONE" => undef,
default => "${seltype}", default => $group,
},
seltype => $seltype ? {
"NONE" => undef,
default => $seltype,
}, },
} }
@ -132,7 +132,7 @@ class custom::rootpassword {
default: { default: {
user { "root": user { "root":
ensure => present, ensure => present,
password => "${root_password}", password => $root_password,
} }
} }
} }

View file

@ -2,36 +2,36 @@
class dhcp::server::common { class dhcp::server::common {
package { "dhcp": package { "dhcp":
name => $operatingsystem ? { name => $operatingsystem ? {
Debian => "dhcp3-server", Debian => "dhcp3-server",
OpenBSD => "isc-dhcp-server", OpenBSD => "isc-dhcp-server",
Ubuntu => "dhcp3-server", Ubuntu => "dhcp3-server",
default => "dhcp", default => "dhcp",
}, },
ensure => installed, ensure => installed,
} }
file { "dhcpd.leases": file { "dhcpd.leases":
name => $operatingsystem ? { name => $operatingsystem ? {
Debian => "/var/lib/dhcp3/dhcpd.leases", Debian => "/var/lib/dhcp3/dhcpd.leases",
OpenBSD => "/var/db/dhcpd.leases", OpenBSD => "/var/db/dhcpd.leases",
Ubuntu => "/var/lib/dhcp3/dhcpd.leases", Ubuntu => "/var/lib/dhcp3/dhcpd.leases",
default => "/var/lib/dhcpd/dhcpd.leases", default => "/var/lib/dhcpd/dhcpd.leases",
}, },
ensure => present, ensure => present,
owner => $operatingsystem ? { owner => $operatingsystem ? {
debian => dhcpd, debian => dhcpd,
ubuntu => dhcpd, ubuntu => dhcpd,
default => root, default => root,
}, },
group => $operatingsystem ? { group => $operatingsystem ? {
Debian => dhcpd, Debian => dhcpd,
OpenBSD => wheel, OpenBSD => wheel,
Ubuntu => dhcpd, Ubuntu => dhcpd,
default => root, default => root,
}, },
require => Package["dhcp"], require => Package["dhcp"],
before => Service["dhcpd"], before => Service["dhcpd"],
} }
if $operatingsystem == "OpenBSD" and $operatingsystemrelease !~ /4\.[1-8]/ { if $operatingsystem == "OpenBSD" and $operatingsystemrelease !~ /4\.[1-8]/ {
@ -55,8 +55,8 @@ class dhcp::server::common {
Ubuntu => "dhcp3-server", Ubuntu => "dhcp3-server",
default => "dhcpd", default => "dhcpd",
}, },
ensure => running, ensure => running,
enable => true, enable => true,
binary => $operatingsystem ? { binary => $operatingsystem ? {
OpenBSD => "/usr/local/sbin/dhcpd", OpenBSD => "/usr/local/sbin/dhcpd",
default => undef, default => undef,
@ -65,7 +65,7 @@ class dhcp::server::common {
OpenBSD => "/usr/local/sbin/dhcpd -q", OpenBSD => "/usr/local/sbin/dhcpd -q",
default => undef, default => undef,
}, },
require => Package["dhcp"], require => Package["dhcp"],
} }
} }
@ -99,36 +99,36 @@ class dhcp::server::ldap inherits dhcp::server::common {
include ldap::client::python include ldap::client::python
file { "/usr/local/sbin/dhcpdump.py": file { "/usr/local/sbin/dhcpdump.py":
ensure => present, ensure => present,
source => "puppet:///modules/dhcp/dhcpdump.py", source => "puppet:///modules/dhcp/dhcpdump.py",
mode => 0755, mode => 0755,
owner => root, owner => root,
group => $operatingsystem ? { group => $operatingsystem ? {
OpenBSD => wheel, OpenBSD => wheel,
default => root, default => root,
}, },
} }
file { "/etc/dhcpd.conf.in": file { "/etc/dhcpd.conf.in":
ensure => present, ensure => present,
source => [ "puppet:///files/dhcp/dhcpd.conf.in.${hostname}", source => [ "puppet:///files/dhcp/dhcpd.conf.in.${hostname}",
"puppet:///files/dhcp/dhcpd.conf.in", ], "puppet:///files/dhcp/dhcpd.conf.in", ],
mode => 0644, mode => 0644,
owner => root, owner => root,
group => $operatingsystem ? { group => $operatingsystem ? {
OpenBSD => wheel, OpenBSD => wheel,
default => root, default => root,
}, },
require => Package["dhcp"], require => Package["dhcp"],
} }
exec { "generate-dhcp-conf": exec { "generate-dhcp-conf":
path => "/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin", path => "/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin",
command => "dhcpdump.py /etc/dhcpd.conf.in* > /etc/dhcpd.conf", command => "dhcpdump.py /etc/dhcpd.conf.in* > /etc/dhcpd.conf",
unless => "dhcpdump.py /etc/dhcpd.conf.in* | diff /etc/dhcpd.conf -", unless => "dhcpdump.py /etc/dhcpd.conf.in* | diff /etc/dhcpd.conf -",
require => [ File["/etc/dhcpd.conf.in"], require => [ File["/etc/dhcpd.conf.in"],
File["/usr/local/sbin/dhcpdump.py"], ], File["/usr/local/sbin/dhcpdump.py"], ],
notify => Service["dhcpd"], notify => Service["dhcpd"],
} }
} }

View file

@ -111,8 +111,8 @@ class dns::server {
} }
file { "named.conf": file { "named.conf":
path => "${chroot}${config}",
ensure => present, ensure => present,
path => "${chroot}${config}",
mode => 0640, mode => 0640,
owner => "root", owner => "root",
group => $group, group => $group,
@ -123,7 +123,7 @@ class dns::server {
notify => Exec["generate-named-conf"], notify => Exec["generate-named-conf"],
} }
file { "/usr/local/sbin/generate-named-conf.sh": file { "/usr/local/sbin/generate-named-conf.sh":
ensure => present, ensure => present,
content => template("dns/generate-named-conf.sh.erb"), content => template("dns/generate-named-conf.sh.erb"),
mode => 0755, mode => 0755,
owner => "root", owner => "root",

View file

@ -96,7 +96,7 @@ class dovecot::server inherits dovecot::common {
mode => 0644, mode => 0644,
owner => root, owner => root,
group => root, group => root,
notify => Service["dovecot"], notify => Service["dovecot"],
} }
} }

View file

@ -26,7 +26,7 @@ class ejabberd {
realize(User["ejabberd"], Group["ejabberd"]) realize(User["ejabberd"], Group["ejabberd"])
if !$ejabberd_hosts { if !$ejabberd_hosts {
$ejabberd_hosts = [ "${homename}" ] $ejabberd_hosts = [ $homename ]
} }
if !$ejabberd_admin { if !$ejabberd_admin {
$ejabberd_admin = [] $ejabberd_admin = []
@ -213,7 +213,7 @@ class ejabberd::backup {
$ejabberd_backup_datadir = "/srv/ejabberd-backup" $ejabberd_backup_datadir = "/srv/ejabberd-backup"
} }
file { "${ejabberd_backup_datadir}": file { $ejabberd_backup_datadir:
ensure => directory, ensure => directory,
mode => 0700, mode => 0700,
owner => root, owner => root,
@ -234,7 +234,7 @@ class ejabberd::backup {
user => "root", user => "root",
minute => 15, minute => 15,
hour => 21, hour => 21,
require => File[ "${ejabberd_backup_datadir}", require => File[ $ejabberd_backup_datadir,
"/usr/local/sbin/ejabberd-backup" ], "/usr/local/sbin/ejabberd-backup" ],
} }

View file

@ -8,7 +8,7 @@ class git::client {
"ubuntu" => "git-core", "ubuntu" => "git-core",
default => "git", default => "git",
}, },
ensure => installed, ensure => installed,
} }
} }
@ -26,7 +26,7 @@ class git::server {
include git::client include git::client
if $git_datadir { if $git_datadir {
file { "${git_datadir}": file { $git_datadir:
ensure => directory, ensure => directory,
mode => 0755, mode => 0755,
owner => root, owner => root,
@ -34,8 +34,8 @@ class git::server {
} }
file { "/srv/git": file { "/srv/git":
ensure => link, ensure => link,
target => "${git_datadir}", target => $git_datadir,
require => File["${git_datadir}"], require => File[$git_datadir],
} }
} else { } else {
file { "/srv/git": file { "/srv/git":
@ -55,7 +55,7 @@ class git::server {
if $git_datadir { if $git_datadir {
selinux::manage_fcontext { "${git_datadir}(/.*)?": selinux::manage_fcontext { "${git_datadir}(/.*)?":
type => "httpd_sys_content_t", type => "httpd_sys_content_t",
before => File["${git_datadir}"], before => File[$git_datadir],
} }
} }
} }

View file

@ -28,7 +28,7 @@ class hastymail {
ensure => directory, ensure => directory,
mode => 0750, mode => 0750,
owner => "root", owner => "root",
group => "${apache::sslserver::group}", group => $apache::sslserver::group,
} }
file { "/etc/hastymail2/hastymail2.conf": file { "/etc/hastymail2/hastymail2.conf":
ensure => present, ensure => present,
@ -36,7 +36,7 @@ class hastymail {
"puppet:///files/mail/hastymail2.conf", ], "puppet:///files/mail/hastymail2.conf", ],
mode => 0640, mode => 0640,
owner => "root", owner => "root",
group => "${apache::sslserver::group}", group => $apache::sslserver::group,
require => File["/etc/hastymail2"], require => File["/etc/hastymail2"],
} }
exec { "rm /etc/hastymail2/hastymail2.rc && php /usr/local/share/hastymail/install_scripts/install_config.php /etc/hastymail2/hastymail2.conf /etc/hastymail2/hastymail2.rc": exec { "rm /etc/hastymail2/hastymail2.rc && php /usr/local/share/hastymail/install_scripts/install_config.php /etc/hastymail2/hastymail2.conf /etc/hastymail2/hastymail2.rc":
@ -48,9 +48,9 @@ class hastymail {
} }
file { "/etc/hastymail2/hastymail2.rc": file { "/etc/hastymail2/hastymail2.rc":
ensure => present, ensure => present,
mode => 0640, mode => 0640,
owner => "root", owner => "root",
group => "${apache::sslserver::group}", group => $apache::sslserver::group,
} }
} }

View file

@ -6,15 +6,15 @@
class inetd::server { class inetd::server {
case $operatingsystem { case $operatingsystem {
centos,fedora,ubuntu,debian: { centos,fedora,ubuntu,debian: {
include inetd::server::xinetd include inetd::server::xinetd
} }
openbsd: { openbsd: {
include inetd::server::inetd include inetd::server::inetd
} }
default: { default: {
fail("Inetd module not supported in ${operatingsystem}") fail("Inetd module not supported in ${operatingsystem}")
} }
} }
} }
@ -29,13 +29,13 @@ class inetd::server {
class inetd::server::xinetd { class inetd::server::xinetd {
package { "xinetd": package { "xinetd":
ensure => installed, ensure => installed,
} }
service { "xinetd": service { "xinetd":
ensure => running, ensure => running,
enable => true, enable => true,
require => Package["xinetd"], require => Package["xinetd"],
} }
} }
@ -75,15 +75,15 @@ class inetd::server::inetd {
define inetd::service($ensure = present) { define inetd::service($ensure = present) {
case $operatingsystem { case $operatingsystem {
centos,fedora,ubuntu,debian: { centos,fedora,ubuntu,debian: {
service { "${name}": service { $name:
enable => $ensure ? { enable => $ensure ? {
present => true, present => true,
absent => false, absent => false,
}, },
notify => Service["xinetd"], notify => Service["xinetd"],
} }
} }
openbsd: { openbsd: {
exec { "enable-inetd-${name}": exec { "enable-inetd-${name}":
command => $ensure ? { command => $ensure ? {
@ -98,9 +98,9 @@ define inetd::service($ensure = present) {
notify => Service["inetd"], notify => Service["inetd"],
} }
} }
default: { default: {
fail("Inetd module not supported in ${operatingsystem}") fail("Inetd module not supported in ${operatingsystem}")
} }
} }
} }

View file

@ -67,7 +67,7 @@ define irc::network($desc, $servername, $serverdesc,
} }
ssl::certificate { "/var/lib/ratbox/${name}/ircd.pem": ssl::certificate { "/var/lib/ratbox/${name}/ircd.pem":
cn => "${servername}", cn => $servername,
mode => 0600, mode => 0600,
owner => "irc", owner => "irc",
group => "irc", group => "irc",

View file

@ -4,39 +4,39 @@
class iscsi::server { class iscsi::server {
package { "scsi-target-utils": package { "scsi-target-utils":
ensure => installed, ensure => installed,
} }
service { "tgtd": service { "tgtd":
ensure => running, ensure => running,
enable => true, enable => true,
require => Package["scsi-target-utils"], require => Package["scsi-target-utils"],
} }
file { "/etc/tgt/targets.conf": file { "/etc/tgt/targets.conf":
ensure => present, ensure => present,
source => [ "puppet:///files/iscsi/targets.conf.${fqdn}", source => [ "puppet:///files/iscsi/targets.conf.${fqdn}",
"puppet:///files/iscsi/targets.conf", "puppet:///files/iscsi/targets.conf",
"puppet:///modules/iscsi/targets.conf", ], "puppet:///modules/iscsi/targets.conf", ],
mode => 0600, mode => 0600,
owner => root, owner => root,
group => root, group => root,
require => Package["scsi-target-utils"], require => Package["scsi-target-utils"],
} }
file { "/etc/tgt/target.d": file { "/etc/tgt/target.d":
ensure => directory, ensure => directory,
mode => 0700, mode => 0700,
owner => root, owner => root,
group => root, group => root,
require => Package["scsi-target-utils"], require => Package["scsi-target-utils"],
} }
exec { "iscsi-refresh": exec { "iscsi-refresh":
command => "tgt-admin -e", command => "tgt-admin -e",
path => "/bin:/usr/bin:/sbin:/usr/sbin", path => "/bin:/usr/bin:/sbin:/usr/sbin",
onlyif => "tgt-admin -e -p | egrep '^tgtadm '", onlyif => "tgt-admin -e -p | egrep '^tgtadm '",
require => Service["tgtd"], require => Service["tgtd"],
} }
} }
@ -74,24 +74,24 @@ define iscsi::target($tid, $initiator = "ALL", $ensure = "present") {
$iqn = sprintf("iqn.2005-08.tgt:%s%s", $hostname, regsubst($name, "/", ".", "G")) $iqn = sprintf("iqn.2005-08.tgt:%s%s", $hostname, regsubst($name, "/", ".", "G"))
case $ensure { case $ensure {
"present": { "present": {
file { "/etc/tgt/target.d/${tid}.conf": file { "/etc/tgt/target.d/${tid}.conf":
ensure => present, ensure => present,
content => template("iscsi/tid.conf.erb"), content => template("iscsi/tid.conf.erb"),
mode => 0600, mode => 0600,
owner => root, owner => root,
group => root, group => root,
require => File["/etc/tgt/target.d"], require => File["/etc/tgt/target.d"],
before => Exec["iscsi-refresh"], before => Exec["iscsi-refresh"],
} }
} }
"absent": { "absent": {
file { "/etc/tgt/target.d/${tid}.conf": file { "/etc/tgt/target.d/${tid}.conf":
ensure => absent, ensure => absent,
before => Exec["iscsi-refresh"], before => Exec["iscsi-refresh"],
} }
} }
} }
} }
@ -102,13 +102,13 @@ define iscsi::target($tid, $initiator = "ALL", $ensure = "present") {
class iscsi::initiator { class iscsi::initiator {
package { "iscsi-initiator-utils": package { "iscsi-initiator-utils":
ensure => installed, ensure => installed,
} }
service { "iscsid": service { "iscsid":
ensure => running, ensure => running,
enable => true, enable => true,
require => Package["iscsi-initiator-utils"], require => Package["iscsi-initiator-utils"],
} }
} }
@ -133,10 +133,10 @@ define iscsi::connect($portal) {
include iscsi::initiator include iscsi::initiator
exec { "iscsi-connect-${name}": exec { "iscsi-connect-${name}":
path => "/bin:/usr/bin:/sbin:/usr/sbin", path => "/bin:/usr/bin:/sbin:/usr/sbin",
command => "iscsiadm --mode discovery --type sendtargets --portal ${portal} && iscsiadm --mode node --targetname ${name} --portal ${portal} --login && sleep 5", command => "iscsiadm --mode discovery --type sendtargets --portal ${portal} && iscsiadm --mode node --targetname ${name} --portal ${portal} --login && sleep 5",
unless => "iscsiadm --mode session | egrep '${portal}:[0-9]*,[0-9]* ${name}'\$", unless => "iscsiadm --mode session | egrep '${portal}:[0-9]*,[0-9]* ${name}'\$",
require => Service["iscsid"], require => Service["iscsid"],
} }
} }

View file

@ -19,26 +19,26 @@
class kerberos::client { class kerberos::client {
case $operatingsystem { case $operatingsystem {
centos,fedora: { centos,fedora: {
package { "krb5-workstation": package { "krb5-workstation":
ensure => installed, ensure => installed,
} }
} }
} }
file { "krb5.conf": file { "krb5.conf":
path => $operatingsystem ? { path => $operatingsystem ? {
openbsd => "/etc/kerberosV/krb5.conf", openbsd => "/etc/kerberosV/krb5.conf",
default => "/etc/krb5.conf", default => "/etc/krb5.conf",
}, },
ensure => present, ensure => present,
content => template("kerberos/krb5.conf.erb"), content => template("kerberos/krb5.conf.erb"),
mode => 0644, mode => 0644,
owner => root, owner => root,
group => $operatingsystem ? { group => $operatingsystem ? {
openbsd => wheel, openbsd => wheel,
default => root, default => root,
}, },
} }
} }
@ -99,7 +99,7 @@ class kerberos::auth {
class kerberos::server inherits kerberos::client { class kerberos::server inherits kerberos::client {
package { "krb5-server": package { "krb5-server":
ensure => installed, ensure => installed,
} }
if $kerberos_datadir { if $kerberos_datadir {
@ -160,15 +160,15 @@ class kerberos::server inherits kerberos::client {
# $name: # $name:
# Keytab file path. # Keytab file path.
# $principals: # $principals:
# List of principals to be added into keytab # List of principals to be added into keytab
# $ensure: # $ensure:
# Set to present to create keytab and absent to remove it # Set to present to create keytab and absent to remove it
# $owner: # $owner:
# Owner for keytab file # Owner for keytab file
# $group: # $group:
# Group for keytab file # Group for keytab file
# $mode: # $mode:
# Permissions for keytab file # Permissions for keytab file
# #
# === Sample usage # === Sample usage
# #
@ -180,23 +180,23 @@ class kerberos::server inherits kerberos::client {
define kerberos::keytab($principals = [], $ensure = present, $owner = "root", $group = "", $mode = "0600") { define kerberos::keytab($principals = [], $ensure = present, $owner = "root", $group = "", $mode = "0600") {
case $group { case $group {
"": { "": {
case $operatingsystem { case $operatingsystem {
openbsd: { $real_group = "wheel" } openbsd: { $real_group = "wheel" }
default: { $real_group = "root" } default: { $real_group = "root" }
} }
} }
default: { default: {
$real_group = $group $real_group = $group
} }
} }
file { "${name}": file { $name:
ensure => $ensure, ensure => $ensure,
content => template("kerberos/keytab.erb"), content => template("kerberos/keytab.erb"),
mode => "${mode}", mode => $mode,
owner => "${owner}", owner => $owner,
group => "${real_group}", group => $real_group,
} }
} }

View file

@ -90,7 +90,7 @@ class ldap::auth inherits ldap::client {
require => Package["nscd"], require => Package["nscd"],
} }
} }
Ubuntu: { Ubuntu: {
package { "ldap-auth-client": package { "ldap-auth-client":
ensure => installed, ensure => installed,
} }
@ -111,19 +111,19 @@ class ldap::auth inherits ldap::client {
"set base ${ldap_basedn}", "set base ${ldap_basedn}",
"set nss_paged_results yes", "set nss_paged_results yes",
"set pam_password exop", "set pam_password exop",
"rm rootbinddn", "rm rootbinddn",
"set ssl on", ], "set ssl on", ],
onlyif => [ "get uri != '${ldap_uri}'", onlyif => [ "get uri != '${ldap_uri}'",
"get base != ${ldap_basedn}", "get base != ${ldap_basedn}",
"get nss_paged_results != yes", "get nss_paged_results != yes",
"get pam_password != exop", "get pam_password != exop",
"get rootbinddn == 'cn=manager,dc=example,dc=net'", "get rootbinddn == 'cn=manager,dc=example,dc=net'",
"get ssl != on", ], "get ssl != on", ],
} }
} }
Debian: { Debian: {
package {[ "libnss-ldap", package {[ "libnss-ldap",
"libpam-ldap" ]: "libpam-ldap" ]:
ensure => installed, ensure => installed,
} }
## Debian lacks some lenses. nss-ldap-conf and pam_ldap-conf needs corresponding files ## Debian lacks some lenses. nss-ldap-conf and pam_ldap-conf needs corresponding files
@ -144,7 +144,7 @@ class ldap::auth inherits ldap::client {
# "get pam_password != exop", # "get pam_password != exop",
# "get rootbinddn == 'cn=manager,dc=example,dc=net'", # "get rootbinddn == 'cn=manager,dc=example,dc=net'",
# "get ssl != on", ], # "get ssl != on", ],
# require => Package["libnss-ldap"], # require => Package["libnss-ldap"],
# } # }
# augeas { "pam_ldap-conf": # augeas { "pam_ldap-conf":
# context => "/files/etc/pam_ldap.conf", # context => "/files/etc/pam_ldap.conf",
@ -160,7 +160,7 @@ class ldap::auth inherits ldap::client {
# "get pam_password != exop", # "get pam_password != exop",
# "get rootbinddn == 'cn=manager,dc=example,dc=net'", # "get rootbinddn == 'cn=manager,dc=example,dc=net'",
# "get ssl != on", ], # "get ssl != on", ],
# require => Package["libpam-ldap"], # require => Package["libpam-ldap"],
# } # }
# augeas { "nsswitch-conf": # augeas { "nsswitch-conf":
# context => "/files/etc/nsswitch.conf", # context => "/files/etc/nsswitch.conf",
@ -170,7 +170,7 @@ class ldap::auth inherits ldap::client {
# onlyif => [ "get passwd: != 'files ldap'", # onlyif => [ "get passwd: != 'files ldap'",
# "get group: != 'files ldap'", # "get group: != 'files ldap'",
# "get shadow: != 'files ldap'", ], # "get shadow: != 'files ldap'", ],
# require => [ Augeas["pam_ldap-conf"], # require => [ Augeas["pam_ldap-conf"],
# Augeas["nss-ldap-conf"], ], # Augeas["nss-ldap-conf"], ],
# } # }
} }
@ -215,7 +215,7 @@ class ldap::client {
"debian" => "ldap-utils", "debian" => "ldap-utils",
"ubuntu" => "ldap-utils", "ubuntu" => "ldap-utils",
"openbsd" => "openldap-client", "openbsd" => "openldap-client",
default => "openldap-clients", default => "openldap-clients",
}, },
ensure => $operatingsystem ? { ensure => $operatingsystem ? {
darwin => absent, darwin => absent,
@ -227,16 +227,16 @@ class ldap::client {
ensure => present, ensure => present,
content => template("ldap/ldap.conf.erb"), content => template("ldap/ldap.conf.erb"),
path => $operatingsystem ? { path => $operatingsystem ? {
"debian" => "/etc/ldap/ldap.conf", "debian" => "/etc/ldap/ldap.conf",
"ubuntu" => "/etc/ldap/ldap.conf", "ubuntu" => "/etc/ldap/ldap.conf",
default => "/etc/openldap/ldap.conf", default => "/etc/openldap/ldap.conf",
}, },
mode => 0644, mode => 0644,
owner => root, owner => root,
group => $operatingsystem ? { group => $operatingsystem ? {
"darwin" => wheel, "darwin" => wheel,
"openbsd" => wheel, "openbsd" => wheel,
default => root, default => root,
}, },
require => Package["openldap-client"], require => Package["openldap-client"],
} }
@ -273,8 +273,8 @@ class ldap::client::ruby {
} }
package { "ruby-ldap": package { "ruby-ldap":
name => $pkgname,
ensure => installed, ensure => installed,
name => $pkgname,
} }
} }
@ -346,8 +346,8 @@ class ldap::server {
} }
package { "openldap-server": package { "openldap-server":
name => $package_name,
ensure => installed, ensure => installed,
name => $package_name,
} }
file { "${ssl::certs}/slapd.crt": file { "${ssl::certs}/slapd.crt":
@ -373,8 +373,8 @@ class ldap::server {
} }
file { "slapd.conf": file { "slapd.conf":
path => "${config}/slapd.conf",
ensure => present, ensure => present,
path => "${config}/slapd.conf",
content => template("ldap/slapd.conf.erb"), content => template("ldap/slapd.conf.erb"),
mode => 0640, mode => 0640,
owner => "root", owner => "root",
@ -418,7 +418,7 @@ class ldap::server {
} }
if $ldap_datadir { if $ldap_datadir {
file { "${ldap_datadir}": file { $ldap_datadir:
ensure => directory, ensure => directory,
mode => 0700, mode => 0700,
owner => $user, owner => $user,
@ -427,8 +427,8 @@ class ldap::server {
} }
file { "/srv/ldap": file { "/srv/ldap":
ensure => link, ensure => link,
target => "${ldap_datadir}", target => $ldap_datadir,
require => File["${ldap_datadir}"], require => File[$ldap_datadir],
} }
} else { } else {
file { "/srv/ldap": file { "/srv/ldap":
@ -587,8 +587,8 @@ define ldap::server::schema($idx = 50) {
include ldap::server include ldap::server
file { "${name}.schema": file { "${name}.schema":
path => "${ldap::server::config}/schema/${idx}-${name}.schema",
ensure => present, ensure => present,
path => "${ldap::server::config}/schema/${idx}-${name}.schema",
source => [ "puppet:///files/ldap/${name}.schema", source => [ "puppet:///files/ldap/${name}.schema",
"puppet:///modules/ldap/${name}.schema", ], "puppet:///modules/ldap/${name}.schema", ],
mode => 0644, mode => 0644,

View file

@ -24,13 +24,13 @@ define mercurial::clone($source, $ensure="tip") {
exec { "hg-clone-${name}": exec { "hg-clone-${name}":
path => "/bin:/usr/bin:/sbin:/usr/sbin", path => "/bin:/usr/bin:/sbin:/usr/sbin",
command => "hg -y clone -r ${ensure} ${source} ${name}", command => "hg -y clone -r ${ensure} ${source} ${name}",
creates => "${name}", creates => $name,
require => Package["mercurial"], require => Package["mercurial"],
} }
exec { "hg-pull-${name}": exec { "hg-pull-${name}":
path => "/bin:/usr/bin:/sbin:/usr/sbin", path => "/bin:/usr/bin:/sbin:/usr/sbin",
cwd => "${name}", cwd => $name,
command => "hg -y pull -u -r ${ensure}", command => "hg -y pull -u -r ${ensure}",
onlyif => $ensure ? { onlyif => $ensure ? {
"tip" => "hg -y in", "tip" => "hg -y in",

View file

@ -4,59 +4,59 @@
class munin::node { class munin::node {
package { "munin-node": package { "munin-node":
ensure => installed, ensure => installed,
} }
service { "munin-node": service { "munin-node":
name => $operatingsystem ? { name => $operatingsystem ? {
OpenBSD => $operatingsystemrelease ? { OpenBSD => $operatingsystemrelease ? {
/4\.[1-8]/ => "munin-node", /4\.[1-8]/ => "munin-node",
default => "munin_node", default => "munin_node",
}, },
default => "munin-node", default => "munin-node",
}, },
ensure => running, ensure => running,
enable => true, enable => true,
require => Package["munin-node"], require => Package["munin-node"],
start => $operatingsystem ? { start => $operatingsystem ? {
OpenBSD => $operatingsystemrelease ? { OpenBSD => $operatingsystemrelease ? {
/4\.[1-8]/ => "/usr/bin/install -d -o _munin /var/run/munin; /usr/local/sbin/munin-node", /4\.[1-8]/ => "/usr/bin/install -d -o _munin /var/run/munin; /usr/local/sbin/munin-node",
default => undef, default => undef,
}, },
default => undef, default => undef,
}, },
stop => $operatingsystem ? { stop => $operatingsystem ? {
OpenBSD => "/usr/bin/pkill -f /usr/local/sbin/munin-node", OpenBSD => "/usr/bin/pkill -f /usr/local/sbin/munin-node",
default => undef, default => undef,
}, },
} }
file { "/etc/munin/munin-node.conf": file { "/etc/munin/munin-node.conf":
ensure => present, ensure => present,
content => template("munin/munin-node.conf.erb"), content => template("munin/munin-node.conf.erb"),
owner => root, owner => root,
group => $operatingsystem ? { group => $operatingsystem ? {
OpenBSD => wheel, OpenBSD => wheel,
default => root, default => root,
}, },
mode => 0644, mode => 0644,
require => Package["munin-node"], require => Package["munin-node"],
notify => Exec["munin-node-configure"], notify => Exec["munin-node-configure"],
} }
@@file { "/etc/munin/nodes.d/${homename}.conf": @@file { "/etc/munin/nodes.d/${homename}.conf":
content => "[${homename}]\n address ${ipaddress}\n use_node_name yes\n", ensure => present,
ensure => present, content => "[${homename}]\n address ${ipaddress}\n use_node_name yes\n",
tag => "munin", tag => "munin",
notify => Exec["generate-munin-conf"], notify => Exec["generate-munin-conf"],
} }
exec { "munin-node-configure": exec { "munin-node-configure":
command => "munin-node-configure --shell --remove-also 2>/dev/null | /bin/sh", command => "munin-node-configure --shell --remove-also 2>/dev/null | /bin/sh",
path => "/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin:/usr/local/sbin", path => "/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin:/usr/local/sbin",
user => root, user => root,
refreshonly => true, refreshonly => true,
notify => Service["munin-node"], notify => Service["munin-node"],
} }
} }
@ -82,8 +82,8 @@ class munin::node {
define munin::snmpnode($snmp_community="public", $snmp_version="2") { define munin::snmpnode($snmp_community="public", $snmp_version="2") {
file { "/etc/munin/plugin-conf.d/snmp_${name}": file { "/etc/munin/plugin-conf.d/snmp_${name}":
content => "[snmp_${name}_*]\nenv.community ${snmp_community}\nenv.version ${snmp_version}\n",
ensure => present, ensure => present,
content => "[snmp_${name}_*]\nenv.community ${snmp_community}\nenv.version ${snmp_version}\n",
owner => root, owner => root,
group => $operatingsystem ? { group => $operatingsystem ? {
OpenBSD => wheel, OpenBSD => wheel,
@ -94,8 +94,8 @@ define munin::snmpnode($snmp_community="public", $snmp_version="2") {
} }
@@file { "/etc/munin/nodes.d/${name}.conf": @@file { "/etc/munin/nodes.d/${name}.conf":
content => "[${name}]\n address ${ipaddress}\n use_node_name no\n",
ensure => present, ensure => present,
content => "[${name}]\n address ${ipaddress}\n use_node_name no\n",
tag => "munin", tag => "munin",
notify => Exec["generate-munin-conf"], notify => Exec["generate-munin-conf"],
} }
@ -108,7 +108,7 @@ define munin::snmpnode($snmp_community="public", $snmp_version="2") {
# === Parameters # === Parameters
# #
# $name: # $name:
# Plugin name to install. # Plugin name to install.
# $config: # $config:
# Configuration file name associated with plugin. Defaults to none. # Configuration file name associated with plugin. Defaults to none.
# #
@ -121,71 +121,71 @@ define munin::snmpnode($snmp_community="public", $snmp_version="2") {
define munin::plugin($config = "") { define munin::plugin($config = "") {
case $operatingsystem { case $operatingsystem {
OpenBSD: { OpenBSD: {
file { "/usr/local/libexec/munin/plugins/${name}": file { "/usr/local/libexec/munin/plugins/${name}":
ensure => present, ensure => present,
source => "puppet:///modules/munin/plugins/${name}", source => "puppet:///modules/munin/plugins/${name}",
owner => root, owner => root,
group => wheel, group => wheel,
mode => 0755, mode => 0755,
require => Package["munin-node"], require => Package["munin-node"],
} }
}
default: {
file { "/usr/share/munin/plugins/${name}":
ensure => present,
source => "puppet:///modules/munin/plugins/${name}",
owner => root,
group => root,
mode => 0755,
require => Package["munin-node"],
}
} }
default: {
file { "/usr/share/munin/plugins/${name}":
ensure => present,
source => "puppet:///modules/munin/plugins/${name}",
owner => root,
group => root,
mode => 0755,
require => Package["munin-node"],
}
}
} }
if ($config) { if ($config) {
file { "/etc/munin/plugin-conf.d/${config}": file { "/etc/munin/plugin-conf.d/${config}":
ensure => present, ensure => present,
source => [ "puppet:///files/munin/plugin-conf/${config}.${fqdn}", source => [ "puppet:///files/munin/plugin-conf/${config}.${fqdn}",
"puppet:///files/munin/plugin-conf/${config}", "puppet:///files/munin/plugin-conf/${config}",
"puppet:///modules/munin/plugin-conf/${config}", ], "puppet:///modules/munin/plugin-conf/${config}", ],
owner => root, owner => root,
group => $operatingsystem ? { group => $operatingsystem ? {
OpenBSD => wheel, OpenBSD => wheel,
default => root, default => root,
},
mode => 0644,
notify => Service["munin-node"],
require => $operatingsystem ? {
OpenBSD => File["/usr/local/libexec/munin/plugins/${name}"],
default => File["/usr/share/munin/plugins/${name}"],
}, },
} mode => 0644,
notify => Service["munin-node"],
require => $operatingsystem ? {
OpenBSD => File["/usr/local/libexec/munin/plugins/${name}"],
default => File["/usr/share/munin/plugins/${name}"],
},
}
} }
case $operatingsystem { case $operatingsystem {
OpenBSD: { OpenBSD: {
exec { "munin-enable-${name}": exec { "munin-enable-${name}":
command => "ln -s /usr/local/libexec/munin/plugins/${name} /etc/munin/plugins/${name}", command => "ln -s /usr/local/libexec/munin/plugins/${name} /etc/munin/plugins/${name}",
path => "/bin:/usr/bin:/sbin:/usr/sbin", path => "/bin:/usr/bin:/sbin:/usr/sbin",
user => root, user => root,
onlyif => [ "test ! -h /etc/munin/plugins/${name}", onlyif => [ "test ! -h /etc/munin/plugins/${name}",
"/usr/local/libexec/munin/plugins/${name} autoconf", ], "/usr/local/libexec/munin/plugins/${name} autoconf", ],
notify => Service["munin-node"], notify => Service["munin-node"],
require => File["/usr/local/libexec/munin/plugins/${name}"], require => File["/usr/local/libexec/munin/plugins/${name}"],
} }
} }
default: { default: {
exec { "munin-enable-${name}": exec { "munin-enable-${name}":
command => "ln -s /usr/share/munin/plugins/${name} /etc/munin/plugins/${name}", command => "ln -s /usr/share/munin/plugins/${name} /etc/munin/plugins/${name}",
path => "/bin:/usr/bin:/sbin:/usr/sbin", path => "/bin:/usr/bin:/sbin:/usr/sbin",
user => root, user => root,
onlyif => [ "test ! -h /etc/munin/plugins/${name}", onlyif => [ "test ! -h /etc/munin/plugins/${name}",
"/usr/share/munin/plugins/${name} autoconf", ], "/usr/share/munin/plugins/${name} autoconf", ],
notify => Service["munin-node"], notify => Service["munin-node"],
require => File["/usr/share/munin/plugins/${name}"], require => File["/usr/share/munin/plugins/${name}"],
} }
} }
} }
} }
@ -200,11 +200,11 @@ define munin::plugin($config = "") {
class munin::server { class munin::server {
package { "munin": package { "munin":
ensure => installed, ensure => installed,
} }
if $munin_datadir { if $munin_datadir {
file { "${munin_datadir}": file { $munin_datadir:
ensure => directory, ensure => directory,
mode => 0755, mode => 0755,
owner => munin, owner => munin,
@ -220,15 +220,15 @@ class munin::server {
} }
file { "/var/lib/munin": file { "/var/lib/munin":
ensure => "${munin_datadir}", ensure => $munin_datadir,
force => true, force => true,
backup => ".orig", backup => ".orig",
require => File["${munin_datadir}"], require => File[$munin_datadir],
} }
} }
if $munin_htmldir { if $munin_htmldir {
file { "${munin_htmldir}": file { $munin_htmldir:
ensure => directory, ensure => directory,
mode => 0755, mode => 0755,
owner => munin, owner => munin,
@ -248,43 +248,43 @@ class munin::server {
} }
file { "/var/www/html/munin": file { "/var/www/html/munin":
ensure => "${munin_htmldir}", ensure => $munin_htmldir,
force => true, force => true,
backup => ".orig", backup => ".orig",
seltype => "munin_var_lib_t", seltype => "munin_var_lib_t",
require => File["${munin_htmldir}"], require => File[$munin_htmldir],
} }
} }
file { "/etc/munin/nodes.d": file { "/etc/munin/nodes.d":
ensure => directory, ensure => directory,
purge => true, purge => true,
force => true, force => true,
recurse => true, recurse => true,
owner => root, owner => root,
group => root, group => root,
mode => 0644, mode => 0644,
source => "puppet:///modules/custom/empty", source => "puppet:///modules/custom/empty",
require => Package["munin"], require => Package["munin"],
} }
file { "/etc/munin/munin.conf.in": file { "/etc/munin/munin.conf.in":
ensure => present, ensure => present,
source => [ "puppet:///files/munin/munin.conf.in", source => [ "puppet:///files/munin/munin.conf.in",
"puppet:///modules/munin/munin.conf.in", ], "puppet:///modules/munin/munin.conf.in", ],
owner => root, owner => root,
group => root, group => root,
mode => 0644, mode => 0644,
require => Package["munin"], require => Package["munin"],
notify => Exec["generate-munin-conf"], notify => Exec["generate-munin-conf"],
} }
exec { "generate-munin-conf": exec { "generate-munin-conf":
command => "cat /etc/munin/munin.conf.in /etc/munin/nodes.d/*.conf > /etc/munin/munin.conf", command => "cat /etc/munin/munin.conf.in /etc/munin/nodes.d/*.conf > /etc/munin/munin.conf",
path => "/bin:/usr/bin:/sbin:/usr/sbin", path => "/bin:/usr/bin:/sbin:/usr/sbin",
user => root, user => root,
refreshonly => true, refreshonly => true,
require => File["/etc/munin/munin.conf.in"], require => File["/etc/munin/munin.conf.in"],
} }
File <<| tag == "munin" |>> File <<| tag == "munin" |>>

View file

@ -9,7 +9,7 @@ class mutt {
$mail_server = "mail.${domain}" $mail_server = "mail.${domain}"
} }
if ! $mail_domain { if ! $mail_domain {
$mail_domain = "${domain}" $mail_domain = $domain
} }
case $operatingsystem { case $operatingsystem {
@ -26,8 +26,8 @@ class mutt {
} }
file { "Muttrc.local": file { "Muttrc.local":
name => "${muttconfdir}/Muttrc.local",
ensure => present, ensure => present,
name => "${muttconfdir}/Muttrc.local",
content => template("mutt/Muttrc.local.erb"), content => template("mutt/Muttrc.local.erb"),
mode => 0644, mode => 0644,
owner => root, owner => root,

View file

@ -20,11 +20,11 @@ class mysql::client {
class mysql::server { class mysql::server {
package { "mysql-server": package { "mysql-server":
ensure => installed, ensure => installed,
} }
if $mysql_datadir { if $mysql_datadir {
file { "${mysql_datadir}": file { $mysql_datadir:
ensure => directory, ensure => directory,
mode => 0755, mode => 0755,
owner => mysql, owner => mysql,
@ -34,9 +34,9 @@ class mysql::server {
} }
file { "/srv/mysql": file { "/srv/mysql":
ensure => link, ensure => link,
target => "${mysql_datadir}", target => $mysql_datadir,
seltype => "mysqld_db_t", seltype => "mysqld_db_t",
require => File["${mysql_datadir}"], require => File[$mysql_datadir],
} }
} else { } else {
file { "/srv/mysql": file { "/srv/mysql":
@ -57,7 +57,7 @@ class mysql::server {
if $mysql_datadir { if $mysql_datadir {
selinux::manage_fcontext { "${mysql_datadir}(/.*)?": selinux::manage_fcontext { "${mysql_datadir}(/.*)?":
type => "mysqld_db_t", type => "mysqld_db_t",
before => File["${mysql_datadir}"], before => File[$mysql_datadir],
} }
} }
} }
@ -68,30 +68,30 @@ class mysql::server {
"debian" => "mysql", "debian" => "mysql",
default => "mysqld", default => "mysqld",
}, },
ensure => running, ensure => running,
enable => true, enable => true,
require => File["/srv/mysql"], require => File["/srv/mysql"],
} }
file { "/etc/my.cnf": file { "/etc/my.cnf":
ensure => present, ensure => present,
source => [ "puppet:///files/mysql/my.cnf.${hostname}", source => [ "puppet:///files/mysql/my.cnf.${hostname}",
"puppet:///files/mysql/my.cnf", "puppet:///files/mysql/my.cnf",
"puppet:///modules/mysql/my.cnf", ], "puppet:///modules/mysql/my.cnf", ],
mode => 0644, mode => 0644,
owner => root, owner => root,
group => root, group => root,
require => Package["mysql-server"], require => Package["mysql-server"],
notify => Service["mysqld"], notify => Service["mysqld"],
} }
file { "/etc/logrotate.d/mysql": file { "/etc/logrotate.d/mysql":
ensure => present, ensure => present,
source => "puppet:///modules/mysql/mysql.logrotate", source => "puppet:///modules/mysql/mysql.logrotate",
mode => 0644, mode => 0644,
owner => root, owner => root,
group => root, group => root,
require => Package["mysql-server"], require => Package["mysql-server"],
} }
file { "/var/lib/mysql": file { "/var/lib/mysql":

View file

@ -72,7 +72,8 @@ class mythtv::backend {
} }
file { "/root/.mythtv": file { "/root/.mythtv":
ensure => "/etc/mythtv", ensure => link,
target => "/etc/mythtv",
force => true, force => true,
require => Package["mythtv-backend"], require => Package["mythtv-backend"],
} }

View file

@ -5,20 +5,20 @@
# #
class network::helper::restart { class network::helper::restart {
case $operatingsystem { case $operatingsystem {
centos,fedora: { centos,fedora: {
exec { "restart-network": exec { "restart-network":
command => "/sbin/service network restart", command => "/sbin/service network restart",
path => "/bin:/usr/bin:/sbin:/usr/sbin", path => "/bin:/usr/bin:/sbin:/usr/sbin",
refreshonly => true, refreshonly => true,
} }
} }
openbsd: { openbsd: {
exec { "restart-network": exec { "restart-network":
command => "/sbin/route delete default ; /bin/sh /etc/netstart", command => "/sbin/route delete default ; /bin/sh /etc/netstart",
path => "/bin:/usr/bin:/sbin:/usr/sbin", path => "/bin:/usr/bin:/sbin:/usr/sbin",
refreshonly => true, refreshonly => true,
} }
} }
debian,ubuntu: { debian,ubuntu: {
exec { "restart-network": exec { "restart-network":
cwd => "/etc/network", cwd => "/etc/network",
@ -101,12 +101,12 @@ class network::hostname {
# $name: # $name:
# Network device name. # Network device name.
# $ipaddr: # $ipaddr:
# IP address for interface. Use dhcp for DHCP configuration and none # IP address for interface. Use dhcp for DHCP configuration and none
# if interface just needs to be brought up. Defaults to none. # if interface just needs to be brought up. Defaults to none.
# $eaddr: # $eaddr:
# Ethernet address. Overrides udev configuration. # Ethernet address. Overrides udev configuration.
# $netmask: # $netmask:
# Netmask for interface. Required only when $ipaddr is used. # Netmask for interface. Required only when $ipaddr is used.
# $ip6addr: # $ip6addr:
# IPv6 address for interface. Use auto for autoconfigured address. # IPv6 address for interface. Use auto for autoconfigured address.
# Defaults to none. # Defaults to none.
@ -115,7 +115,7 @@ class network::hostname {
# $bridge: # $bridge:
# Array of interfaces to add to bridge. # Array of interfaces to add to bridge.
# $options: # $options:
# Custom options for interface (used only on OpenBSD). # Custom options for interface (used only on OpenBSD).
# $postcmd: # $postcmd:
# Custom commands to be executed after interface is up (used only on # Custom commands to be executed after interface is up (used only on
# OpenBSD). # OpenBSD).
@ -135,14 +135,14 @@ define network::interface($ipaddr = "none", $eaddr = "none", $netmask = "none",
# try to determine boot protocol from ip address # try to determine boot protocol from ip address
case $ipaddr { case $ipaddr {
dhcp: { $proto = "dhcp" } dhcp: { $proto = "dhcp" }
none: { $proto = "none" } none: { $proto = "none" }
default: { default: {
$proto = "static" $proto = "static"
case $netmask { case $netmask {
none: { fail("Netmask must be defined with ip address") } none: { fail("Netmask must be defined with ip address") }
} }
} }
} }
case $eaddr { case $eaddr {
none: { none: {
@ -155,39 +155,39 @@ define network::interface($ipaddr = "none", $eaddr = "none", $netmask = "none",
} }
case $operatingsystem { case $operatingsystem {
openbsd: { openbsd: {
file { "/etc/hostname.${name}": file { "/etc/hostname.${name}":
ensure => present, ensure => present,
content => template("network/hostname.if.erb"), content => template("network/hostname.if.erb"),
mode => 0600, mode => 0600,
owner => root, owner => root,
group => wheel, group => wheel,
notify => Exec["restart-network"], notify => Exec["restart-network"],
} }
} }
centos,fedora: { centos,fedora: {
if $bridge { if $bridge {
network::interface { $bridge: network::interface { $bridge:
options => [ "BRIDGE=${name}", "LINKDELAY=10" ], options => [ "BRIDGE=${name}", "LINKDELAY=10" ],
before => Exec["restart-interface-${name}"], before => Exec["restart-interface-${name}"],
} }
} }
file { "/etc/sysconfig/network-scripts/ifcfg-${name}": file { "/etc/sysconfig/network-scripts/ifcfg-${name}":
ensure => present, ensure => present,
content => template("network/ifcfg-if.erb"), content => template("network/ifcfg-if.erb"),
mode => 0644, mode => 0644,
owner => root, owner => root,
group => root, group => root,
notify => Exec["restart-interface-${name}"], notify => Exec["restart-interface-${name}"],
} }
exec { "restart-interface-${name}": exec { "restart-interface-${name}":
command => "ifdown ${name} ; ifup ${name}", command => "ifdown ${name} ; ifup ${name}",
path => "/bin:/usr/bin:/sbin:/usr/sbin", path => "/bin:/usr/bin:/sbin:/usr/sbin",
user => root, user => root,
refreshonly => true, refreshonly => true,
require => File["/etc/sysconfig/network-scripts/ifcfg-${name}"], require => File["/etc/sysconfig/network-scripts/ifcfg-${name}"],
} }
} }
debian,ubuntu: { debian,ubuntu: {
include network::helper::debian include network::helper::debian
file { "/etc/network/interfaces.d/${name}-addr.conf": file { "/etc/network/interfaces.d/${name}-addr.conf":
@ -209,9 +209,9 @@ define network::interface($ipaddr = "none", $eaddr = "none", $netmask = "none",
} }
} }
} }
default: { default: {
fail("Network module not supported in ${operatingsystem}") fail("Network module not supported in ${operatingsystem}")
} }
} }
} }
@ -233,17 +233,17 @@ define network::interface($ipaddr = "none", $eaddr = "none", $netmask = "none",
define network::route($gateway = "", $device, $ipv6gateway = "") { define network::route($gateway = "", $device, $ipv6gateway = "") {
case $name { case $name {
"default": { "default": {
case $operatingsystem { case $operatingsystem {
centos,fedora: { centos,fedora: {
include network::helper::restart include network::helper::restart
if "${gateway}" != "" { if "${gateway}" != "" {
augeas { "set-default-route": augeas { "set-default-route":
context => "/files/etc/sysconfig/network", context => "/files/etc/sysconfig/network",
changes => [ "set GATEWAY ${gateway}", changes => [ "set GATEWAY ${gateway}",
"set GATEWAYDEV ${device}", ], "set GATEWAYDEV ${device}", ],
notify => Exec["restart-network"], notify => Exec["restart-network"],
} }
} }
if "${ipv6gateway}" != "" { if "${ipv6gateway}" != "" {
augeas { "set-default-ipv6-route": augeas { "set-default-ipv6-route":
@ -252,18 +252,18 @@ define network::route($gateway = "", $device, $ipv6gateway = "") {
notify => Exec["restart-network"], notify => Exec["restart-network"],
} }
} }
} }
openbsd: { openbsd: {
include network::helper::restart include network::helper::restart
file { "/etc/mygate": file { "/etc/mygate":
ensure => present, ensure => present,
content => template("network/mygate.erb"), content => template("network/mygate.erb"),
mode => 644, mode => 0644,
owner => root, owner => root,
group => wheel, group => wheel,
notify => Exec["restart-network"], notify => Exec["restart-network"],
} }
} }
debian,ubuntu: { debian,ubuntu: {
include network::helper::restart include network::helper::restart
include network::helper::debian include network::helper::debian
@ -277,12 +277,12 @@ define network::route($gateway = "", $device, $ipv6gateway = "") {
require => File["/etc/network/interfaces.d/${device}-addr.conf"], require => File["/etc/network/interfaces.d/${device}-addr.conf"],
} }
} }
default: { default: {
fail("Network module not supported in ${operatingsystem}") fail("Network module not supported in ${operatingsystem}")
} }
} }
} }
default: { default: {
if ipv6gateway != "" { if ipv6gateway != "" {
fail("Custom IPv6 routes not supported yet.") fail("Custom IPv6 routes not supported yet.")
} }
@ -333,29 +333,29 @@ define network::route($gateway = "", $device, $ipv6gateway = "") {
# #
define network::carp($password, $ipaddr, $netmask, $options = []) { define network::carp($password, $ipaddr, $netmask, $options = []) {
case $operatingsystem { case $operatingsystem {
openbsd: { openbsd: {
network::interface { "carp${name}": network::interface { "carp${name}":
ipaddr => "${ipaddr}", ipaddr => $ipaddr,
netmask => "${netmask}", netmask => $netmask,
options => [ "vhid ${name}", "pass ${password}", $options ], options => [ "vhid ${name}", "pass ${password}", $options ],
postcmd => [ "/usr/sbin/ndp -i carp${name} -- -accept_rtadv" ], postcmd => [ "/usr/sbin/ndp -i carp${name} -- -accept_rtadv" ],
} }
} }
centos,fedora: { centos,fedora: {
include network::ucarp include network::ucarp
file { "/etc/ucarp/vip-${name}.conf": file { "/etc/ucarp/vip-${name}.conf":
ensure => present, ensure => present,
content => template("network/vip.conf.erb"), content => template("network/vip.conf.erb"),
mode => 0600, mode => 0600,
owner => root, owner => root,
group => root, group => root,
require => Package["ucarp"], require => Package["ucarp"],
notify => Service["ucarp"], notify => Service["ucarp"],
} }
} }
default: { default: {
fail("Network module not supported in ${operatingsystem}") fail("Network module not supported in ${operatingsystem}")
} }
} }
} }
@ -366,13 +366,13 @@ define network::carp($password, $ipaddr, $netmask, $options = []) {
# #
class network::ucarp { class network::ucarp {
package { "ucarp": package { "ucarp":
ensure => installed, ensure => installed,
} }
service { "ucarp": service { "ucarp":
ensure => running, ensure => running,
enable => true, enable => true,
hasstatus => true, hasstatus => true,
require => Package["ucarp"], require => Package["ucarp"],
} }
} }
@ -397,19 +397,19 @@ define network::pppoe($username, $password, $device, $authtype = "pap") {
include network::helper::restart include network::helper::restart
case $operatingsystem { case $operatingsystem {
openbsd: { openbsd: {
file { "/etc/hostname.${name}": file { "/etc/hostname.${name}":
ensure => present, ensure => present,
content => template("network/hostname.pppoe.erb"), content => template("network/hostname.pppoe.erb"),
mode => 0600, mode => 0600,
owner => root, owner => root,
group => wheel, group => wheel,
notify => Exec["restart-network"], notify => Exec["restart-network"],
} }
} }
default: { default: {
fail("Network module not supported in ${operatingsystem}") fail("Network module not supported in ${operatingsystem}")
} }
} }
} }
@ -438,27 +438,27 @@ define network::pppoe($username, $password, $device, $authtype = "pap") {
# #
define network::trunk($devices, $mode = 0, $ipaddr = "none", $netmask = "none") { define network::trunk($devices, $mode = 0, $ipaddr = "none", $netmask = "none") {
case $operatingsystem { case $operatingsystem {
centos,fedora: { centos,fedora: {
file { "/etc/modprobe.d/${name}.conf": file { "/etc/modprobe.d/${name}.conf":
ensure => present, ensure => present,
content => "alias ${name} bonding\noptions ${name} miimon=100 mode=${mode}\n", content => "alias ${name} bonding\noptions ${name} miimon=100 mode=${mode}\n",
mode => 0644, mode => 0644,
owner => root, owner => root,
group => root, group => root,
} }
network::interface { $devices: network::interface { $devices:
options => [ "MASTER=${name}", "SLAVE=yes", ], options => [ "MASTER=${name}", "SLAVE=yes", ],
require => File["/etc/modprobe.d/${name}.conf"], require => File["/etc/modprobe.d/${name}.conf"],
before => Network::Interface["${name}"], before => Network::Interface[$name],
} }
network::interface { $name: network::interface { $name:
ipaddr => "${ipaddr}", ipaddr => $ipaddr,
netmask => "${netmask}", netmask => $netmask,
} }
} }
default: { default: {
fail("Network module not supported in ${operatingsystem}") fail("Network module not supported in ${operatingsystem}")
} }
} }
} }
@ -469,12 +469,12 @@ define network::trunk($devices, $mode = 0, $ipaddr = "none", $netmask = "none")
# #
class network::helper::vlan { class network::helper::vlan {
case $operatingsystem { case $operatingsystem {
centos,fedora: { centos,fedora: {
augeas { "enable-vlan-support": augeas { "enable-vlan-support":
context => "/files/etc/sysconfig/network", context => "/files/etc/sysconfig/network",
changes => "set VLAN yes", changes => "set VLAN yes",
} }
} }
} }
} }
@ -505,25 +505,25 @@ class network::helper::vlan {
define network::vlan($device, $ipaddr = "none", $netmask = "none", define network::vlan($device, $ipaddr = "none", $netmask = "none",
$options = []) { $options = []) {
case $operatingsystem { case $operatingsystem {
openbsd: { openbsd: {
network::interface { "vlan${name}": network::interface { "vlan${name}":
options => [ "vlandev ${device}" ], options => [ "vlandev ${device}" ],
ipaddr => $ipaddr, ipaddr => $ipaddr,
netmask => $netmask, netmask => $netmask,
} }
} }
centos,fedora: { centos,fedora: {
include network::helper::vlan include network::helper::vlan
network::interface { "${device}.${name}": network::interface { "${device}.${name}":
ipaddr => $ipaddr, ipaddr => $ipaddr,
netmask => $netmask, netmask => $netmask,
options => $options, options => $options,
require => Augeas["enable-vlan-support"], require => Augeas["enable-vlan-support"],
} }
} }
default: { default: {
fail("Network module not supported in ${operatingsystem}") fail("Network module not supported in ${operatingsystem}")
} }
} }
} }

View file

@ -6,7 +6,7 @@ class nfs::client {
include portmap::server include portmap::server
package { "nfs-utils": package { "nfs-utils":
ensure => installed, ensure => installed,
} }
service { "nfslock": service { "nfslock":
@ -27,37 +27,37 @@ class nfs::server inherits nfs::client {
include portmap::server include portmap::server
file { "/etc/exports": file { "/etc/exports":
ensure => present, ensure => present,
source => [ "puppet:///files/nfs/exports.${fqdn}", source => [ "puppet:///files/nfs/exports.${fqdn}",
"puppet:///modules/nfs/exports", ], "puppet:///modules/nfs/exports", ],
mode => 0644, mode => 0644,
owner => root, owner => root,
group => root, group => root,
require => Package["nfs-utils"], require => Package["nfs-utils"],
notify => Exec["exportfs"], notify => Exec["exportfs"],
} }
file { "/etc/sysconfig/nfs": file { "/etc/sysconfig/nfs":
ensure => present, ensure => present,
source => "puppet:///modules/nfs/nfs.sysconfig", source => "puppet:///modules/nfs/nfs.sysconfig",
mode => 0644, mode => 0644,
owner => root, owner => root,
group => root, group => root,
notify => Service["nfs"], notify => Service["nfs"],
} }
service { "nfs": service { "nfs":
ensure => running, ensure => running,
enable => true, enable => true,
hasstatus => true, hasstatus => true,
require => Package["nfs-utils"], require => Package["nfs-utils"],
} }
exec { "exportfs": exec { "exportfs":
command => "exportfs -av", command => "exportfs -av",
path => "/bin:/usr/bin:/sbin:/usr/sbin", path => "/bin:/usr/bin:/sbin:/usr/sbin",
refreshonly => true, refreshonly => true,
require => Service["nfs"], require => Service["nfs"],
} }
} }

View file

@ -18,8 +18,8 @@ class nginx {
} }
service { "nginx": service { "nginx":
enable => true,
ensure => running, ensure => running,
enable => true,
require => Package["nginx"], require => Package["nginx"],
} }

View file

@ -9,7 +9,7 @@ class openvpn::client {
service { "openvpn": service { "openvpn":
ensure => running, ensure => running,
enable => true, enable => true,
require => [ Package["openvpn"], require => [ Package["openvpn"],
File["/etc/openvpn/openvpn.conf"], File["/etc/openvpn/openvpn.conf"],
File["/etc/openvpn/ta.key"], File["/etc/openvpn/ta.key"],
File["/etc/openvpn/ca.crt"], ], File["/etc/openvpn/ca.crt"], ],
@ -30,11 +30,11 @@ class openvpn::client {
file { "/etc/openvpn/openvpn.conf": file { "/etc/openvpn/openvpn.conf":
ensure => present, ensure => present,
content => template("openvpn/openvpn.conf.erb"), content => template("openvpn/openvpn.conf.erb"),
mode => 0640, mode => 0640,
owner => "root", owner => "root",
group => "root", group => "root",
notify => Service["openvpn"], notify => Service["openvpn"],
require => Package["openvpn"], require => Package["openvpn"],
} }
file { "/etc/openvpn/ta.key": file { "/etc/openvpn/ta.key":

View file

@ -31,7 +31,7 @@ class psacct::linux {
} }
service { "psacct": service { "psacct":
name => $operatingsystem ? { name => $operatingsystem ? {
ubuntu => "acct", ubuntu => "acct",
default => "psacct", default => "psacct",
}, },

View file

@ -19,15 +19,15 @@ class puppet::client {
} }
case $operatingsystem { case $operatingsystem {
centos,fedora: { centos,fedora: {
package { "ruby-shadow": package { "ruby-shadow":
ensure => installed, ensure => installed,
} }
} }
ubuntu,debian: { ubuntu,debian: {
package { "libaugeas-ruby": package { "libaugeas-ruby":
name => regsubst($rubyversion, '^([0-9]+\.[0-9]+)\..*', 'libaugeas-ruby\1'),
ensure => installed, ensure => installed,
name => regsubst($rubyversion, '^([0-9]+\.[0-9]+)\..*', 'libaugeas-ruby\1'),
before => Service["puppet"], before => Service["puppet"],
} }
} }
@ -259,7 +259,7 @@ class puppet::server::common inherits puppet::client {
} }
if $puppet_datadir { if $puppet_datadir {
file { "${puppet_datadir}": file { $puppet_datadir:
ensure => directory, ensure => directory,
mode => 0755, mode => 0755,
owner => root, owner => root,
@ -272,9 +272,9 @@ class puppet::server::common inherits puppet::client {
} }
file { "/srv/puppet": file { "/srv/puppet":
ensure => link, ensure => link,
target => "${puppet_datadir}", target => $puppet_datadir,
seltype => "var_lib_t", seltype => "var_lib_t",
require => File["${puppet_datadir}"], require => File[$puppet_datadir],
} }
} else { } else {
file { "/srv/puppet": file { "/srv/puppet":
@ -299,7 +299,7 @@ class puppet::server::common inherits puppet::client {
selinux::manage_fcontext { "${puppet_datadir}(/.*)?": selinux::manage_fcontext { "${puppet_datadir}(/.*)?":
type => "var_lib_t", type => "var_lib_t",
before => File[$puppet_datadir], before => File[$puppet_datadir],
} }
} }
} }

View file

@ -15,7 +15,7 @@ define python::setup::install($python="python") {
exec { "python-setup-install-${name}": exec { "python-setup-install-${name}":
path => "/bin:/usr/bin:/usr/local/bin:/sbin:/usr/sbin:/usr/local/sbin", path => "/bin:/usr/bin:/usr/local/bin:/sbin:/usr/sbin:/usr/local/sbin",
cwd => "${name}", cwd => $name,
command => "${python} setup.py install", command => "${python} setup.py install",
creates => "${name}/build", creates => "${name}/build",
} }

View file

@ -3,7 +3,7 @@
class samba::server { class samba::server {
package { "samba": package { "samba":
ensure => installed, ensure => installed,
} }
case $operatingsystem { case $operatingsystem {
@ -58,30 +58,30 @@ class samba::server {
} }
file { "/etc/samba/smb.conf": file { "/etc/samba/smb.conf":
ensure => present, ensure => present,
source => [ "puppet:///files/samba/smb.conf.${fqdn}", source => [ "puppet:///files/samba/smb.conf.${fqdn}",
"puppet:///files/samba/smb.conf", ], "puppet:///files/samba/smb.conf", ],
mode => 0644, mode => 0644,
owner => root, owner => root,
group => $operatingsystem ? { group => $operatingsystem ? {
openbsd => wheel, openbsd => wheel,
default => root, default => root,
}, },
require => Package["samba"], require => Package["samba"],
} }
file { "/etc/samba/lmhosts": file { "/etc/samba/lmhosts":
ensure => present, ensure => present,
source => [ "puppet:///files/samba/lmhosts.${fqdn}", source => [ "puppet:///files/samba/lmhosts.${fqdn}",
"puppet:///files/samba/lmhosts", "puppet:///files/samba/lmhosts",
"puppet:///modules/samba/lmhosts", ], "puppet:///modules/samba/lmhosts", ],
mode => 0644, mode => 0644,
owner => root, owner => root,
group => $operatingsystem ? { group => $operatingsystem ? {
openbsd => wheel, openbsd => wheel,
default => root, default => root,
}, },
require => Package["samba"], require => Package["samba"],
} }
} }

View file

@ -43,8 +43,9 @@ class saslauthd::server {
define saslauthd::service() { define saslauthd::service() {
case $architecture { case $architecture {
i386: { $libdir = "/usr/lib/sasl2" } "i386": { $libdir = "/usr/lib/sasl2" }
x86_64: { $libdir = "/usr/lib64/sasl2" } "x86_64": { $libdir = "/usr/lib64/sasl2" }
default: { fail("Unknown architecture ${architecture}")
} }
file { "${libdir}/${name}.conf": file { "${libdir}/${name}.conf":

View file

@ -8,8 +8,8 @@ class sendmail::common {
if $operatingsystem != "OpenBSD" { if $operatingsystem != "OpenBSD" {
package { "sendmail": package { "sendmail":
name => [ "sendmail", "sendmail-cf", ],
ensure => installed, ensure => installed,
name => [ "sendmail", "sendmail-cf", ],
} }
service { "sendmail": service { "sendmail":
ensure => running, ensure => running,
@ -68,8 +68,8 @@ class sendmail::client inherits sendmail::common {
} }
exec { "make submit.cf": exec { "make submit.cf":
path => "/bin:/usr/bin:/sbin:/usr/sbin:/etc/mail", path => "/bin:/usr/bin:/sbin:/usr/sbin:/etc/mail",
cwd => $operatingsystem ? { cwd => $operatingsystem ? {
"openbsd" => "/usr/share/sendmail/cf", "openbsd" => "/usr/share/sendmail/cf",
default => "/etc/mail", default => "/etc/mail",
}, },
@ -133,9 +133,11 @@ class sendmail::server inherits sendmail::common {
} }
} }
file { "sendmail.mc": name => $operatingsystem ? { file { "sendmail.mc":
"openbsd" => "/usr/share/sendmail/cf/sendmail.mc", name => $operatingsystem ? {
default => "/etc/mail/sendmail.mc", }, "openbsd" => "/usr/share/sendmail/cf/sendmail.mc",
default => "/etc/mail/sendmail.mc",
},
content => template("sendmail/sendmail.mc.erb"), content => template("sendmail/sendmail.mc.erb"),
owner => "root", owner => "root",
group => $group, group => $group,
@ -145,19 +147,19 @@ class sendmail::server inherits sendmail::common {
file { "/etc/aliases": file { "/etc/aliases":
ensure => present, ensure => present,
notify => Exec["newaliases"], notify => Exec["newaliases"],
owner => "root", owner => "root",
group => $group, group => $group,
mode => 0644, mode => 0644,
} }
exec { "make sendmail.cf": exec { "make sendmail.cf":
path => "/bin:/usr/bin:/sbin:/usr/sbin", path => "/bin:/usr/bin:/sbin:/usr/sbin",
cwd => $operatingsystem ? { cwd => $operatingsystem ? {
openbsd => "/usr/share/sendmail/cf", openbsd => "/usr/share/sendmail/cf",
default => "/etc/mail", default => "/etc/mail",
}, },
require => $operatingsystem ? { require => $operatingsystem ? {
openbsd => undef, openbsd => undef,
default => Package["sendmail"], default => Package["sendmail"],
}, },
@ -174,11 +176,11 @@ class sendmail::server inherits sendmail::common {
default => undef, default => undef,
}, },
require => Exec["make sendmail.cf"], require => Exec["make sendmail.cf"],
notify => Service["sendmail"], notify => Service["sendmail"],
} }
exec { "newaliases": exec { "newaliases":
path => "/bin:/usr/bin:/sbin:/usr/sbin", path => "/bin:/usr/bin:/sbin:/usr/sbin",
refreshonly => true, refreshonly => true,
} }
} }

View file

@ -12,10 +12,10 @@ class ssh::known_hosts {
}, },
} }
@@sshkey { "${homename}": @@sshkey { $homename:
ensure => present, ensure => present,
type => rsa, type => rsa,
key => "${sshrsakey}", key => $sshrsakey,
host_aliases => inline_template("<%= homename.split('.')[0] %>"), host_aliases => inline_template("<%= homename.split('.')[0] %>"),
require => File["/etc/ssh/ssh_known_hosts"], require => File["/etc/ssh/ssh_known_hosts"],
} }

View file

@ -77,10 +77,10 @@ define ssl::certificate($cn, $mode, $owner, $group,
exec { "openssl-req-${name}": exec { "openssl-req-${name}":
path => "/bin:/usr/bin:/usr/local/bin:/sbin:/usr/sbin:/usr/local/sbin", path => "/bin:/usr/bin:/usr/local/bin:/sbin:/usr/sbin:/usr/local/sbin",
command => "/bin/sh -c 'umask 077 ; openssl req -x509 -nodes -days ${days} -newkey rsa:${keysize} -subj \"${subject_real}\" -keyout ${keyout_real} -out ${name}'", command => "/bin/sh -c 'umask 077 ; openssl req -x509 -nodes -days ${days} -newkey rsa:${keysize} -subj \"${subject_real}\" -keyout ${keyout_real} -out ${name}'",
creates => [ "${name}", "${keyout_real}" ], creates => [ $name, $keyout_real ],
} }
file { "${name}": file { $name:
ensure => present, ensure => present,
mode => $mode, mode => $mode,
owner => $owner, owner => $owner,
@ -89,7 +89,7 @@ define ssl::certificate($cn, $mode, $owner, $group,
} }
if $keyout { if $keyout {
file { "${keyout}": file { $keyout:
ensure => present, ensure => present,
mode => $keymode, mode => $keymode,
owner => $keyowner, owner => $keyowner,
@ -117,10 +117,10 @@ define ssl::dhparam($mode, $owner, $group, $keysize="1024") {
exec { "openssl-dhparam-${name}": exec { "openssl-dhparam-${name}":
path => "/bin:/usr/bin:/usr/local/bin:/sbin:/usr/sbin:/usr/local/sbin", path => "/bin:/usr/bin:/usr/local/bin:/sbin:/usr/sbin:/usr/local/sbin",
command => "/bin/sh -c 'umask 077 ; openssl dhparam -out ${name} ${keysize}'", command => "/bin/sh -c 'umask 077 ; openssl dhparam -out ${name} ${keysize}'",
creates => "${name}", creates => $name,
} }
file { "${name}": file { $name:
ensure => present, ensure => present,
mode => $mode, mode => $mode,
owner => $owner, owner => $owner,

View file

@ -41,13 +41,13 @@ define svn::checkout($source, $ensure="HEAD") {
exec { "svn-co-${name}": exec { "svn-co-${name}":
path => "/bin:/usr/bin:/sbin:/usr/sbin", path => "/bin:/usr/bin:/sbin:/usr/sbin",
command => "svn checkout --non-interactive -r ${ensure} ${source} ${name}", command => "svn checkout --non-interactive -r ${ensure} ${source} ${name}",
creates => "${name}", creates => $name,
require => [ Package["subversion"], File["/etc/subversion/servers"], ], require => [ Package["subversion"], File["/etc/subversion/servers"], ],
} }
exec { "svn-up-${name}": exec { "svn-up-${name}":
path => "/bin:/usr/bin:/sbin:/usr/sbin", path => "/bin:/usr/bin:/sbin:/usr/sbin",
cwd => "${name}", cwd => $name,
command => "svn update --non-interactive -r ${ensure}", command => "svn update --non-interactive -r ${ensure}",
onlyif => $ensure ? { onlyif => $ensure ? {
"HEAD" => "svn status --non-interactive -q -u 2>&1 | egrep '^[[:space:]]+\\*'", "HEAD" => "svn status --non-interactive -q -u 2>&1 | egrep '^[[:space:]]+\\*'",
@ -92,7 +92,7 @@ define svn::export($source, $ensure="HEAD") {
exec { "svn-export-${name}": exec { "svn-export-${name}":
path => "/bin:/usr/bin:/sbin:/usr/sbin", path => "/bin:/usr/bin:/sbin:/usr/sbin",
command => "svn export --non-interactive -r ${ensure} ${source} ${name} && svn info --non-interactive -r ${ensure} ${source} 2>&1 | awk '/^Last Changed Rev:/ { print \$4 }' > ${name}/.svnrevision", command => "svn export --non-interactive -r ${ensure} ${source} ${name} && svn info --non-interactive -r ${ensure} ${source} 2>&1 | awk '/^Last Changed Rev:/ { print \$4 }' > ${name}/.svnrevision",
creates => "${name}", creates => $name,
require => Exec["svn-export-clean-${name}"], require => Exec["svn-export-clean-${name}"],
} }

View file

@ -17,15 +17,15 @@
define sysctl::set($value) { define sysctl::set($value) {
exec { "sysctl-${name}": exec { "sysctl-${name}":
command => "sysctl -w ${name}='${value}'", command => "sysctl -w ${name}='${value}'",
path => "/bin:/usr/bin:/sbin:/usr/sbin", path => "/bin:/usr/bin:/sbin:/usr/sbin",
unless => "test \"`sysctl -n ${name}`\" = \"${value}\"", unless => "test \"`sysctl -n ${name}`\" = \"${value}\"",
} }
exec { "sysctl-${name}-save": exec { "sysctl-${name}-save":
path => "/bin:/usr/bin:/sbin:/usr/sbin", path => "/bin:/usr/bin:/sbin:/usr/sbin",
command => "echo '${name}=${value}' >> /etc/sysctl.conf", command => "echo '${name}=${value}' >> /etc/sysctl.conf",
unless => "egrep '^${name}=' /etc/sysctl.conf", unless => "egrep '^${name}=' /etc/sysctl.conf",
} }
} }

View file

@ -84,8 +84,8 @@ class syslog::client::syslogd {
if $operatingsystem != "OpenBSD" { if $operatingsystem != "OpenBSD" {
package { "syslogd": package { "syslogd":
name => "sysklogd",
ensure => installed, ensure => installed,
name => "sysklogd",
before => File["/etc/syslog.conf"], before => File["/etc/syslog.conf"],
} }
} }

View file

@ -9,7 +9,7 @@
class tftp::server { class tftp::server {
if $tftp_datadir { if $tftp_datadir {
file { "${tftp_datadir}": file { $tftp_datadir:
ensure => directory, ensure => directory,
mode => 0755, mode => 0755,
owner => root, owner => root,
@ -21,9 +21,9 @@ class tftp::server {
} }
file { "/srv/tftpboot": file { "/srv/tftpboot":
ensure => link, ensure => link,
target => "${tftp_datadir}", target => $tftp_datadir,
seltype => "tftpdir_t", seltype => "tftpdir_t",
require => File["${tftp_datadir}"], require => File[$tftp_datadir],
} }
} else { } else {
file { "/srv/tftpboot": file { "/srv/tftpboot":
@ -64,8 +64,8 @@ class tftp::server {
} }
if $tftp_datadir { if $tftp_datadir {
selinux::manage_fcontext { "${tftp_datadir}(/.*)?": selinux::manage_fcontext { "${tftp_datadir}(/.*)?":
type => "tftpdir_t", type => "tftpdir_t",
before => File["${tftp_datadir}"], before => File[$tftp_datadir],
} }
} }
} }

View file

@ -5,7 +5,7 @@ class time::server {
include inetd::server include inetd::server
inetd::service { "time-stream": inetd::service { "time-stream":
ensure => present, ensure => present,
} }
} }
@ -17,24 +17,27 @@ class time::server {
class time::zone { class time::zone {
file { "/etc/localtime": file { "/etc/localtime":
ensure => present, ensure => present,
mode => 0644, mode => 0644,
source => "/usr/share/zoneinfo/$timezone_set" source => "/usr/share/zoneinfo/$timezone_set"
} }
case $operatingsystem { case $operatingsystem {
centos,redhat: { centos,redhat: {
file { "/etc/sysconfig/clock": file { "/etc/sysconfig/clock":
ensure => present, ensure => present,
mode => 0644, mode => 0644,
content => template("time/sysconfig_clock.erb"), content => template("time/sysconfig_clock.erb"),
} }
} }
ubuntu: { ubuntu: {
file { "/etc/timezone": file { "/etc/timezone":
ensure => present, ensure => present,
mode => 0644, mode => 0644,
content => "$timezone_set\n", content => "$timezone_set\n",
} }
} }
default: {
fail("time::zone not supported on ${operatingsystem}")
}
} }
} }

View file

@ -12,14 +12,12 @@ class user::system {
}, },
} }
case $operatingsystem { if $operatingsystem == "ubuntu": {
"ubuntu": { file { "/sbin/nologin":
file { "/sbin/nologin": ensure => link,
ensure => link, target => "/usr/sbin/nologin",
target => "/usr/sbin/nologin", owner => "root",
owner => "root", group => "root",
group => "root",
}
} }
} }
@ -241,7 +239,7 @@ class user::system {
# #
define user::newuser($uid, $gid, $comment, $home, $shell, $groups=undef, $requiregroups=undef) { define user::newuser($uid, $gid, $comment, $home, $shell, $groups=undef, $requiregroups=undef) {
user { "${name}": user { $name:
ensure => present, ensure => present,
uid => $uid, uid => $uid,
gid => $gid, gid => $gid,
@ -268,7 +266,7 @@ define user::newuser($uid, $gid, $comment, $home, $shell, $groups=undef, $requir
command => "/bin/sh -c 'umask 077; mkdir -p ${home} && tar cf - . | tar xf - -C ${home} && chown -R ${uid}:${gid} ${home}'", command => "/bin/sh -c 'umask 077; mkdir -p ${home} && tar cf - . | tar xf - -C ${home} && chown -R ${uid}:${gid} ${home}'",
cwd => "/etc/skel", cwd => "/etc/skel",
path => "/sbin:/usr/sbin:/bin:/usr/bin", path => "/sbin:/usr/sbin:/bin:/usr/bin",
creates => "${home}", creates => $home,
refreshonly => true, refreshonly => true,
} }

View file

@ -28,14 +28,14 @@ define util::extract::tar($source, $ensure=present, $strip=0, $preserve=false) {
exec { "tar-rmdir-${name}": exec { "tar-rmdir-${name}":
path => "/bin:/usr/bin:/sbin:/usr/sbin", path => "/bin:/usr/bin:/sbin:/usr/sbin",
command => "rm -fr ${name}", command => "rm -fr ${name}",
before => File["${name}"], before => File[$name],
subscribe => File["${source}"], subscribe => File[$source],
refreshonly => true, refreshonly => true,
} }
} }
} }
file { "${name}": file { $name:
ensure => directory, ensure => directory,
mode => 0755, mode => 0755,
owner => "root", owner => "root",
@ -65,7 +65,7 @@ define util::extract::tar($source, $ensure=present, $strip=0, $preserve=false) {
exec { "tar-extract-${name}": exec { "tar-extract-${name}":
path => "/bin:/usr/bin:/usr/local/bin:/sbin:/usr/sbin:/usr/local/sbin", path => "/bin:/usr/bin:/usr/local/bin:/sbin:/usr/sbin:/usr/local/sbin",
command => $command, command => $command,
require => File["${name}"], require => File[$name],
unless => "test -n \"$(ls -A ${name})\"", unless => "test -n \"$(ls -A ${name})\"",
} }
@ -95,8 +95,8 @@ define util::extract::zip($source, $ensure=present) {
exec { "zip-rmdir-${name}": exec { "zip-rmdir-${name}":
path => "/bin:/usr/bin:/sbin:/usr/sbin", path => "/bin:/usr/bin:/sbin:/usr/sbin",
command => "rm -fr ${name}", command => "rm -fr ${name}",
before => File["${name}"], before => File[$name],
subscribe => File["${source}"], subscribe => File[$source],
refreshonly => true, refreshonly => true,
} }
} }
@ -104,7 +104,7 @@ define util::extract::zip($source, $ensure=present) {
$command = "unzip ${source} -d ${name}" $command = "unzip ${source} -d ${name}"
file { "${name}": file { $name:
ensure => directory, ensure => directory,
mode => 0755, mode => 0755,
owner => root, owner => root,
@ -114,7 +114,7 @@ define util::extract::zip($source, $ensure=present) {
exec { "zip-extract-${name}": exec { "zip-extract-${name}":
path => "/bin:/usr/bin:/sbin:/usr/sbin", path => "/bin:/usr/bin:/sbin:/usr/sbin",
command => $command, command => $command,
require => File["${name}"], require => File[$name],
unless => "test -n \"$(ls -A ${name})\"", unless => "test -n \"$(ls -A ${name})\"",
} }
@ -158,7 +158,7 @@ define util::patch($source, $strip=0) {
exec { "patch-${name}-${source}": exec { "patch-${name}-${source}":
path => "/bin:/usr/bin:/sbin:/usr/sbin", path => "/bin:/usr/bin:/sbin:/usr/sbin",
cwd => "${name}", cwd => $name,
command => "patch -N -b -t -p${strip} < ${source}", command => "patch -N -b -t -p${strip} < ${source}",
onlyif => "patch --dry-run -N -b -t -p${strip} < ${source}", onlyif => "patch --dry-run -N -b -t -p${strip} < ${source}",
require => Class["util::patch::package"], require => Class["util::patch::package"],

View file

@ -4,12 +4,12 @@
class vmware::guest { class vmware::guest {
case $virtual { case $virtual {
vmware: { vmware: {
case $operatingsystem { case $operatingsystem {
centos: { include vmware::guest::centos } centos: { include vmware::guest::centos }
fedora: { include vmware::guest::fedora } fedora: { include vmware::guest::fedora }
} }
} }
} }
} }
@ -46,11 +46,11 @@ class vmware::guest::centos {
class vmware::guest::fedora { class vmware::guest::fedora {
package { "VMwareTools": package { "VMwareTools":
ensure => absent, ensure => absent,
} }
package { "open-vm-tools": package { "open-vm-tools":
ensure => installed, ensure => installed,
require => Package["VMwareTools"], require => Package["VMwareTools"],
} }
} }

View file

@ -2,50 +2,50 @@
class vmware::server { class vmware::server {
package { "VMware-server": package { "VMware-server":
ensure => installed, ensure => installed,
} }
service { "vmware": service { "vmware":
ensure => running, ensure => running,
enable => true, enable => true,
hasstatus => true, hasstatus => true,
start => "pkill 'vmnet-' ; /sbin/service vmware stop ; rm -f /etc/vmware/not_configured ; /sbin/service vmware start && sleep 5", start => "pkill 'vmnet-' ; /sbin/service vmware stop ; rm -f /etc/vmware/not_configured ; /sbin/service vmware start && sleep 5",
stop => "pkill 'vmnet-' ; /sbin/service vmware stop", stop => "pkill 'vmnet-' ; /sbin/service vmware stop",
require => [ Package["VMware-server"], require => [ Package["VMware-server"],
Exec["vmware-config.pl"], ], Exec["vmware-config.pl"], ],
} }
# seems that vmware init script fails if pid files are missing for vmnet # seems that vmware init script fails if pid files are missing for vmnet
# processes, so kill them by force first # processes, so kill them by force first
exec { "vmware-config.pl": exec { "vmware-config.pl":
command => "pkill 'vmnet-' ; perl /usr/bin/vmware-config.pl --default EULA_AGREED=yes && rm -f /etc/vmware/not_configured", command => "pkill 'vmnet-' ; perl /usr/bin/vmware-config.pl --default EULA_AGREED=yes && rm -f /etc/vmware/not_configured",
path => "/bin:/usr/bin:/sbin:/usr/sbin", path => "/bin:/usr/bin:/sbin:/usr/sbin",
environment => [ "PAGER=/bin/cat", ], environment => [ "PAGER=/bin/cat", ],
unless => "test ! -f /etc/vmware/not_configured -a -f /lib/modules/$kernelrelease/misc/vmci.ko", unless => "test ! -f /etc/vmware/not_configured -a -f /lib/modules/$kernelrelease/misc/vmci.ko",
require => Package["VMware-server"], require => Package["VMware-server"],
notify => Service["vmware"], notify => Service["vmware"],
} }
if $vmware_serial { if $vmware_serial {
exec { "vmware-set-serial": exec { "vmware-set-serial":
command => "/usr/lib/vmware/bin/vmware-vmx --new-sn ${vmware_serial}", command => "/usr/lib/vmware/bin/vmware-vmx --new-sn ${vmware_serial}",
path => "/bin:/usr/bin:/sbin:/usr/sbin", path => "/bin:/usr/bin:/sbin:/usr/sbin",
user => root, user => root,
creates => "/etc/vmware/license.vs.1.0-00", creates => "/etc/vmware/license.vs.1.0-00",
require => Package["VMware-server"], require => Package["VMware-server"],
before => Exec["vmware-config.pl"], before => Exec["vmware-config.pl"],
} }
} }
if $vmware_admin_group { if $vmware_admin_group {
file { "/etc/vmware/ssl/rui.key": file { "/etc/vmware/ssl/rui.key":
ensure => present, ensure => present,
mode => 0640, mode => 0640,
owner => root, owner => root,
group => $vmware_admin_group, group => $vmware_admin_group,
require => [ Service["vmware"], require => [ Service["vmware"],
Class["puppet::client"], ], Class["puppet::client"], ],
notify => Exec["restart-vmware-mgmt"], notify => Exec["restart-vmware-mgmt"],
} }
exec { "restart-vmware-mgmt": exec { "restart-vmware-mgmt":
command => "/etc/init.d/vmware-mgmt restart && sleep 10", command => "/etc/init.d/vmware-mgmt restart && sleep 10",
@ -73,21 +73,21 @@ class vmware::server::scripts {
include socat::package include socat::package
define vmware::server::scripts::file { define vmware::server::scripts::file {
file { "/usr/local/sbin/${name}": file { "/usr/local/sbin/${name}":
ensure => present, ensure => present,
source => "puppet:///modules/vmware/scripts/${name}", source => "puppet:///modules/vmware/scripts/${name}",
mode => 0755, mode => 0755,
owner => root, owner => root,
group => root, group => root,
} }
} }
file { "/usr/local/lib/vmware.sh": file { "/usr/local/lib/vmware.sh":
ensure => present, ensure => present,
source => "puppet:///modules/vmware/scripts/vmware.sh", source => "puppet:///modules/vmware/scripts/vmware.sh",
mode => 0644, mode => 0644,
owner => root, owner => root,
group => root, group => root,
} }
vmware::server::scripts::file { "vmware-console": } vmware::server::scripts::file { "vmware-console": }
@ -112,18 +112,18 @@ class vmware::server::vmfs {
include vmware::server include vmware::server
file { "/vmfs": file { "/vmfs":
ensure => directory, ensure => directory,
mode => 0755, mode => 0755,
owner => root, owner => root,
group => root, group => root,
require => Package["VMware-server"], require => Package["VMware-server"],
} }
file { "/vmfs/volumes": file { "/vmfs/volumes":
ensure => directory, ensure => directory,
mode => 0755, mode => 0755,
owner => root, owner => root,
group => root, group => root,
require => File["/vmfs"], require => File["/vmfs"],
} }
} }
@ -158,61 +158,61 @@ define vmware::server::datastore($device, $type = "auto", $options = "defaults")
if $type == "auto" { if $type == "auto" {
$server = regsubst($device, '^([a-zA-Z0-9\-]+):(/.+)$', '\1') $server = regsubst($device, '^([a-zA-Z0-9\-]+):(/.+)$', '\1')
if $server == $device { if $server == $device {
$fstype = $type $fstype = $type
if $device == regsubst($device, '^(/dev/).+$', '\1') { if $device == regsubst($device, '^(/dev/).+$', '\1') {
$mountopts = "bind" $mountopts = "bind"
} }
} else { } else {
$fstype = "nfs" $fstype = "nfs"
$path = regsubst($device, '^([a-zA-Z0-9\-]+):(/.+)$', '\2') $path = regsubst($device, '^([a-zA-Z0-9\-]+):(/.+)$', '\2')
} }
} }
if !$mountopts { if !$mountopts {
$mountopts = $options $mountopts = $options
} }
file { "/vmfs/volumes/${name}": file { "/vmfs/volumes/${name}":
ensure => directory, ensure => directory,
mode => $fstype ? { mode => $fstype ? {
nfs => 0755, nfs => 0755,
default => 0775, default => 0775,
}, },
owner => root, owner => root,
group => $fstype ? { group => $fstype ? {
nfs => "root", nfs => "root",
default => $real_vmware_admin_group, default => $real_vmware_admin_group,
}, },
require => File["/vmfs/volumes"], require => File["/vmfs/volumes"],
} }
mount { "/vmfs/volumes/${name}": mount { "/vmfs/volumes/${name}":
ensure => mounted, ensure => mounted,
device => "${device}", device => $device,
fstype => "${fstype}", fstype => $fstype,
options => "${mountopts}", options => $mountopts,
require => File["/vmfs/volumes/${name}"], require => File["/vmfs/volumes/${name}"],
} }
exec { "vmware-create-datastore-${name}": exec { "vmware-create-datastore-${name}":
command => $fstype ? { command => $fstype ? {
nfs => "vmware-vim-cmd hostsvc/datastore/nas_create ${name} ${server} ${path} 0", nfs => "vmware-vim-cmd hostsvc/datastore/nas_create ${name} ${server} ${path} 0",
default => "vmware-vim-cmd hostsvc/datastore/localds_create ${name} /vmfs/volumes/${name}", default => "vmware-vim-cmd hostsvc/datastore/localds_create ${name} /vmfs/volumes/${name}",
}, },
path => "/bin:/usr/bin:/sbin:/usr/sbin", path => "/bin:/usr/bin:/sbin:/usr/sbin",
user => root, user => root,
unless => "vmware-vim-cmd hostsvc/datastore/summary ${name}", unless => "vmware-vim-cmd hostsvc/datastore/summary ${name}",
require => [ Mount["/vmfs/volumes/${name}"], require => [ Mount["/vmfs/volumes/${name}"],
Service["vmware"], ], Service["vmware"], ],
notify => Exec["vmware-refresh-datastore-${name}"], notify => Exec["vmware-refresh-datastore-${name}"],
} }
exec { "vmware-refresh-datastore-${name}": exec { "vmware-refresh-datastore-${name}":
command => "vmware-vim-cmd hostsvc/datastore/refresh ${name}", command => "vmware-vim-cmd hostsvc/datastore/refresh ${name}",
path => "/bin:/usr/bin:/sbin:/usr/sbin", path => "/bin:/usr/bin:/sbin:/usr/sbin",
user => root, user => root,
refreshonly => true, refreshonly => true,
} }
} }
@ -229,7 +229,7 @@ define vmware::server::datastore($device, $type = "auto", $options = "defaults")
# $device: # $device:
# Physical network device to bridge. # Physical network device to bridge.
# $ensure: # $ensure:
# Set to present to enable bridge and absent to disable it. # Set to present to enable bridge and absent to disable it.
# #
# === Sample usage # === Sample usage
# #
@ -243,35 +243,35 @@ define vmware::server::bridge($description, $device, $ensure = "present") {
$vmnet = regsubst($name, '^vmnet([0-9]+)$', '\1') $vmnet = regsubst($name, '^vmnet([0-9]+)$', '\1')
if $vmnet == $name { if $vmnet == $name {
fail("Invalid vmnet device name.") fail("Invalid vmnet device name.")
} }
service { "${name}-bridge": service { "${name}-bridge":
ensure => $ensure ? { ensure => $ensure ? {
"present" => running, "present" => running,
"absent" => stopped, "absent" => stopped,
}, },
pattern => "/usr/bin/vmnet-bridge -d .* -n ${vmnet}", pattern => "/usr/bin/vmnet-bridge -d .* -n ${vmnet}",
start => "/usr/bin/vmnet-bridge -d /var/run/vmnet-bridge-${vmnet}.pid -n ${vmnet} -i ${device}", start => "/usr/bin/vmnet-bridge -d /var/run/vmnet-bridge-${vmnet}.pid -n ${vmnet} -i ${device}",
stop => "pkill -f '/usr/bin/vmnet-bridge -d .* -n ${vmnet}'", stop => "pkill -f '/usr/bin/vmnet-bridge -d .* -n ${vmnet}'",
provider => base, provider => base,
require => Exec["vmware-config.pl"], require => Exec["vmware-config.pl"],
} }
vmware_config { "VNET_${vmnet}_NAME": vmware_config { "VNET_${vmnet}_NAME":
ensure => $ensure ? { ensure => $ensure ? {
absent => absent, absent => absent,
present => "${description}", present => $description,
}, },
require => Exec["vmware-config.pl"], require => Exec["vmware-config.pl"],
} }
vmware_config { "VNET_${vmnet}_INTERFACE": vmware_config { "VNET_${vmnet}_INTERFACE":
ensure => $ensure ? { ensure => $ensure ? {
absent => absent, absent => absent,
present => "${device}", present => $device,
}, },
notify => Service["${name}-bridge"], notify => Service["${name}-bridge"],
require => Exec["vmware-config.pl"], require => Exec["vmware-config.pl"],
} }
} }

View file

@ -44,7 +44,7 @@ class vsroom {
realize(User["vsroom"], Group["vsroom"]) realize(User["vsroom"], Group["vsroom"])
if $vsroom_datadir { if $vsroom_datadir {
file { "${vsroom_datadir}": file { $vsroom_datadir:
ensure => directory, ensure => directory,
mode => 0750, mode => 0750,
owner => "root", owner => "root",
@ -53,8 +53,8 @@ class vsroom {
file { "/var/lib/vsroom": file { "/var/lib/vsroom":
ensure => link, ensure => link,
target => "${vsroom_datadir}", target => $vsroom_datadir,
require => File["${vsroom_datadir}"], require => File[$vsroom_datadir],
} }
} else { } else {
file { "/var/lib/vsroom": file { "/var/lib/vsroom":

View file

@ -171,7 +171,7 @@ class wiki::collab::base {
} }
if $wiki_datadir { if $wiki_datadir {
file { "${wiki_datadir}": file { $wiki_datadir:
ensure => directory, ensure => directory,
mode => 0755, mode => 0755,
owner => root, owner => root,
@ -180,8 +180,8 @@ class wiki::collab::base {
file { "/srv/wikis": file { "/srv/wikis":
ensure => link, ensure => link,
target => "${wiki_datadir}", target => $wiki_datadir,
require => File["${wiki_datadir}"], require => File[$wiki_datadir],
} }
} else { } else {
file { "/srv/wikis": file { "/srv/wikis":