Added support for RHEL and did some syntax cleaning

Assume that "RedHat" also works where "CentOS" does.
This commit is contained in:
Ossi Salmi 2012-09-05 16:42:02 +03:00
parent e9aae1dcf6
commit 24ecb51f6f
63 changed files with 544 additions and 497 deletions

View file

@ -2,14 +2,14 @@
# #
class abusehelper { class abusehelper {
case $operatingsystem { case $::operatingsystem {
ubuntu: { "ubuntu": {
package { [ "python-pyme", "python-tz" ]: package { [ "python-pyme", "python-tz" ]:
ensure => installed, ensure => installed,
} }
} }
centos: { "centos","redhat": {
case $operatingsystemrelease { case $::operatingsystemrelease {
/^5/: { /^5/: {
package { "python26": package { "python26":
ensure => installed, ensure => installed,
@ -44,7 +44,7 @@ class abusehelper {
ensure => present, ensure => present,
mode => "0644", mode => "0644",
owner => "root", owner => "root",
group => $operatingsystem ? { group => $::operatingsystem ? {
"openbsd" => "wheel", "openbsd" => "wheel",
default => "root", default => "root",
}, },
@ -61,7 +61,7 @@ class abusehelper {
ensure => present, ensure => present,
mode => "0644", mode => "0644",
owner => "root", owner => "root",
group => $operatingsystem ? { group => $::operatingsystem ? {
"openbsd" => "wheel", "openbsd" => "wheel",
default => "root", default => "root",
}, },

View file

@ -2,15 +2,15 @@
# #
class adobe::common { class adobe::common {
case $operatingsystem { case $::operatingsystem {
"centos","fedora": { "centos","redhat","fedora": {
include yum::repo::adobe include yum::repo::adobe
} }
"ubuntu": { "ubuntu": {
include apt::repo::partner include apt::repo::partner
} }
default: { default: {
fail("Adobe products via puppet not supported on ${operatingsystem}") fail("Adobe products via puppet not supported on ${::operatingsystem}")
} }
} }
@ -36,7 +36,7 @@ class adobe::flash {
include adobe::common include adobe::common
package { "adobe-flash-plugin": package { "adobe-flash-plugin":
name => $operatingsystem ? { name => $::operatingsystem ? {
"ubuntu" => "adobe-flashplugin", "ubuntu" => "adobe-flashplugin",
default => "flash-plugin", default => "flash-plugin",
}, },
@ -53,7 +53,7 @@ class adobe::reader {
include adobe::common include adobe::common
package { "acroread": package { "acroread":
name => $operatingsystem ? { name => $::operatingsystem ? {
"ubuntu" => "acroread", "ubuntu" => "acroread",
default => "AdobeReader_enu", default => "AdobeReader_enu",
}, },

View file

@ -5,7 +5,7 @@ import "redhat.pp"
# #
class apache::common { class apache::common {
case $operatingsystem { case $::operatingsystem {
debian,ubuntu: { debian,ubuntu: {
if ! $httpd_user { if ! $httpd_user {
$user = "www-data" $user = "www-data"
@ -65,7 +65,7 @@ class apache::common {
} }
package { "httpd": package { "httpd":
name => $operatingsystem ? { name => $::operatingsystem ? {
debian => "apache2", debian => "apache2",
ubuntu => "apache2", ubuntu => "apache2",
default => "httpd", default => "httpd",
@ -110,11 +110,11 @@ class apache::common {
# #
class apache::server inherits apache::common { class apache::server inherits apache::common {
case $operatingsystem { case $::operatingsystem {
debian,ubuntu: { "debian","ubuntu": {
include apache::debian::server include apache::debian::server
} }
centos,fedora: { "centos","redhat","fedora": {
if ! $httpd_user { if ! $httpd_user {
$user = "apache" $user = "apache"
} else { } else {
@ -128,7 +128,7 @@ class apache::server inherits apache::common {
include apache::redhat::server include apache::redhat::server
} }
default: { default: {
fail("Apache module not supported in ${operatingsystem}.") fail("Apache module not supported in ${::operatingsystem}.")
} }
} }
@ -159,15 +159,15 @@ class apache::server inherits apache::common {
# #
define apache::site($aliases="", $root="", $redirect="") { 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","redhat","fedora": {
apache::redhat::site { $name: apache::redhat::site { $name:
aliases => $aliases, aliases => $aliases,
root => $root, root => $root,
@ -175,7 +175,7 @@ define apache::site($aliases="", $root="", $redirect="") {
} }
} }
default: { default: {
fail("Apache module not supported in ${operatingsystem}.") fail("Apache module not supported in ${::operatingsystem}.")
} }
} }
@ -204,11 +204,11 @@ define apache::site($aliases="", $root="", $redirect="") {
# #
class apache::sslserver inherits apache::common { class apache::sslserver inherits apache::common {
case $operatingsystem { case $::operatingsystem {
debian,ubuntu: { "debian","ubuntu": {
include apache::debian::sslserver include apache::debian::sslserver
} }
centos,fedora: { "centos","redhat","fedora": {
if ! $httpsd_user { if ! $httpsd_user {
$user = "httpsd" $user = "httpsd"
} else { } else {
@ -222,7 +222,7 @@ class apache::sslserver inherits apache::common {
include apache::redhat::sslserver include apache::redhat::sslserver
} }
default: { default: {
fail("Apache module not supported in ${operatingsystem}.") fail("Apache module not supported in ${::operatingsystem}.")
} }
} }
@ -271,8 +271,8 @@ define apache::sslsite($ipaddr="_default_", $root="", $ssl_cert="", $ssl_key="",
include apache::sslserver::listen include apache::sslserver::listen
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,
@ -283,7 +283,7 @@ define apache::sslsite($ipaddr="_default_", $root="", $ssl_cert="", $ssl_key="",
require => Class["apache::sslserver::listen"], require => Class["apache::sslserver::listen"],
} }
} }
centos,fedora: { "centos","redhat","fedora": {
$apache_ssldir = "/etc/pki/tls" $apache_ssldir = "/etc/pki/tls"
apache::redhat::sslsite { $name: apache::redhat::sslsite { $name:
ipaddr => $ipaddr, ipaddr => $ipaddr,
@ -295,7 +295,7 @@ define apache::sslsite($ipaddr="_default_", $root="", $ssl_cert="", $ssl_key="",
} }
} }
default: { default: {
fail("Apache module not supported in ${operatingsystem}.") fail("Apache module not supported in ${::operatingsystem}.")
} }
} }
@ -339,8 +339,8 @@ define apache::sslsite($ipaddr="_default_", $root="", $ssl_cert="", $ssl_key="",
# #
define apache::configfile($source="", $content="", $http=true, $https=true) { 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,
@ -348,7 +348,7 @@ define apache::configfile($source="", $content="", $http=true, $https=true) {
https => $https, https => $https,
} }
} }
centos,fedora: { "centos","redhat","fedora": {
apache::redhat::configfile { $name: apache::redhat::configfile { $name:
source => $source, source => $source,
content => $content, content => $content,
@ -357,7 +357,7 @@ define apache::configfile($source="", $content="", $http=true, $https=true) {
} }
} }
default: { default: {
fail("Apache module not supported in ${operatingsystem}.") fail("Apache module not supported in ${::operatingsystem}.")
} }
} }
@ -386,13 +386,13 @@ class apache::mod::auth_kerb {
# #
class apache::mod::authnz_ldap { class apache::mod::authnz_ldap {
case $operatingsystem { case $::operatingsystem {
debian,ubuntu: { "debian","ubuntu": {
apache::debian::a2enmod { "authnz_ldap": } apache::debian::a2enmod { "authnz_ldap": }
} }
centos,fedora: { } "centos","redhat","fedora": { }
default: { default: {
fail("Apache module not supported in ${operatingsystem}.") fail("Apache module not supported in ${::operatingsystem}.")
} }
} }
@ -402,13 +402,13 @@ class apache::mod::authnz_ldap {
# #
class apache::mod::include { class apache::mod::include {
case $operatingsystem { case $::operatingsystem {
debian,ubuntu: { "debian","ubuntu": {
apache::debian::a2enmod { "include": } apache::debian::a2enmod { "include": }
} }
centos,fedora: { } "centos","redhat","fedora": { }
default: { default: {
fail("Apache module not supported in ${operatingsystem}.") fail("Apache module not supported in ${::operatingsystem}.")
} }
} }
@ -419,7 +419,7 @@ class apache::mod::include {
class apache::mod::fcgid { class apache::mod::fcgid {
package { "mod_fcgid": package { "mod_fcgid":
name => $operatingsystem ? { name => $::operatingsystem ? {
debian => "libapache2-mod-fcgid", debian => "libapache2-mod-fcgid",
ubuntu => "libapache2-mod-fcgid", ubuntu => "libapache2-mod-fcgid",
default => "mod_fcgid", default => "mod_fcgid",
@ -428,19 +428,19 @@ class apache::mod::fcgid {
require => Package["httpd"], require => Package["httpd"],
} }
case $operatingsystem { case $::operatingsystem {
debian,ubuntu: { "debian","ubuntu": {
apache::debian::a2enmod { "fcgid": apache::debian::a2enmod { "fcgid":
require => Package ["libapache2-mod-fcgid"], require => Package ["libapache2-mod-fcgid"],
} }
} }
centos,fedora: { "centos","redhat","fedora": {
apache::configfile { "fcgid.conf": apache::configfile { "fcgid.conf":
require => Package["mod_fcgid"], require => Package["mod_fcgid"],
} }
} }
default: { default: {
fail("Apache module not supported in ${operatingsystem}.") fail("Apache module not supported in ${::operatingsystem}.")
} }
} }
@ -451,13 +451,13 @@ class apache::mod::fcgid {
# #
class apache::mod::headers { class apache::mod::headers {
case $operatingsystem { case $::operatingsystem {
debian,ubuntu: { "debian","ubuntu": {
apache::debian::a2enmod { "headers": } apache::debian::a2enmod { "headers": }
} }
centos,fedora: { } "centos","redhat","fedora": { }
default: { default: {
fail("Apache module not supported in ${operatingsystem}.") fail("Apache module not supported in ${::operatingsystem}.")
} }
} }
@ -468,13 +468,13 @@ class apache::mod::headers {
# #
class apache::mod::ldap { class apache::mod::ldap {
case $operatingsystem { case $::operatingsystem {
debian,ubuntu: { "debian","ubuntu": {
apache::debian::a2enmod { "ldap": } apache::debian::a2enmod { "ldap": }
} }
centos,fedora: { } "centos","redhat","fedora": { }
default: { default: {
fail("Apache module not supported in ${operatingsystem}.") fail("Apache module not supported in ${::operatingsystem}.")
} }
} }
@ -486,7 +486,7 @@ class apache::mod::ldap {
class apache::mod::perl { class apache::mod::perl {
package { "mod_perl": package { "mod_perl":
name => $operatingsystem ? { name => $::operatingsystem ? {
debian => "libapache2-mod-perl2", debian => "libapache2-mod-perl2",
ubuntu => "libapache2-mod-perl2", ubuntu => "libapache2-mod-perl2",
default => "mod_perl", default => "mod_perl",
@ -495,19 +495,19 @@ class apache::mod::perl {
require => Package["httpd"], require => Package["httpd"],
} }
case $operatingsystem { case $::operatingsystem {
debian,ubuntu: { "debian","ubuntu": {
apache::debian::a2enmod { "perl2": apache::debian::a2enmod { "perl2":
require => Package ["libapache2-mod-perl2"], require => Package ["libapache2-mod-perl2"],
} }
} }
centos,fedora: { "centos","redhat","fedora": {
apache::configfile { "perl.conf": apache::configfile { "perl.conf":
require => Package["mod_perl"], require => Package["mod_perl"],
} }
} }
default: { default: {
fail("Apache module not supported in ${operatingsystem}.") fail("Apache module not supported in ${::operatingsystem}.")
} }
} }
@ -519,7 +519,7 @@ class apache::mod::perl {
class apache::mod::php { class apache::mod::php {
package { "php": package { "php":
name => $operatingsystem ? { name => $::operatingsystem ? {
debian => "libapache2-mod-php5", debian => "libapache2-mod-php5",
ubuntu => "libapache2-mod-php5", ubuntu => "libapache2-mod-php5",
default => "php", default => "php",
@ -528,19 +528,19 @@ class apache::mod::php {
require => Package["httpd"], require => Package["httpd"],
} }
case $operatingsystem { case $::operatingsystem {
debian,ubuntu: { "debian","ubuntu": {
apache::debian::a2enmod { "php5": apache::debian::a2enmod { "php5":
require => Package ["libapache2-mod-php5"], require => Package ["libapache2-mod-php5"],
} }
} }
centos,fedora: { "centos","redhat","fedora": {
apache::configfile { "php.conf": apache::configfile { "php.conf":
require => Package["php"], require => Package["php"],
} }
} }
default: { default: {
fail("Apache module not supported in ${operatingsystem}.") fail("Apache module not supported in ${::operatingsystem}.")
} }
} }
@ -551,19 +551,19 @@ class apache::mod::php {
# #
class apache::mod::proxy { class apache::mod::proxy {
case $operatingsystem { case $::operatingsystem {
debian,ubuntu: { "debian","ubuntu": {
apache::debian::a2enmod { "proxy": apache::debian::a2enmod { "proxy":
content => template("apache/proxy.conf.erb"), content => template("apache/proxy.conf.erb"),
} }
} }
centos,fedora: { "centos","redhat","fedora": {
apache::configfile { "proxy.conf": apache::configfile { "proxy.conf":
content => template("apache/proxy.conf.erb"), content => template("apache/proxy.conf.erb"),
} }
} }
default: { default: {
fail("Apache module not supported in ${operatingsystem}.") fail("Apache module not supported in ${::operatingsystem}.")
} }
} }
@ -574,13 +574,13 @@ class apache::mod::proxy {
# #
class apache::mod::proxy_http { class apache::mod::proxy_http {
case $operatingsystem { case $::operatingsystem {
debian,ubuntu: { "debian","ubuntu": {
apache::debian::a2enmod { "proxy_http": } apache::debian::a2enmod { "proxy_http": }
} }
centos,fedora: { } "centos","redhat","fedora": { }
default: { default: {
fail("Apache module not supported in ${operatingsystem}.") fail("Apache module not supported in ${::operatingsystem}.")
} }
} }
@ -591,13 +591,13 @@ class apache::mod::proxy_http {
# #
class apache::mod::proxy_balancer { class apache::mod::proxy_balancer {
case $operatingsystem { case $::operatingsystem {
debian,ubuntu: { "debian","ubuntu": {
apache::debian::a2enmod { "proxy_balancer": } apache::debian::a2enmod { "proxy_balancer": }
} }
centos,fedora: { } "centos","redhat","fedora": { }
default: { default: {
fail("Apache module not supported in ${operatingsystem}.") fail("Apache module not supported in ${::operatingsystem}.")
} }
} }
@ -609,7 +609,7 @@ class apache::mod::proxy_balancer {
class apache::mod::python { class apache::mod::python {
package { "mod_python": package { "mod_python":
name => $operatingsystem ? { name => $::operatingsystem ? {
debian => "libapache2-mod-python", debian => "libapache2-mod-python",
ubuntu => "libapache2-mod-python", ubuntu => "libapache2-mod-python",
default => "mod_python", default => "mod_python",
@ -618,19 +618,19 @@ class apache::mod::python {
require => Package["httpd"], require => Package["httpd"],
} }
case $operatingsystem { case $::operatingsystem {
debian,ubuntu: { "debian","ubuntu": {
apache::debian::a2enmod { "python": apache::debian::a2enmod { "python":
require => Package ["libapache2-mod-python"], require => Package ["libapache2-mod-python"],
} }
} }
centos,fedora: { "centos","redhat","fedora": {
apache::configfile { "python.conf": apache::configfile { "python.conf":
require => Package["mod_python"], require => Package["mod_python"],
} }
} }
default: { default: {
fail("Apache module not supported in ${operatingsystem}.") fail("Apache module not supported in ${::operatingsystem}.")
} }
} }
@ -641,13 +641,13 @@ class apache::mod::python {
# #
class apache::mod::rewrite { class apache::mod::rewrite {
case $operatingsystem { case $::operatingsystem {
debian,ubuntu: { "debian","ubuntu": {
apache::debian::a2enmod { "rewrite": } apache::debian::a2enmod { "rewrite": }
} }
centos,fedora: { } "centos","redhat","fedora": { }
default: { default: {
fail("Apache module not supported in ${operatingsystem}.") fail("Apache module not supported in ${::operatingsystem}.")
} }
} }
@ -659,7 +659,7 @@ class apache::mod::rewrite {
class apache::mod::wsgi { class apache::mod::wsgi {
package { "mod_wsgi": package { "mod_wsgi":
name => $operatingsystem ? { name => $::operatingsystem ? {
debian => "libapache2-mod-wsgi", debian => "libapache2-mod-wsgi",
ubuntu => "libapache2-mod-wsgi", ubuntu => "libapache2-mod-wsgi",
default => "mod_wsgi", default => "mod_wsgi",
@ -668,19 +668,19 @@ class apache::mod::wsgi {
require => Package["httpd"], require => Package["httpd"],
} }
case $operatingsystem { case $::operatingsystem {
debian,ubuntu: { "debian","ubuntu": {
apache::debian::a2enmod { "wsgi": apache::debian::a2enmod { "wsgi":
require => Package ["libapache2-mod-wsgi"], require => Package ["libapache2-mod-wsgi"],
} }
} }
centos,fedora: { "centos","redhat","fedora": {
apache::configfile { "wsgi.conf": apache::configfile { "wsgi.conf":
require => Package["mod_wsgi"], require => Package["mod_wsgi"],
} }
} }
default: { default: {
fail("Apache module not supported in ${operatingsystem}.") fail("Apache module not supported in ${::operatingsystem}.")
} }
} }
@ -704,7 +704,7 @@ class apache::webalizer {
"/srv/www/webalizer/html", ]: "/srv/www/webalizer/html", ]:
ensure => directory, ensure => directory,
mode => "0755", mode => "0755",
owner => $operatingsystem ? { owner => $::operatingsystem ? {
debian => root, debian => root,
ubuntu => root, ubuntu => root,
default => webalizer, default => webalizer,
@ -729,7 +729,7 @@ class apache::webalizer {
source => "puppet:///modules/custom/empty", source => "puppet:///modules/custom/empty",
} }
case $operatingsystem { case $::operatingsystem {
debian,ubuntu: { debian,ubuntu: {
file { "/etc/cron.daily/webalizer": file { "/etc/cron.daily/webalizer":
ensure => absent, ensure => absent,
@ -757,7 +757,7 @@ class apache::webalizer {
ensure => present, ensure => present,
environment => "MAILTO=root", environment => "MAILTO=root",
command => "/usr/local/sbin/www-webalizer.sh", command => "/usr/local/sbin/www-webalizer.sh",
user => $operatingsystem ? { user => $::operatingsystem ? {
debian => root, debian => root,
ubuntu => root, ubuntu => root,
default => webalizer, default => webalizer,
@ -788,7 +788,7 @@ define apache::webalizer::site($site_proto, $site_fqdn) {
"/srv/www/webalizer/html/${name}", ]: "/srv/www/webalizer/html/${name}", ]:
ensure => directory, ensure => directory,
mode => "0755", mode => "0755",
owner => $operatingsystem ? { owner => $::operatingsystem ? {
debian => root, debian => root,
ubuntu => root, ubuntu => root,
default => webalizer, default => webalizer,

View file

@ -158,7 +158,7 @@ class apache::redhat::sslserver {
notify => Service["httpsd"], notify => Service["httpsd"],
} }
case $operatingsystem { case $::operatingsystem {
"fedora": { "fedora": {
file { "/lib/systemd/system/httpsd.service": file { "/lib/systemd/system/httpsd.service":
ensure => present, ensure => present,

View file

@ -193,7 +193,7 @@ LoadModule proxy_connect_module modules/mod_proxy_connect.so
LoadModule cache_module modules/mod_cache.so LoadModule cache_module modules/mod_cache.so
LoadModule suexec_module modules/mod_suexec.so LoadModule suexec_module modules/mod_suexec.so
LoadModule disk_cache_module modules/mod_disk_cache.so LoadModule disk_cache_module modules/mod_disk_cache.so
<% if operatingsystem == 'CentOS' and operatingsystemrelease =~ /^[1-5]\./ -%> <% if ['CentOS','RedHat'].index(operatingsystem) and operatingsystemrelease =~ /^[1-5]\./ -%>
LoadModule file_cache_module modules/mod_file_cache.so LoadModule file_cache_module modules/mod_file_cache.so
LoadModule mem_cache_module modules/mod_mem_cache.so LoadModule mem_cache_module modules/mod_mem_cache.so
<% end -%> <% end -%>

View file

@ -193,7 +193,7 @@ LoadModule proxy_connect_module modules/mod_proxy_connect.so
LoadModule cache_module modules/mod_cache.so LoadModule cache_module modules/mod_cache.so
LoadModule suexec_module modules/mod_suexec.so LoadModule suexec_module modules/mod_suexec.so
LoadModule disk_cache_module modules/mod_disk_cache.so LoadModule disk_cache_module modules/mod_disk_cache.so
<% if operatingsystem == 'CentOS' and operatingsystemrelease =~ /^[1-5]\./ -%> <% if ['CentOS','RedHat'].index(operatingsystem) and operatingsystemrelease =~ /^[1-5]\./ -%>
LoadModule file_cache_module modules/mod_file_cache.so LoadModule file_cache_module modules/mod_file_cache.so
LoadModule mem_cache_module modules/mod_mem_cache.so LoadModule mem_cache_module modules/mod_mem_cache.so
<% end -%> <% end -%>

View file

@ -3,7 +3,7 @@ LoadModule ssl_module modules/mod_ssl.so
</IfModule> </IfModule>
Listen 443 Listen 443
<% if operatingsystem == 'CentOS' or operatingsystem == 'Fedora' -%> <% if ['CentOS','RedHat'].index(operatingsystem) or operatingsystem == 'Fedora' -%>
## ##
## SSL Global Context ## SSL Global Context
## ##

View file

@ -173,8 +173,9 @@ class apt::mirror {
file { "/etc/apt/miror.list": file { "/etc/apt/miror.list":
ensure => present, ensure => present,
name => $operatingsystem ? { name => $::operatingsystem ? {
centos => "/etc/apt-mirror.list", centos => "/etc/apt-mirror.list",
redhat => "/etc/apt-mirror.list",
default => "/etc/apt/miror.list", default => "/etc/apt/miror.list",
}, },
content => template("apt/mirror.list.erb"), content => template("apt/mirror.list.erb"),

View file

@ -38,7 +38,7 @@ class backuppc::client {
backuppc::manualclient { $homename: backuppc::manualclient { $homename:
ensure => present, ensure => present,
operatingsystem => $operatingsystem, operatingsystem => $::operatingsystem,
} }
include rsync include rsync
@ -104,11 +104,24 @@ class backuppc::server {
require => Package["BackupPC"], require => Package["BackupPC"],
} }
if $operatingsystem == "CentOS" and $operatingsystemrelease >= 6 { case $::operatingsystem {
if "${selinux}" == "true" { "centos","redhat": {
selinux::manage_fcontext { "/etc/BackupPC(/.*)?": case $::operatingsystemrelease {
type => "httpd_sys_rw_content_t", /^[1-5]/: {
$backuppc_seltype = "httpd_sys_script_rw_t"
} }
default: {
$backuppc_seltype = "httpd_sys_rw_content_t"
if $::selinux == "true" {
selinux::manage_fcontext { "/etc/BackupPC(/.*)?":
type => $backuppc_seltype,
}
}
}
}
}
default: {
$backuppc_seltype = "httpd_sys_rw_content_t"
} }
} }
@ -117,13 +130,7 @@ class backuppc::server {
mode => "0640", mode => "0640",
owner => "root", owner => "root",
group => $apache::sslserver::group, group => $apache::sslserver::group,
seltype => $operatingsystem ? { seltype => $backuppc_seltype,
"centos" => $operatingsystemrelease ? {
/^5/ => "httpd_sys_script_rw_t",
default => "httpd_sys_rw_content_t",
},
default => "httpd_sys_rw_content_t",
},
require => Package["BackupPC"], require => Package["BackupPC"],
} }
@ -133,13 +140,7 @@ class backuppc::server {
mode => "0440", mode => "0440",
owner => "backuppc", owner => "backuppc",
group => "backuppc", group => "backuppc",
seltype => $operatingsystem ? { seltype => $backuppc_seltype,
"centos" => $operatingsystemrelease ? {
/^5/ => "httpd_sys_script_rw_t",
default => "httpd_sys_rw_content_t",
},
default => "httpd_sys_rw_content_t",
},
require => Package["BackupPC"], require => Package["BackupPC"],
notify => Service["backuppc"], notify => Service["backuppc"],
} }
@ -151,13 +152,7 @@ class backuppc::server {
mode => "0644", mode => "0644",
owner => "root", owner => "root",
group => "backuppc", group => "backuppc",
seltype => $operatingsystem ? { seltype => $backuppc_seltype,
"centos" => $operatingsystemrelease ? {
/^5/ => "httpd_sys_script_rw_t",
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"],
} }
@ -170,13 +165,7 @@ class backuppc::server {
mode => "0640", mode => "0640",
owner => "root", owner => "root",
group => "backuppc", group => "backuppc",
seltype => $operatingsystem ? { seltype => $backuppc_seltype,
"centos" => $operatingsystemrelease ? {
/^5/ => "httpd_sys_script_rw_t",
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"],
@ -191,13 +180,7 @@ class backuppc::server {
} }
File <<| tag == "backuppc" |>> { File <<| tag == "backuppc" |>> {
seltype => $operatingsystem ? { seltype => $backuppc_seltype,
"centos" => $operatingsystemrelease ? {
/^5/ => "httpd_sys_script_rw_t",
default => "httpd_sys_rw_content_t",
},
default => "httpd_sys_rw_content_t",
},
} }
service { "backuppc": service { "backuppc":

View file

@ -3,7 +3,7 @@
class cairo { class cairo {
package { "cairo": package { "cairo":
name => $operatingsystem ? { name => $::operatingsystem ? {
debian => "libcairo2", debian => "libcairo2",
ubuntu => "libcairo2", ubuntu => "libcairo2",
default => "cairo", default => "cairo",
@ -19,7 +19,7 @@ class cairo {
class cairo::python inherits cairo { class cairo::python inherits cairo {
package { "pycairo": package { "pycairo":
name => $operatingsystem ? { name => $::operatingsystem ? {
debian => "python-cairo", debian => "python-cairo",
ubuntu => "python-cairo", ubuntu => "python-cairo",
default => "pycairo", default => "pycairo",

View file

@ -12,17 +12,17 @@ class cups::client {
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",
default => "sh -c '. /etc/rc.d/cupsd check ; rc_pre'", default => "sh -c '. /etc/rc.d/cupsd check ; rc_pre'",
}, },

View file

@ -5,7 +5,7 @@ class custom {
ensure => directory, ensure => directory,
mode => "0755", mode => "0755",
owner => root, owner => root,
group => $operatingsystem ? { group => $::operatingsystem ? {
OpenBSD => wheel, OpenBSD => wheel,
default => root, default => root,
}, },
@ -121,7 +121,7 @@ class custom::rootpassword {
fail("Root password hash not defined.") fail("Root password hash not defined.")
} }
case $operatingsystem { case $::operatingsystem {
openbsd: { openbsd: {
exec { "usermod -p \${SECRET} root": exec { "usermod -p \${SECRET} root":
environment => "SECRET=${root_password}", environment => "SECRET=${root_password}",

View file

@ -4,7 +4,7 @@
class dhcp::server::common { class dhcp::server::common {
case $::operatingsystem { case $::operatingsystem {
"centos": { "centos","redhat": {
case $::operatingsystemrelease { case $::operatingsystemrelease {
/[45]\.[0-9]/: { /[45]\.[0-9]/: {
$confdir = "/etc" $confdir = "/etc"
@ -26,7 +26,7 @@ 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",
@ -36,19 +36,19 @@ class dhcp::server::common {
} }
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,
@ -58,7 +58,7 @@ class dhcp::server::common {
before => Service["dhcpd"], before => Service["dhcpd"],
} }
if $operatingsystem == "OpenBSD" and $operatingsystemrelease !~ /4\.[1-8]/ { if $::operatingsystem == "OpenBSD" and $::operatingsystemrelease !~ /4\.[1-8]/ {
file { "/etc/rc.d/isc_dhcpd": file { "/etc/rc.d/isc_dhcpd":
ensure => present, ensure => present,
mode => "0555", mode => "0555",
@ -70,9 +70,9 @@ class dhcp::server::common {
} }
service { "dhcpd": service { "dhcpd":
name => $operatingsystem ? { name => $::operatingsystem ? {
Debian => "dhcp3-server", Debian => "dhcp3-server",
OpenBSD => $operatingsystemrelease ? { OpenBSD => $::operatingsystemrelease ? {
/4\.[1-8]/ => "isc-dhcpd", /4\.[1-8]/ => "isc-dhcpd",
default => "isc_dhcpd", default => "isc_dhcpd",
}, },
@ -81,7 +81,7 @@ class dhcp::server::common {
}, },
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,
}, },
@ -97,7 +97,7 @@ class dhcp::server::common {
if $dhcp_server_interface { if $dhcp_server_interface {
case $::operatingsystem { case $::operatingsystem {
"fedora","centos": { "fedora","centos","redhat": {
file { "/etc/sysconfig/dhcpd": file { "/etc/sysconfig/dhcpd":
ensure => present, ensure => present,
content => "DHCPDARGS=${dhcp_server_interface}\n", content => "DHCPDARGS=${dhcp_server_interface}\n",
@ -133,7 +133,7 @@ class dhcp::server inherits dhcp::server::common {
"puppet:///files/dhcp/dhcpd.conf", ], "puppet:///files/dhcp/dhcpd.conf", ],
mode => "0644", mode => "0644",
owner => root, owner => root,
group => $operatingsystem ? { group => $::operatingsystem ? {
openbsd => wheel, openbsd => wheel,
default => root, default => root,
}, },
@ -160,7 +160,7 @@ class dhcp::server::ldap inherits dhcp::server::common {
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,
}, },
@ -173,7 +173,7 @@ class dhcp::server::ldap inherits dhcp::server::common {
"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,
}, },
@ -219,7 +219,7 @@ define dhcp::relay ($interface, $server_addr) {
hasrestart => false, hasrestart => false,
hasstatus => false, hasstatus => false,
pattern => "/usr/sbin/dhcrelay -i ${interface} ${server_addr}", pattern => "/usr/sbin/dhcrelay -i ${interface} ${server_addr}",
start => $operatingsystem ? { start => $::operatingsystem ? {
OpenBSD => "/usr/sbin/dhcrelay -i ${interface} ${server_addr}", OpenBSD => "/usr/sbin/dhcrelay -i ${interface} ${server_addr}",
default => undef, default => undef,
} }

View file

@ -2,26 +2,42 @@
# #
class dns::server { class dns::server {
if $operatingsystem != "OpenBSD" { case $::operatingsystem {
package { "bind": "centos","redhat": {
name => $operatingsystem ? { case $::operatingsystemrelease {
"ubuntu" => "bind9", /^[1-5]/: {
"centos" => $operatingsystemrelease ? { $bind_package = [ "bind-chroot", "caching-nameserver" ]
/^5\..*/ => [ "bind-chroot", "caching-nameserver", ],
default => "bind-chroot",
},
default => "bind-chroot",
} }
default: {
$bind_package = "bind-chroot"
}
}
}
"debian","ubuntu": {
$bind_package = "bind9"
}
"openbsd": {
$bind_package = undef
}
default: {
$bind_package = "bind-chroot"
}
}
if $bind_package {
package { "bind":
ensure => installed,
name => $bind_package,
} }
} }
# first set per os paths # first set per os paths
case $operatingsystem { case $::operatingsystem {
"fedora": { "fedora": {
$confdir = "/etc/named" $confdir = "/etc/named"
} }
"centos": { "centos","redhat": {
case $operatingsystemrelease { case $::operatingsystemrelease {
/^5\..*/: { /^5\..*/: {
$chroot = "/var/named/chroot" $chroot = "/var/named/chroot"
} }
@ -53,7 +69,7 @@ class dns::server {
$chroot = "" $chroot = ""
} }
case $operatingsystem { case $::operatingsystem {
"ubuntu": { "ubuntu": {
$group = "bind" $group = "bind"
} }
@ -67,7 +83,7 @@ class dns::server {
mode => "0640", mode => "0640",
owner => "root", owner => "root",
group => $group, group => $group,
require => $operatingsystem ? { require => $::operatingsystem ? {
"openbsd" => undef, "openbsd" => undef,
default => Package["bind"], default => Package["bind"],
}, },
@ -92,18 +108,18 @@ class dns::server {
} }
service { "named": service { "named":
name => $operatingsystem ? { name => $::operatingsystem ? {
"ubuntu" => "bind9", "ubuntu" => "bind9",
default => "named", default => "named",
}, },
ensure => running, ensure => running,
enable => true, enable => true,
status => "/usr/sbin/rndc status", status => "/usr/sbin/rndc status",
stop => $operatingsystem ? { stop => $::operatingsystem ? {
"openbsd" => "pkill -u named", "openbsd" => "pkill -u named",
default => undef, default => undef,
}, },
start => $operatingsystem ? { start => $::operatingsystem ? {
"openbsd" => "/usr/sbin/named", "openbsd" => "/usr/sbin/named",
default => undef, default => undef,
}, },
@ -116,7 +132,7 @@ class dns::server {
mode => "0640", mode => "0640",
owner => "root", owner => "root",
group => $group, group => $group,
require => $operatingsystem ? { require => $::operatingsystem ? {
"openbsd" => undef, "openbsd" => undef,
default => Package["bind"], default => Package["bind"],
}, },
@ -127,7 +143,7 @@ class dns::server {
content => template("dns/generate-named-conf.sh.erb"), content => template("dns/generate-named-conf.sh.erb"),
mode => "0755", mode => "0755",
owner => "root", owner => "root",
group => $operatingsystem ? { group => $::operatingsystem ? {
"openbsd" => "wheel", "openbsd" => "wheel",
default => "root", default => "root",
}, },
@ -150,7 +166,7 @@ class dns::server {
mode => "0640", mode => "0640",
owner => "root", owner => "root",
group => $group, group => $group,
require => $operatingsystem ? { require => $::operatingsystem ? {
"openbsd" => undef, "openbsd" => undef,
default => Package["bind"], default => Package["bind"],
}, },
@ -165,7 +181,7 @@ class dns::server {
mode => "0640", mode => "0640",
owner => "root", owner => "root",
group => $group, group => $group,
require => $operatingsystem ? { require => $::operatingsystem ? {
"openbsd" => undef, "openbsd" => undef,
default => Package["bind"], default => Package["bind"],
}, },
@ -189,7 +205,7 @@ class dns::server::ldap inherits dns::server {
source => "puppet:///modules/dns/dnsdump.py", source => "puppet:///modules/dns/dnsdump.py",
mode => 0755, mode => 0755,
owner => root, owner => root,
group => $operatingsystem ? { group => $::operatingsystem ? {
OpenBSD => wheel, OpenBSD => wheel,
default => root, default => root,
}, },
@ -250,11 +266,11 @@ define dns::zone($role = "master", $master = "", $slaves = [], $forwarders = [],
case $role { case $role {
"master": { "master": {
case $operatingsystem { case $::operatingsystem {
"openbsd": { "openbsd": {
$zonedir = "/master/${view}" $zonedir = "/master/${view}"
} }
"fedora","centos": { "fedora","centos","redhat": {
$zonedir = "/var/named/${view}" $zonedir = "/var/named/${view}"
} }
"ubuntu": { "ubuntu": {
@ -266,11 +282,11 @@ define dns::zone($role = "master", $master = "", $slaves = [], $forwarders = [],
if $key == "none" { if $key == "none" {
fail("No key defined for dns::zone '${name}'") fail("No key defined for dns::zone '${name}'")
} }
case $operatingsystem { case $::operatingsystem {
"openbsd": { "openbsd": {
$zonedir = "/dynamic/${view}" $zonedir = "/dynamic/${view}"
} }
"fedora","centos": { "fedora","centos","redhat": {
$zonedir = "/var/named/dynamic/${view}" $zonedir = "/var/named/dynamic/${view}"
} }
"ubuntu": { "ubuntu": {
@ -282,11 +298,11 @@ define dns::zone($role = "master", $master = "", $slaves = [], $forwarders = [],
if $master == "" { if $master == "" {
fail("No master defined for dns::zone '${name}'") fail("No master defined for dns::zone '${name}'")
} }
case $operatingsystem { case $::operatingsystem {
"openbsd": { "openbsd": {
$zonedir = "/slave/${view}" $zonedir = "/slave/${view}"
} }
"fedora","centos": { "fedora","centos","redhat": {
$zonedir = "/var/named/slaves/${view}" $zonedir = "/var/named/slaves/${view}"
} }
"ubuntu": { "ubuntu": {
@ -341,7 +357,7 @@ define dns::zone($role = "master", $master = "", $slaves = [], $forwarders = [],
mode => "0640", mode => "0640",
owner => "root", owner => "root",
group => $dns::server::group, group => $dns::server::group,
require => $operatingsystem ? { require => $::operatingsystem ? {
"openbsd" => undef, "openbsd" => undef,
default => Package["bind"], default => Package["bind"],
}, },
@ -356,7 +372,7 @@ define dns::zone($role = "master", $master = "", $slaves = [], $forwarders = [],
mode => "0640", mode => "0640",
owner => "root", owner => "root",
group => $dns::server::group, group => $dns::server::group,
require => $operatingsystem ? { require => $::operatingsystem ? {
"openbsd" => undef, "openbsd" => undef,
default => Package["bind"], default => Package["bind"],
}, },
@ -369,7 +385,7 @@ define dns::zone($role = "master", $master = "", $slaves = [], $forwarders = [],
mode => "0640", mode => "0640",
owner => "root", owner => "root",
group => $dns::server::group, group => $dns::server::group,
require => $operatingsystem ? { require => $::operatingsystem ? {
"openbsd" => undef, "openbsd" => undef,
default => Package["bind"], default => Package["bind"],
}, },
@ -384,7 +400,7 @@ define dns::zone($role = "master", $master = "", $slaves = [], $forwarders = [],
mode => "0640", mode => "0640",
owner => "root", owner => "root",
group => $dns::server::group, group => $dns::server::group,
require => $operatingsystem ? { require => $::operatingsystem ? {
"openbsd" => undef, "openbsd" => undef,
default => Package["bind"], default => Package["bind"],
}, },
@ -399,7 +415,7 @@ define dns::zone($role = "master", $master = "", $slaves = [], $forwarders = [],
mode => "0640", mode => "0640",
owner => "root", owner => "root",
group => $dns::server::group, group => $dns::server::group,
require => $operatingsystem ? { require => $::operatingsystem ? {
"openbsd" => undef, "openbsd" => undef,
default => Package["bind"], default => Package["bind"],
}, },
@ -438,7 +454,7 @@ class dns::nsupdate {
content => template("dns/nsupdate.sh.erb"), content => template("dns/nsupdate.sh.erb"),
mode => "0700", mode => "0700",
owner => root, owner => root,
group => $operatingsystem ? { group => $::operatingsystem ? {
openbsd => wheel, openbsd => wheel,
default => root, default => root,
}, },

View file

@ -1,13 +1,13 @@
class dovecot::common { class dovecot::common {
case $operatingsystem { case $::operatingsystem {
centos,fedora: { "centos","redhat","fedora": {
package { ["dovecot"]: package { ["dovecot"]:
ensure => installed, ensure => installed,
} }
} }
default: { default: {
fail("Dovecot module not supported in ${operatingsystem}.") fail("Dovecot module not supported in ${::operatingsystem}.")
} }
} }
} }
@ -27,12 +27,12 @@ class dovecot::common {
class dovecot::server inherits dovecot::common { class dovecot::server inherits dovecot::common {
case $operatingsystem { case $::operatingsystem {
centos,fedora: { "centos","redhat","fedora": {
$dovecot_ssl_dir = "/etc/pki/tls" $dovecot_ssl_dir = "/etc/pki/tls"
} }
default: { default: {
fail("Dovecot module not supported in ${operatingsystem}.") fail("Dovecot module not supported in ${::operatingsystem}.")
} }
} }

View file

@ -69,11 +69,11 @@ class ejabberd {
status => "ejabberdctl status >/dev/null", status => "ejabberdctl status >/dev/null",
} }
case $operatingsystem { case $::operatingsystem {
"debian","ubuntu": { "debian","ubuntu": {
$cert_prefix = "/etc/ssl" $cert_prefix = "/etc/ssl"
} }
"centos", "fedora": { "centos","redhat","fedora": {
$cert_prefix = "/etc/pki/tls" $cert_prefix = "/etc/pki/tls"
} }
} }
@ -137,7 +137,7 @@ class ejabberd {
notify => Service["ejabberd"], notify => Service["ejabberd"],
} }
case $operatingsystem { case $::operatingsystem {
"debian", "ubuntu": { "debian", "ubuntu": {
augeas { "set-ejabberd-default": augeas { "set-ejabberd-default":
context => "/files/etc/default/ejabberd", context => "/files/etc/default/ejabberd",
@ -206,8 +206,8 @@ class ejabberd::collab inherits ejabberd {
require => [ User["ejabberd"], Group["collab"] ], require => [ User["ejabberd"], Group["collab"] ],
} }
case $operatingsystem { case $::operatingsystem {
"centos", "fedora": { "centos","redhat","fedora": {
package { ["erlang", "erlang-esasl"]: package { ["erlang", "erlang-esasl"]:
ensure => installed, ensure => installed,
before => Package["ejabberd"], before => Package["ejabberd"],
@ -229,8 +229,9 @@ class ejabberd::collab inherits ejabberd {
before => Package["ejabberd"], before => Package["ejabberd"],
} }
Package["ejabberd"] { Package["ejabberd"] {
provider => $operatingsystem ? { provider => $::operatingsystem ? {
"centos" => "rpm", "centos" => "rpm",
"redhat" => "rpm",
"fedora" => "rpm", "fedora" => "rpm",
"debian" => "dpkg", "debian" => "dpkg",
"ubuntu" => "dpkg", "ubuntu" => "dpkg",

View file

@ -26,15 +26,15 @@ class firewall {
$firewall_rules = [] $firewall_rules = []
} }
case $operatingsystem { case $::operatingsystem {
centos,debian,fedora,ubuntu: { "centos","redhat","debian","fedora","ubuntu": {
include firewall::iptables include firewall::iptables
} }
openbsd: { "openbsd": {
include firewall::pf include firewall::pf
} }
default: { default: {
fail("Firewall module not supported in ${operatingsystem}") fail("Firewall module not supported in ${::operatingsystem}")
} }
} }
@ -53,15 +53,15 @@ class firewall {
# #
class firewall::custom { class firewall::custom {
case $operatingsystem { case $::operatingsystem {
centos,debian,fedora,ubuntu: { "centos","redhat","debian","fedora","ubuntu": {
include firewall::custom::iptables include firewall::custom::iptables
} }
openbsd: { openbsd: {
include firewall::custom::pf include firewall::custom::pf
} }
default: { default: {
fail("Firewall module not supported in ${operatingsystem}") fail("Firewall module not supported in ${::operatingsystem}")
} }
} }
@ -73,10 +73,11 @@ class firewall::custom {
class firewall::common::iptables { class firewall::common::iptables {
package { "iptables": package { "iptables":
name => $operatingsystem ? { name => $::operatingsystem ? {
centos => [ "iptables", "iptables-ipv6" ], centos => [ "iptables", "iptables-ipv6" ],
redhat => [ "iptables", "iptables-ipv6" ],
debian => [ "iptables", "iptables-persistent" ], debian => [ "iptables", "iptables-persistent" ],
fedora => $operatingsystemrelease ? { fedora => $::operatingsystemrelease ? {
/^1[0-5]/ => [ "iptables", "iptables-ipv6" ], /^1[0-5]/ => [ "iptables", "iptables-ipv6" ],
default => "iptables", default => "iptables",
}, },
@ -85,7 +86,7 @@ class firewall::common::iptables {
} }
file { "/etc/sysconfig/iptables": file { "/etc/sysconfig/iptables":
name => $operatingsystem ? { name => $::operatingsystem ? {
debian => "/etc/iptables/rules", debian => "/etc/iptables/rules",
ubuntu => "/etc/iptables/rules", ubuntu => "/etc/iptables/rules",
default => "/etc/sysconfig/iptables", default => "/etc/sysconfig/iptables",
@ -98,8 +99,8 @@ class firewall::common::iptables {
notify => Service["iptables"], notify => Service["iptables"],
} }
case $operatingsystem { case $::operatingsystem {
centos,fedora: { "centos","redhat","fedora": {
$ip6states = versioncmp($kernelversion, "2.6.20") $ip6states = versioncmp($kernelversion, "2.6.20")
file { "/etc/sysconfig/ip6tables": file { "/etc/sysconfig/ip6tables":
ensure => present, ensure => present,
@ -120,15 +121,16 @@ class firewall::common::iptables {
} }
service { "iptables": service { "iptables":
name => $operatingsystem ? { name => $::operatingsystem ? {
debian => "iptables-persistent", debian => "iptables-persistent",
ubuntu => "iptables-persistent", ubuntu => "iptables-persistent",
default => "iptables", default => "iptables",
}, },
ensure => running, ensure => running,
enable => true, enable => true,
hasrestart => $operatingsystem ? { hasrestart => $::operatingsystem ? {
centos => true, centos => true,
redhat => true,
debian => false, debian => false,
fedora => true, fedora => true,
ubuntu => false, ubuntu => false,
@ -148,8 +150,8 @@ class firewall::iptables inherits firewall::common::iptables {
content => template("firewall/iptables.erb"), content => template("firewall/iptables.erb"),
} }
case $operatingsystem { case $::operatingsystem {
centos,fedora: { "centos","redhat","fedora": {
File["/etc/sysconfig/ip6tables"] { File["/etc/sysconfig/ip6tables"] {
content => template("firewall/ip6tables.erb"), content => template("firewall/ip6tables.erb"),
} }

View file

@ -4,7 +4,7 @@
class git::client { class git::client {
package { "git": package { "git":
name => $operatingsystem ? { name => $::operatingsystem ? {
"ubuntu" => "git-core", "ubuntu" => "git-core",
default => "git", default => "git",
}, },
@ -79,8 +79,8 @@ class git::daemon inherits git::server {
Package["git-daemon"] ], Package["git-daemon"] ],
} }
case $operatingsystem { case $::operatingsystem {
"centos","fedora": { "centos","redhat","fedora": {
file { "/var/lib/git": file { "/var/lib/git":
ensure => link, ensure => link,
force => true, force => true,

View file

@ -4,7 +4,7 @@ class gnu::make {
package { "make": package { "make":
ensure => installed, ensure => installed,
name => $operatingsystem ? { name => $::operatingsystem ? {
"openbsd" => "gmake", "openbsd" => "gmake",
default => "make", default => "make",
}, },
@ -19,7 +19,7 @@ class gnu::tar {
package { "tar": package { "tar":
ensure => installed, ensure => installed,
name => $operatingsystem ? { name => $::operatingsystem ? {
"openbsd" => "gtar", "openbsd" => "gtar",
default => "tar", default => "tar",
}, },

View file

@ -2,12 +2,12 @@
# #
class google::common { class google::common {
case $operatingsystem { case $::operatingsystem {
"centos","fedora": { "centos","redhat","fedora": {
include yum::repo::google include yum::repo::google
} }
default: { default: {
fail("Google products via puppet not supported on ${operatingsystem}") fail("Google products via puppet not supported on ${::operatingsystem}")
} }
} }

View file

@ -13,7 +13,7 @@ class graphviz {
class graphviz::python inherits graphviz { class graphviz::python inherits graphviz {
package { "graphviz-python": package { "graphviz-python":
name => $operatingsystem ? { name => $::operatingsystem ? {
debian => "libgv-python", debian => "libgv-python",
ubuntu => "libgv-python", ubuntu => "libgv-python",
default => "graphviz-python", default => "graphviz-python",

View file

@ -3,7 +3,7 @@
class ia32libs { class ia32libs {
if $architecture == "x86_64" { if $architecture == "x86_64" {
case $operatingsystem { case $::operatingsystem {
ubuntu: { ubuntu: {
package { "ia32-libs": package { "ia32-libs":
ensure => installed, ensure => installed,

View file

@ -2,7 +2,7 @@
# #
class igraph::python { class igraph::python {
case $operatingsystem { case $::operatingsystem {
ubuntu: { ubuntu: {
package { "python-igraph": package { "python-igraph":
ensure => installed, ensure => installed,

View file

@ -6,7 +6,7 @@
class inetd::server { class inetd::server {
case $::operatingsystem { case $::operatingsystem {
"centos","fedora","ubuntu","debian": { "centos","redhat","fedora","ubuntu","debian": {
include inetd::server::xinetd include inetd::server::xinetd
} }
"openbsd": { "openbsd": {
@ -77,7 +77,7 @@ define inetd::service($ensure = present) {
include inetd::server include inetd::server
case $::operatingsystem { case $::operatingsystem {
"centos","ubuntu","debian": { "centos","redhat","ubuntu","debian": {
service { $name: service { $name:
enable => $ensure ? { enable => $ensure ? {
present => true, present => true,

View file

@ -19,7 +19,7 @@
class kerberos::client { class kerberos::client {
case $::operatingsystem { case $::operatingsystem {
"centos","fedora": { "centos","redhat","fedora": {
package { "krb5-workstation": package { "krb5-workstation":
ensure => installed, ensure => installed,
} }
@ -71,7 +71,7 @@ class kerberos::auth {
$kdclist = inline_template('<%= kerberos_kdc.join(" ") -%>') $kdclist = inline_template('<%= kerberos_kdc.join(" ") -%>')
case $::operatingsystem { case $::operatingsystem {
"centos","fedora": { "centos","redhat","fedora": {
package { "pam_krb5": package { "pam_krb5":
ensure => installed, ensure => installed,
} }

View file

@ -18,9 +18,9 @@ class ldap::auth inherits ldap::client {
$ldap_uri = inline_template('<%= ldap_server.join(" ") -%>') $ldap_uri = inline_template('<%= ldap_server.join(" ") -%>')
case $operatingsystem { case $::operatingsystem {
CentOS: { "centos","redhat": {
case $operatingsystemrelease { case $::operatingsystemrelease {
/^6/: { /^6/: {
package { "nss-pam-ldapd": package { "nss-pam-ldapd":
ensure => installed, ensure => installed,
@ -220,7 +220,7 @@ class ldap::auth inherits ldap::client {
} }
} }
default: { default: {
fail("ldap::auth not supported on ${operatingsystem}") fail("ldap::auth not supported on ${::operatingsystem}")
} }
} }
@ -239,13 +239,13 @@ class ldap::auth inherits ldap::client {
class ldap::client { class ldap::client {
package { "openldap-client": package { "openldap-client":
name => $operatingsystem ? { name => $::operatingsystem ? {
"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,
default => installed, default => installed,
}, },
@ -254,14 +254,14 @@ class ldap::client {
file { "/etc/openldap/ldap.conf": file { "/etc/openldap/ldap.conf":
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,
@ -277,7 +277,7 @@ class ldap::client {
class ldap::client::python { class ldap::client::python {
package { "python-ldap": package { "python-ldap":
name => $operatingsystem ? { name => $::operatingsystem ? {
openbsd => "py-ldap", openbsd => "py-ldap",
default => "python-ldap", default => "python-ldap",
}, },
@ -304,7 +304,7 @@ class ldap::client::python {
# #
class ldap::client::ruby { class ldap::client::ruby {
case $operatingsystem { case $::operatingsystem {
"ubuntu","debian": { "ubuntu","debian": {
$pkgname = regsubst($rubyversion, '^([0-9]+\.[0-9]+)\..*', 'libldap-ruby\1') $pkgname = regsubst($rubyversion, '^([0-9]+\.[0-9]+)\..*', 'libldap-ruby\1')
} }
@ -349,7 +349,7 @@ class ldap::server {
$ldap_server_cert = "${puppet_ssldir}/certs/${homename}.pem" $ldap_server_cert = "${puppet_ssldir}/certs/${homename}.pem"
} }
case $operatingsystem { case $::operatingsystem {
"debian","ubuntu": { "debian","ubuntu": {
$user = "openldap" $user = "openldap"
$group = "openldap" $group = "openldap"
@ -369,14 +369,14 @@ class ldap::server {
default => "/usr/lib/openldap", default => "/usr/lib/openldap",
} }
} }
"centos": { "centos","redhat": {
$user = "ldap" $user = "ldap"
$group = "ldap" $group = "ldap"
$package_name = $operatingsystemrelease ? { $package_name = $::operatingsystemrelease ? {
/^5/ => [ "openldap-servers", "openldap-servers-overlays" ], /^5/ => [ "openldap-servers", "openldap-servers-overlays" ],
/^6/ => "openldap-servers", /^6/ => "openldap-servers",
} }
$service_name = $operatingsystemrelease ? { $service_name = $::operatingsystemrelease ? {
/^5/ => "ldap", /^5/ => "ldap",
/^6/ => "slapd", /^6/ => "slapd",
} }
@ -406,7 +406,7 @@ class ldap::server {
source => $ldap_server_cert, source => $ldap_server_cert,
mode => "0644", mode => "0644",
owner => "root", owner => "root",
group => $operatingsystem ? { group => $::operatingsystem ? {
"openbsd" => "wheel", "openbsd" => "wheel",
default => "root", default => "root",
}, },
@ -446,7 +446,7 @@ class ldap::server {
notify => Exec["generate-slapd-database-config"], notify => Exec["generate-slapd-database-config"],
} }
if $operatingsystem == "CentOS" and $operatinsystemrelease !~ /^5\./ { if $::operatingsystem in ["CentOS","RedHat"] and $operatinsystemrelease !~ /^5\./ {
file { "/etc/sysconfig/ldap": file { "/etc/sysconfig/ldap":
ensure => present, ensure => present,
source => "puppet:///modules/ldap/ldap.sysconfig", source => "puppet:///modules/ldap/ldap.sysconfig",
@ -460,7 +460,7 @@ class ldap::server {
service { "slapd": service { "slapd":
name => $service_name, name => $service_name,
start => $operatingsystem ? { start => $::operatingsystem ? {
"openbsd" => "/usr/local/libexec/slapd -u _openldap -h ldap:///\\ ldaps:///\\ ldapi:///", "openbsd" => "/usr/local/libexec/slapd -u _openldap -h ldap:///\\ ldaps:///\\ ldapi:///",
default => undef, default => undef,
}, },
@ -513,7 +513,7 @@ class ldap::server {
source => "puppet:///modules/custom/empty", source => "puppet:///modules/custom/empty",
mode => "0644", mode => "0644",
owner => "root", owner => "root",
group => $operatingsystem ? { group => $::operatingsystem ? {
"openbsd" => "wheel", "openbsd" => "wheel",
default => "root", default => "root",
}, },
@ -641,7 +641,7 @@ define ldap::server::database($aclsource = "", $master = "", $syncpw = "", $modu
"puppet:///modules/ldap/DB_CONFIG", ], "puppet:///modules/ldap/DB_CONFIG", ],
mode => "0644", mode => "0644",
owner => "root", owner => "root",
group => $operatingsystem ? { group => $::operatingsystem ? {
"openbsd" => "wheel", "openbsd" => "wheel",
default => "root", default => "root",
}, },
@ -678,7 +678,7 @@ define ldap::server::schema($idx = 50) {
"puppet:///modules/ldap/${name}.schema", ], "puppet:///modules/ldap/${name}.schema", ],
mode => "0644", mode => "0644",
owner => "root", owner => "root",
group => $operatingsystem ? { group => $::operatingsystem ? {
"openbsd" => "wheel", "openbsd" => "wheel",
default => "root", default => "root",
}, },

View file

@ -13,15 +13,15 @@ class libvirt::client {
require => [ User["qemu"], Group["qemu"], ], require => [ User["qemu"], Group["qemu"], ],
} }
case $operatingsystem { case $::operatingsystem {
centos,fedora: { "centos","redhat","fedora": {
package { [ "libvirt", "virt-manager", "virt-viewer", ]: package { [ "libvirt", "virt-manager", "virt-viewer", ]:
ensure => installed, ensure => installed,
require => File["/var/lib/qemu"], require => File["/var/lib/qemu"],
} }
} }
default: { default: {
fail("Not supported on ${operatingsystem}.") fail("Not supported on ${::operatingsystem}.")
} }
} }
@ -37,10 +37,10 @@ class libvirt::client {
# #
class libvirt::kvm inherits libvirt::client { class libvirt::kvm inherits libvirt::client {
case $operatingsystem { case $::operatingsystem {
centos,fedora: { "centos","redhat": {
case $operatingsystemrelease { case $::operatingsystemrelease {
/5\..*/: { /^5\./: {
package { ["kvm", "kmod-kvm"]: package { ["kvm", "kmod-kvm"]:
ensure => installed, ensure => installed,
before => Service["libvirtd"], before => Service["libvirtd"],
@ -59,6 +59,16 @@ class libvirt::kvm inherits libvirt::client {
} }
} }
} }
"fedora": {
package { "qemu-kvm":
ensure => installed,
before => Service["libvirtd"],
require => [ User["qemu"], Group["qemu"] ],
}
package { "ruby-libvirt":
ensure => installed,
}
}
default: { default: {
fail("Operating system not supported") fail("Operating system not supported")
} }

View file

@ -12,9 +12,9 @@ class lynx {
$www_default_url = "http://www.${domain}" $www_default_url = "http://www.${domain}"
} }
if $operatingsystem != "OpenBSD" { if $::operatingsystem != "OpenBSD" {
package { "lynx": package { "lynx":
name => $operatingsystem ? { name => $::operatingsystem ? {
"ubuntu" => "lynx-cur", "ubuntu" => "lynx-cur",
default => "lynx", default => "lynx",
}, },
@ -22,7 +22,7 @@ class lynx {
} }
} }
if $operatingsystem == "OpenBSD" { if $::operatingsystem == "OpenBSD" {
exec { "add-local-lynx-config": exec { "add-local-lynx-config":
command => "echo 'INCLUDE:/etc/lynx-site.cfg' >> /etc/lynx.cfg", command => "echo 'INCLUDE:/etc/lynx-site.cfg' >> /etc/lynx.cfg",
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",
@ -32,7 +32,7 @@ class lynx {
} }
file { "lynx-site.cfg": file { "lynx-site.cfg":
name => $operatingsystem ? { name => $::operatingsystem ? {
"ubuntu" => "/etc/lynx-cur/local.cfg", "ubuntu" => "/etc/lynx-cur/local.cfg",
default => "/etc/lynx-site.cfg", default => "/etc/lynx-site.cfg",
}, },
@ -40,11 +40,11 @@ class lynx {
content => template("lynx/lynx-site.cfg.erb"), content => template("lynx/lynx-site.cfg.erb"),
mode => 0644, mode => 0644,
owner => "root", owner => "root",
group => $operatingsystem ? { group => $::operatingsystem ? {
"openbsd" => "wheel", "openbsd" => "wheel",
default => "root", default => "root",
}, },
require => $operatingsystem ? { require => $::operatingsystem ? {
"openbsd" => undef, "openbsd" => undef,
default => Package["lynx"], default => Package["lynx"],
}, },

View file

@ -1,29 +1,40 @@
# Install Ruby Mongrel packages. # Install Ruby Mongrel packages.
# #
class mongrel { class mongrel {
require ruby::rubygems require ruby::rubygems
case $::operatingsystem {
"centos","redhat": {
case $::operatingsystemrelease {
/^[1-5]/: {
$mongrel_package = "rubygem-mongrel"
$mongrel_provider = undef
}
default: {
$mongrel_package = "mongrel"
$mongrel_provider = "gem"
}
}
}
"debian","ubuntu": {
$mongrel_package = "mongrel"
$mongrel_provider = undef
}
"openbsd": {
$mongrel_package = "ruby-mongrel"
$mongrel_provider = undef
}
default: {
$mongrel_package = "rubygem-mongrel"
$mongrel_provider = undef
}
}
package { "mongrel": package { "mongrel":
ensure => installed, ensure => installed,
name => $::operatingsystem ? { name => $mongrel_package,
openbsd => "ruby-mongrel", provider => $mongrel_provider,
debian => "mongrel",
ubuntu => "mongrel",
centos => $::operatingsystemrelease ? {
/^[1-5]/ => "rubygem-mongrel",
default => "mongrel",
},
default => "rubygem-mongrel",
},
provider => $::operatingsystem ? {
centos => $::operatingsystemrelease ? {
/^[1-5]/ => undef,
default => "gem",
},
default => undef,
},
} }
} }

View file

@ -8,8 +8,8 @@ class munin::node {
} }
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",
}, },
@ -18,14 +18,14 @@ class 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,
}, },
@ -35,7 +35,7 @@ class munin::node {
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",
}, },
@ -95,7 +95,7 @@ define munin::snmpnode($snmp_community="public", $snmp_version="2") {
ensure => present, ensure => present,
content => "[snmp_${name}_*]\nenv.community ${snmp_community}\nenv.version ${snmp_version}\n", content => "[snmp_${name}_*]\nenv.community ${snmp_community}\nenv.version ${snmp_version}\n",
owner => root, owner => root,
group => $operatingsystem ? { group => $::operatingsystem ? {
OpenBSD => wheel, OpenBSD => wheel,
default => root, default => root,
}, },
@ -129,7 +129,7 @@ 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,
@ -159,20 +159,20 @@ define munin::plugin($config = "") {
"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", mode => "0644",
notify => Service["munin-node"], notify => Service["munin-node"],
require => $operatingsystem ? { require => $::operatingsystem ? {
OpenBSD => File["/usr/local/libexec/munin/plugins/${name}"], OpenBSD => File["/usr/local/libexec/munin/plugins/${name}"],
default => File["/usr/share/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}",

View file

@ -12,7 +12,7 @@ class mutt {
$mail_domain = $domain $mail_domain = $domain
} }
case $operatingsystem { case $::operatingsystem {
openbsd: { $muttconfdir = "/etc/mutt/Muttrc" } openbsd: { $muttconfdir = "/etc/mutt/Muttrc" }
default: { $muttconfdir = "/etc" } default: { $muttconfdir = "/etc" }
} }
@ -31,7 +31,7 @@ class mutt {
content => template("mutt/Muttrc.local.erb"), content => template("mutt/Muttrc.local.erb"),
mode => "0644", mode => "0644",
owner => "root", owner => "root",
group => $operatingsystem ? { group => $::operatingsystem ? {
openbsd => "wheel", openbsd => "wheel",
default => "root", default => "root",
}, },

View file

@ -4,7 +4,7 @@ set use_8bitmime
set hostname=<%= mail_domain %> set hostname=<%= mail_domain %>
set imap_authenticators="gssapi:plain" set imap_authenticators="gssapi:plain"
<% if operatingsystem = "CentOS" and operatingsystemrelease =~ /^6\./-%> <% if ['CentOS','RedHat'].index(operatingsystem) and operatingsystemrelease =~ /^6\./-%>
set ssl_ca_certificates_file="/etc/pki/tls/certs/ca-bundle.crt" set ssl_ca_certificates_file="/etc/pki/tls/certs/ca-bundle.crt"
<% end -%> <% end -%>

View file

@ -66,7 +66,7 @@ class mysql::server {
} }
service { "mysqld": service { "mysqld":
name => $operatingsystem ? { name => $::operatingsystem ? {
"ubuntu" => "mysql", "ubuntu" => "mysql",
"debian" => "mysql", "debian" => "mysql",
default => "mysqld", default => "mysqld",
@ -113,7 +113,7 @@ class mysql::server {
content => "[client]\nuser=\"root\"\npassword=\"${mysql_root_password}\"\n", content => "[client]\nuser=\"root\"\npassword=\"${mysql_root_password}\"\n",
mode => "0600", mode => "0600",
owner => "root", owner => "root",
group => $operatingsystem ? { group => $::operatingsystem ? {
"openbsd" => "wheel", "openbsd" => "wheel",
default => "root", default => "root",
}, },

View file

@ -4,22 +4,22 @@
# This class is automatically included when needed. # This class is automatically included when needed.
# #
class network::helper::restart { class network::helper::restart {
case $operatingsystem { case $::operatingsystem {
centos,fedora: { "centos","redhat","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",
command => "cat interfaces.in interfaces.d/*.conf > interfaces && /etc/init.d/networking restart", command => "cat interfaces.in interfaces.d/*.conf > interfaces && /etc/init.d/networking restart",
@ -63,7 +63,7 @@ class network::hostname {
tag("bootstrap") tag("bootstrap")
case $operatingsystem { case $::operatingsystem {
"debian","ubuntu": { "debian","ubuntu": {
file { "/etc/hostname": file { "/etc/hostname":
ensure => present, ensure => present,
@ -73,7 +73,7 @@ class network::hostname {
group => "root", group => "root",
} }
} }
"centos","fedora": { "centos","redhat","fedora": {
augeas { "set-hostname": augeas { "set-hostname":
context => "/files/etc/sysconfig/network", context => "/files/etc/sysconfig/network",
changes => "set HOSTNAME ${homename}", changes => "set HOSTNAME ${homename}",
@ -89,7 +89,7 @@ class network::hostname {
} }
} }
default: { default: {
fail("network::hostname not supported on ${operatingsystem}") fail("network::hostname not supported on ${::operatingsystem}")
} }
} }
@ -156,8 +156,8 @@ 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"),
@ -167,7 +167,7 @@ define network::interface($ipaddr = "none", $eaddr = "none", $netmask = "none",
notify => Exec["restart-network"], notify => Exec["restart-network"],
} }
} }
centos,fedora: { "centos","redhat","fedora": {
if $bridge { if $bridge {
network::interface { $bridge: network::interface { $bridge:
options => [ "BRIDGE=${name}", "LINKDELAY=10" ], options => [ "BRIDGE=${name}", "LINKDELAY=10" ],
@ -190,7 +190,7 @@ define network::interface($ipaddr = "none", $eaddr = "none", $netmask = "none",
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":
ensure => present, ensure => present,
@ -212,7 +212,7 @@ 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}")
} }
} }
@ -236,8 +236,8 @@ define network::route($gateway = "", $device, $ipv6gateway = "") {
case $name { case $name {
"default": { "default": {
case $operatingsystem { case $::operatingsystem {
centos,fedora: { "centos","redhat","fedora": {
include network::helper::restart include network::helper::restart
if "${gateway}" != "" { if "${gateway}" != "" {
augeas { "set-default-route": augeas { "set-default-route":
@ -284,7 +284,7 @@ define network::route($gateway = "", $device, $ipv6gateway = "") {
} }
} }
default: { default: {
fail("Network module not supported in ${operatingsystem}") fail("Network module not supported in ${::operatingsystem}")
} }
} }
} }
@ -292,8 +292,8 @@ define network::route($gateway = "", $device, $ipv6gateway = "") {
if $ipv6gateway != "" { if $ipv6gateway != "" {
fail("Custom IPv6 routes not supported yet.") fail("Custom IPv6 routes not supported yet.")
} }
case $operatingsystem { case $::operatingsystem {
"fedora","centos": { "fedora","centos","redhat": {
include network::helper::restart include network::helper::restart
file { "/etc/sysconfig/network-scripts/route-${device}": file { "/etc/sysconfig/network-scripts/route-${device}":
ensure => present, ensure => present,
@ -305,7 +305,7 @@ define network::route($gateway = "", $device, $ipv6gateway = "") {
} }
} }
default: { default: {
fail("Custom routes not supported in ${operatingsystem}") fail("Custom routes not supported in ${::operatingsystem}")
} }
} }
} }
@ -338,8 +338,8 @@ 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,
@ -347,7 +347,7 @@ define network::carp($password, $ipaddr, $netmask, $options = []) {
postcmd => [ "/usr/sbin/ndp -i carp${name} -- -accept_rtadv" ], postcmd => [ "/usr/sbin/ndp -i carp${name} -- -accept_rtadv" ],
} }
} }
centos,fedora: { "centos","redhat","fedora": {
include network::ucarp include network::ucarp
file { "/etc/ucarp/vip-${name}.conf": file { "/etc/ucarp/vip-${name}.conf":
ensure => present, ensure => present,
@ -360,7 +360,7 @@ define network::carp($password, $ipaddr, $netmask, $options = []) {
} }
} }
default: { default: {
fail("Network module not supported in ${operatingsystem}") fail("Network module not supported in ${::operatingsystem}")
} }
} }
} }
@ -402,7 +402,7 @@ 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,
@ -414,7 +414,7 @@ define network::pppoe($username, $password, $device, $authtype = "pap") {
} }
} }
default: { default: {
fail("Network module not supported in ${operatingsystem}") fail("Network module not supported in ${::operatingsystem}")
} }
} }
@ -445,8 +445,8 @@ define network::pppoe($username, $password, $device, $authtype = "pap") {
# } # }
# #
define network::trunk($devices, $mode = 0, $ipaddr = "none", $netmask = "none", $options = []) { define network::trunk($devices, $mode = 0, $ipaddr = "none", $netmask = "none", $options = []) {
case $operatingsystem { case $::operatingsystem {
centos,fedora: { "centos","redhat","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",
@ -466,7 +466,7 @@ define network::trunk($devices, $mode = 0, $ipaddr = "none", $netmask = "none",
} }
} }
default: { default: {
fail("Network module not supported in ${operatingsystem}") fail("Network module not supported in ${::operatingsystem}")
} }
} }
} }
@ -477,8 +477,8 @@ define network::trunk($devices, $mode = 0, $ipaddr = "none", $netmask = "none",
# This class is automatically included when needed. # This class is automatically included when needed.
# #
class network::helper::vlan { class network::helper::vlan {
case $operatingsystem { case $::operatingsystem {
centos,fedora: { "centos","redhat","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",
@ -513,15 +513,15 @@ 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","redhat","fedora": {
include network::helper::vlan include network::helper::vlan
network::interface { "${device}.${name}": network::interface { "${device}.${name}":
ipaddr => $ipaddr, ipaddr => $ipaddr,
@ -531,7 +531,7 @@ define network::vlan($device, $ipaddr = "none", $netmask = "none",
} }
} }
default: { default: {
fail("Network module not supported in ${operatingsystem}") fail("Network module not supported in ${::operatingsystem}")
} }
} }
} }
@ -541,7 +541,7 @@ define network::vlan($device, $ipaddr = "none", $netmask = "none",
# #
class network::manager::disable { class network::manager::disable {
case $operatingsystem { case $::operatingsystem {
ubuntu: { ubuntu: {
file { "/etc/init/network-manager.conf": file { "/etc/init/network-manager.conf":
ensure => present, ensure => present,
@ -557,7 +557,7 @@ class network::manager::disable {
} }
service { "network-manager": service { "network-manager":
name => $operatingsystem ? { name => $::operatingsystem ? {
ubuntu => "network-manager", ubuntu => "network-manager",
default => "NetworkManager", default => "NetworkManager",
}, },

View file

@ -2,7 +2,7 @@
# #
class nginx { class nginx {
case $operatingsystem { case $::operatingsystem {
"openbsd": { "openbsd": {
$user = "_nginx" $user = "_nginx"
$group = "_nginx" $group = "_nginx"
@ -27,7 +27,7 @@ class nginx {
ensure => present, ensure => present,
mode => "0644", mode => "0644",
owner => "root", owner => "root",
group => $operatingsystem ? { group => $::operatingsystem ? {
"openbsd" => "wheel", "openbsd" => "wheel",
default => "root", default => "root",
}, },
@ -40,7 +40,7 @@ class nginx {
ensure => directory, ensure => directory,
mode => "0644", mode => "0644",
owner => "root", owner => "root",
group => $operatingsystem ? { group => $::operatingsystem ? {
"openbsd" => "wheel", "openbsd" => "wheel",
default => "root", default => "root",
}, },
@ -58,7 +58,7 @@ class nginx {
# #
class nginx::passenger inherits nginx { class nginx::passenger inherits nginx {
case $operatingsystem { case $::operatingsystem {
"openbsd": { "openbsd": {
Package["nginx"] { Package["nginx"] {
flavor => "passenger", flavor => "passenger",
@ -68,7 +68,7 @@ class nginx::passenger inherits nginx {
} }
} }
default: { default: {
fail("Not supported on ${operatingsystem}") fail("Not supported on ${::operatingsystem}")
} }
} }
@ -83,7 +83,7 @@ define nginx::configfile($source="", $content="") {
ensure => present, ensure => present,
mode => "0644", mode => "0644",
owner => "root", owner => "root",
group => $operatingsystem ? { group => $::operatingsystem ? {
"openbsd" => "wheel", "openbsd" => "wheel",
default => "root", default => "root",
}, },

View file

@ -3,7 +3,7 @@
class nodejs { class nodejs {
case $::operatingsystem { case $::operatingsystem {
"centos": { "centos","redhat": {
yum::repo { "nodejs": yum::repo { "nodejs":
mirrorlist => "http://nodejs.tchol.org/mirrors/nodejs-stable-el\$releasever", mirrorlist => "http://nodejs.tchol.org/mirrors/nodejs-stable-el\$releasever",
gpgkey => "http://nodejs.tchol.org/stable/RPM-GPG-KEY-tchol", gpgkey => "http://nodejs.tchol.org/stable/RPM-GPG-KEY-tchol",

View file

@ -15,9 +15,9 @@ class ntpd {
$ntp_server = ["pool.ntp.org"] $ntp_server = ["pool.ntp.org"]
} }
case $operatingsystem { case $::operatingsystem {
"fedora": { "fedora": {
case $operatingsystemrelease { case $::operatingsystemrelease {
/^1[0-5]/: { /^1[0-5]/: {
include ntpd::isc-ntpd include ntpd::isc-ntpd
} }
@ -34,8 +34,8 @@ class ntpd {
} }
} }
case $operatingsystem { case $::operatingsystem {
"centos","fedora": { "centos","redhat","fedora": {
augeas { "disable-peerntp": augeas { "disable-peerntp":
context => "/files/etc/sysconfig/network", context => "/files/etc/sysconfig/network",
changes => "set PEERNTP no", changes => "set PEERNTP no",
@ -93,7 +93,7 @@ class ntpd::isc-ntpd {
service { "ntpd": service { "ntpd":
ensure => running, ensure => running,
enable => true, enable => true,
name => $operatingsystem ? { name => $::operatingsystem ? {
ubuntu => "ntp", ubuntu => "ntp",
debian => "ntp", debian => "ntp",
default => "ntpd", default => "ntpd",

View file

@ -3,7 +3,7 @@
# #
class pam::common { class pam::common {
case $operatingsystem { case $::operatingsystem {
"ubuntu": { "ubuntu": {
package { "libpam-runtime": package { "libpam-runtime":
ensure => installed, ensure => installed,
@ -25,8 +25,8 @@ class pam::mkhomedir {
include pam::common include pam::common
case $operatingsystem { case $::operatingsystem {
"centos","fedora": { "centos","redhat","fedora": {
exec { "authconfig --enablemkhomedir --update": exec { "authconfig --enablemkhomedir --update":
path => "/bin:/usr/bin:/sbin:/usr/sbin", path => "/bin:/usr/bin:/sbin:/usr/sbin",
unless => "egrep '^USEMKHOMEDIR=yes\$' /etc/sysconfig/authconfig", unless => "egrep '^USEMKHOMEDIR=yes\$' /etc/sysconfig/authconfig",

View file

@ -7,7 +7,7 @@ class portmap::server {
$package = "" $package = ""
$service = "portmap" $service = "portmap"
} }
"centos": { "centos","redhat": {
case $::operatingsystemrelease { case $::operatingsystemrelease {
/^[1-5]\./: { /^[1-5]\./: {
$package = "portmap" $package = "portmap"

View file

@ -35,7 +35,7 @@ class psacct::linux {
"ubuntu" => "acct", "ubuntu" => "acct",
default => "psacct", default => "psacct",
}, },
ensure => $operatingsystem ? { ensure => $::operatingsystem ? {
"ubuntu" => undef, "ubuntu" => undef,
default => running, default => running,
}, },

View file

@ -27,7 +27,7 @@ class pulseaudio::server inherits pulseaudio::common {
} }
file { "/etc/sysconfig/pulseaudio": file { "/etc/sysconfig/pulseaudio":
ensure => present, ensure => present,
source => "puppet:///modules/pulseaudio/pulseaudio.sysconfig.${operatingsystem}", source => "puppet:///modules/pulseaudio/pulseaudio.sysconfig.${::operatingsystem}",
mode => "0644", mode => "0644",
owner => root, owner => root,
group => root, group => root,

View file

@ -24,13 +24,13 @@ class puppet::client {
$puppet_keylength = "2048" $puppet_keylength = "2048"
} }
case $operatingsystem { case $::operatingsystem {
openbsd: { $vardir = "/var/puppet" } openbsd: { $vardir = "/var/puppet" }
default: { $vardir = "/var/lib/puppet" } default: { $vardir = "/var/lib/puppet" }
} }
case $operatingsystem { case $::operatingsystem {
centos,fedora: { "centos","redhat","fedora": {
package { "ruby-shadow": package { "ruby-shadow":
ensure => installed, ensure => installed,
} }
@ -43,7 +43,7 @@ class puppet::client {
} }
} }
openbsd: { openbsd: {
if $operatingsystemrelease == "4.9" { if $::operatingsystemrelease == "4.9" {
file { "/etc/rc.d/puppetd": file { "/etc/rc.d/puppetd":
ensure => present, ensure => present,
source => "puppet:///modules/puppet/puppetd.rc", source => "puppet:///modules/puppet/puppetd.rc",
@ -61,16 +61,16 @@ class puppet::client {
content => template("puppet/puppet.conf.erb"), content => template("puppet/puppet.conf.erb"),
mode => "0640", mode => "0640",
owner => "root", owner => "root",
group => $operatingsystem ? { group => $::operatingsystem ? {
openbsd => "_puppet", openbsd => "_puppet",
default => "puppet", default => "puppet",
}, },
} }
case $operatingsystem { case $::operatingsystem {
openbsd: { openbsd: {
service { "puppet": service { "puppet":
name => $operatingsystemrelease ? { name => $::operatingsystemrelease ? {
/4\.[1-8]/ => "puppet", /4\.[1-8]/ => "puppet",
default => "puppetd", default => "puppetd",
}, },
@ -114,14 +114,14 @@ class puppet::client {
source => "puppet:///modules/puppet/puppet-check", source => "puppet:///modules/puppet/puppet-check",
mode => "0755", mode => "0755",
owner => "root", owner => "root",
group => $operatingsystem ? { group => $::operatingsystem ? {
openbsd => "wheel", openbsd => "wheel",
default => "root", default => "root",
}, },
} }
cron { "puppet-check": cron { "puppet-check":
ensure => present, ensure => present,
environment => $operatingsystem ? { environment => $::operatingsystem ? {
openbsd => "PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin", openbsd => "PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin",
default => undef, default => undef,
}, },
@ -149,7 +149,7 @@ class puppet::manual inherits puppet::client {
ensure => absent, ensure => absent,
} }
case $operatingsystem { case $::operatingsystem {
debian,ubuntu: { debian,ubuntu: {
File["/etc/default/puppet"] { File["/etc/default/puppet"] {
source => "puppet:///modules/puppet/puppet.disabled.default", source => "puppet:///modules/puppet/puppet.disabled.default",
@ -193,13 +193,13 @@ class puppet::server {
# #
class puppet::server::common inherits puppet::client { class puppet::server::common inherits puppet::client {
if $::operatingsystem == "CentOS" and $::operatingsystemrelease =~ /^[1-5]\..*/ { if $::operatingsystem in ["CentOS","RedHat"] and $::operatingsystemrelease =~ /^[1-5]\..*/ {
$seltype = "var_lib_t" $seltype = "var_lib_t"
} else { } else {
$seltype = "puppet_var_lib_t" $seltype = "puppet_var_lib_t"
} }
case $operatingsystem { case $::operatingsystem {
"openbsd": { "openbsd": {
$user = "_puppet" $user = "_puppet"
$group = "_puppet" $group = "_puppet"
@ -237,14 +237,14 @@ class puppet::server::common inherits puppet::client {
} }
package { "puppetmaster": package { "puppetmaster":
name => $operatingsystem ? { name => $::operatingsystem ? {
debian => "puppetmaster", debian => "puppetmaster",
ubuntu => "puppetmaster", ubuntu => "puppetmaster",
openbsd => "ruby-puppet", openbsd => "ruby-puppet",
default => "puppet-server", default => "puppet-server",
}, },
ensure => installed, ensure => installed,
notify => $operatingsystem ? { notify => $::operatingsystem ? {
debian => Exec["stop-puppetmaster"], debian => Exec["stop-puppetmaster"],
ubuntu => Exec["stop-puppetmaster"], ubuntu => Exec["stop-puppetmaster"],
default => undef, default => undef,
@ -252,7 +252,7 @@ class puppet::server::common inherits puppet::client {
before => File["/etc/puppet/puppet.conf"], before => File["/etc/puppet/puppet.conf"],
} }
case $operatingsystem { case $::operatingsystem {
"debian","ubuntu": { "debian","ubuntu": {
exec { "stop-puppetmaster": exec { "stop-puppetmaster":
command => "pkill -u puppet ; true", command => "pkill -u puppet ; true",
@ -271,7 +271,7 @@ class puppet::server::common inherits puppet::client {
} }
"mysql": { "mysql": {
require ruby::mysql require ruby::mysql
if $::operatingsystem == "CentOS" and $::operatingsystemrelease !~ /^[1-5]\..*/ { if $::operatingsystem in ["CentOS","RedHat"] and $::operatingsystemrelease !~ /^[1-5]\..*/ {
selinux::boolean { "puppetmaster_use_db": selinux::boolean { "puppetmaster_use_db":
value => "on", value => "on",
} }
@ -290,7 +290,7 @@ class puppet::server::common inherits puppet::client {
ensure => directory, ensure => directory,
mode => "0755", mode => "0755",
owner => "root", owner => "root",
group => $operatingsystem ? { group => $::operatingsystem ? {
"openbsd" => "wheel", "openbsd" => "wheel",
default => "root", default => "root",
}, },
@ -312,7 +312,7 @@ class puppet::server::common inherits puppet::client {
ensure => directory, ensure => directory,
mode => "0755", mode => "0755",
owner => "root", owner => "root",
group => $operatingsystem ? { group => $::operatingsystem ? {
"openbsd" => "wheel", "openbsd" => "wheel",
default => "root", default => "root",
}, },
@ -350,7 +350,7 @@ class puppet::server::common inherits puppet::client {
ensure => directory, ensure => directory,
mode => "0755", mode => "0755",
owner => "root", owner => "root",
group => $operatingsystem ? { group => $::operatingsystem ? {
"openbsd" => "wheel", "openbsd" => "wheel",
default => "root", default => "root",
}, },
@ -361,7 +361,7 @@ class puppet::server::common inherits puppet::client {
ensure => directory, ensure => directory,
mode => "0755", mode => "0755",
owner => "root", owner => "root",
group => $operatingsystem ? { group => $::operatingsystem ? {
"openbsd" => "wheel", "openbsd" => "wheel",
default => "root", default => "root",
}, },
@ -388,7 +388,7 @@ class puppet::server::common inherits puppet::client {
"puppet:///modules/puppet/tagmail.conf", ], "puppet:///modules/puppet/tagmail.conf", ],
mode => "0644", mode => "0644",
owner => "root", owner => "root",
group => $operatingsystem ? { group => $::operatingsystem ? {
"openbsd" => "wheel", "openbsd" => "wheel",
default => "root", default => "root",
}, },
@ -402,14 +402,14 @@ class puppet::server::common inherits puppet::client {
"puppet:///modules/puppet/fileserver.conf", ], "puppet:///modules/puppet/fileserver.conf", ],
mode => "0644", mode => "0644",
owner => "root", owner => "root",
group => $operatingsystem ? { group => $::operatingsystem ? {
"openbsd" => "wheel", "openbsd" => "wheel",
default => "root", default => "root",
}, },
require => Package["puppetmaster"], require => Package["puppetmaster"],
} }
if $operatingsystem != "OpenBSD" { if $::operatingsystem != "OpenBSD" {
if !$puppet_report_maxage { if !$puppet_report_maxage {
$puppet_report_maxage = "720" $puppet_report_maxage = "720"
} }
@ -429,7 +429,7 @@ class puppet::server::common inherits puppet::client {
source => "puppet:///modules/puppet/puppet-clean-storeconfigs", source => "puppet:///modules/puppet/puppet-clean-storeconfigs",
mode => "0755", mode => "0755",
owner => "root", owner => "root",
group => $operatingsystem ? { group => $::operatingsystem ? {
openbsd => "wheel", openbsd => "wheel",
default => "root", default => "root",
}, },
@ -464,7 +464,7 @@ class puppet::server::webrick {
require => Package["puppetmaster"], require => Package["puppetmaster"],
} }
case $operatingsystem { case $::operatingsystem {
debian,ubuntu: { debian,ubuntu: {
file { "/etc/default/puppetmaster": file { "/etc/default/puppetmaster":
ensure => present, ensure => present,
@ -506,7 +506,7 @@ class puppet::server::mongrel {
$puppet_listenports = [ "18140", "18141", "18142", "18143", ] $puppet_listenports = [ "18140", "18141", "18142", "18143", ]
} }
if $::operatingsystem == "CentOS" and $::operatingsystemrelease =~ /^[1-5]\..*/ { if $::operatingsystem in ["CentOS","RedHat"] and $::operatingsystemrelease =~ /^[1-5]\..*/ {
$seltype = "http_port_t" $seltype = "http_port_t"
} else { } else {
$seltype = "puppet_port_t" $seltype = "puppet_port_t"
@ -529,7 +529,7 @@ class puppet::server::mongrel {
require => Package["puppetmaster", "mongrel"], require => Package["puppetmaster", "mongrel"],
} }
case $operatingsystem { case $::operatingsystem {
debian,ubuntu: { debian,ubuntu: {
file { "/etc/default/puppetmaster": file { "/etc/default/puppetmaster":
ensure => present, ensure => present,
@ -566,7 +566,7 @@ class puppet::server::apache {
content => template("puppet/puppet-httpd.conf.erb"), content => template("puppet/puppet-httpd.conf.erb"),
http => false, http => false,
} }
case $operatingsystem { case $::operatingsystem {
debian,ubuntu: { debian,ubuntu: {
include apache::mod::headers include apache::mod::headers
include apache::mod::proxy include apache::mod::proxy
@ -623,7 +623,7 @@ class puppet::opencollab {
include wiki::opencollab include wiki::opencollab
package { "PyYAML": package { "PyYAML":
name => $operatingsystem ? { name => $::operatingsystem ? {
debian => "python-yaml", debian => "python-yaml",
ubuntu => "python-yaml", ubuntu => "python-yaml",
default => "PyYAML", default => "PyYAML",
@ -640,7 +640,7 @@ class puppet::opencollab {
content => "[creds]\nurl = ${puppet_opencollab_url}\nusername = ${puppet_opencollab_user}\npassword = ${puppet_opencollab_pass}\n", content => "[creds]\nurl = ${puppet_opencollab_url}\nusername = ${puppet_opencollab_user}\npassword = ${puppet_opencollab_pass}\n",
} }
case $operatingsystem { case $::operatingsystem {
ubuntu: { $script = "/usr/local/bin/opencollab-puppet-uploader" } ubuntu: { $script = "/usr/local/bin/opencollab-puppet-uploader" }
default: { $script = "/usr/bin/opencollab-puppet-uploader" } default: { $script = "/usr/bin/opencollab-puppet-uploader" }
} }

View file

@ -10,7 +10,7 @@ class rsync {
} }
class rsync::run-rsync { class rsync::run-rsync {
case $operatingsystem { case $::operatingsystem {
ubuntu: { ubuntu: {
package { "run-rsync": ensure => installed, } package { "run-rsync": ensure => installed, }
file { "/etc/run-rsync/RunRsyncConfig.pm": file { "/etc/run-rsync/RunRsyncConfig.pm":

View file

@ -44,7 +44,7 @@ class ruby::mysql {
class ruby::rails { class ruby::rails {
case $::operatingsystem { case $::operatingsystem {
"centos": { "centos","redhat": {
if $::operatingsystemrelease =~ /^[1-5]/ { if $::operatingsystemrelease =~ /^[1-5]/ {
package { "rubygem-rails": package { "rubygem-rails":
ensure => installed, ensure => installed,
@ -78,18 +78,27 @@ class ruby::rails {
# #
class ruby::rrd { class ruby::rrd {
package { "ruby-rrd": case $::operatingsystem {
ensure => installed, "centos","redhat": {
name => $::operatingsystem ? { $package = $::operatingsystemrelease ? {
centos => $::operatingsystemrelease ? {
/^[1-5]/ => "ruby-RRDtool", /^[1-5]/ => "ruby-RRDtool",
default => "rrdtool-ruby", default => "rrdtool-ruby",
}, }
debian => regsubst($::rubyversion, '^([0-9]+\.[0-9]+)\..*', 'librrd-ruby\1'), }
ubuntu => regsubst($::rubyversion, '^([0-9]+\.[0-9]+)\..*', 'librrd-ruby\1'), "debian","ubuntu": {
openbsd => "ruby-rrd", $package = regsubst($::rubyversion, '^([0-9]+\.[0-9]+)\..*', 'librrd-ruby\1')
default => "ruby-RRDtool", }
}, "openbsd": {
$package = "ruby-rrd"
}
default: {
$packaage = "ruby-RRDtool"
}
}
package { "ruby-rrd":
ensure => installed,
name => $package,
} }
} }
@ -100,7 +109,7 @@ class ruby::rrd {
class ruby::sqlite3 { class ruby::sqlite3 {
case $::operatingsystem { case $::operatingsystem {
"centos": { "centos","redhat": {
if $::operatingsystemrelease =~ /^[1-5]/ { if $::operatingsystemrelease =~ /^[1-5]/ {
package { "rubygem-sqlite3-ruby": package { "rubygem-sqlite3-ruby":
ensure => installed, ensure => installed,

View file

@ -6,8 +6,8 @@ class samba::server {
ensure => installed, ensure => installed,
} }
case $operatingsystem { case $::operatingsystem {
openbsd: { "openbsd": {
service { "nmbd": service { "nmbd":
ensure => running, ensure => running,
enable => true, enable => true,
@ -25,8 +25,8 @@ class samba::server {
subscribe => File["/etc/samba/smb.conf"], subscribe => File["/etc/samba/smb.conf"],
} }
} }
centos: { "centos","redhat": {
case $operatingsystemrelease { case $::operatingsystemrelease {
/^[1-5]\./: { /^[1-5]\./: {
service { "smb": service { "smb":
ensure => running, ensure => running,
@ -49,7 +49,7 @@ class samba::server {
} }
} }
} }
fedora: { "fedora": {
service { [ "smb", "nmb" ]: service { [ "smb", "nmb" ]:
ensure => running, ensure => running,
enable => true, enable => true,
@ -59,7 +59,7 @@ class samba::server {
subscribe => File["/etc/samba/smb.conf"], subscribe => File["/etc/samba/smb.conf"],
} }
} }
ubuntu: { "ubuntu": {
service { [ "smbd", "nmbd" ]: service { [ "smbd", "nmbd" ]:
ensure => running, ensure => running,
enable => true, enable => true,
@ -70,7 +70,7 @@ class samba::server {
} }
} }
default: { default: {
fail("samba::server not supported in '${operatingsystem}'") fail("samba::server not supported in '${::operatingsystem}'")
} }
} }
@ -80,7 +80,7 @@ class samba::server {
"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",
}, },
@ -94,7 +94,7 @@ class samba::server {
"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",
}, },

View file

@ -37,7 +37,7 @@ class selinux {
notify => Exec["set-selinux-mode"], notify => Exec["set-selinux-mode"],
} }
if $operatingsystem == "CentOS" and $operatingsystemrelease =~ /^[1-5]\./ { if $::operatingsystem in ["CentOS","RedHat"] and $::operatingsystemrelease =~ /^[1-5]\./ {
service { "setroubleshoot": service { "setroubleshoot":
ensure => $selinux_type ? { ensure => $selinux_type ? {
disabled => stopped, disabled => stopped,
@ -72,16 +72,16 @@ class selinux {
# #
class selinux::tools { class selinux::tools {
case $operatingsystem { case $::operatingsystem {
"fedora": { $package = "policycoreutils-python" } "fedora": { $package = "policycoreutils-python" }
"centos": { "centos","redhat": {
case $operatingsystemrelease { case $::operatingsystemrelease {
/^6/: { $package = "policycoreutils-python" } /^6/: { $package = "policycoreutils-python" }
default: { $package = "policycoreutils" } default: { $package = "policycoreutils" }
} }
} }
default: { default: {
fail("selinux::tools not supported on ${operatingsystem}") fail("selinux::tools not supported on ${::operatingsystem}")
} }
} }
@ -272,7 +272,7 @@ class selinux::module::devel {
include selinux::tools include selinux::tools
if $::operatingsystem == "CentOS" { if $::operatingsystem in ["CentOS","RedHat"] {
if $::operatingsystemrelease =~ /^5\.[0-9]/ { if $::operatingsystemrelease =~ /^5\.[0-9]/ {
package { "selinux-policy-devel": package { "selinux-policy-devel":
ensure => installed, ensure => installed,

View file

@ -6,7 +6,7 @@ class sendmail::common {
$mail_domain = $domain $mail_domain = $domain
} }
if $operatingsystem != "OpenBSD" { if $::operatingsystem != "OpenBSD" {
package { "sendmail": package { "sendmail":
ensure => installed, ensure => installed,
name => [ "sendmail", "sendmail-cf", ], name => [ "sendmail", "sendmail-cf", ],
@ -18,8 +18,8 @@ class sendmail::common {
} }
} }
case $operatingsystem { case $::operatingsystem {
"centos","fedora": { "centos","redhat","fedora": {
file { "/etc/sysconfig/sendmail": file { "/etc/sysconfig/sendmail":
ensure => present, ensure => present,
content => "DAEMON=no\nQUEUE=1h\n", content => "DAEMON=no\nQUEUE=1h\n",
@ -48,20 +48,20 @@ class sendmail::client inherits sendmail::common {
} }
file { "/etc/mail/submit.mc": file { "/etc/mail/submit.mc":
path => $operatingsystem ? { path => $::operatingsystem ? {
"openbsd" => "/usr/share/sendmail/cf/submit.mc", "openbsd" => "/usr/share/sendmail/cf/submit.mc",
default => "/etc/mail/submit.mc", default => "/etc/mail/submit.mc",
}, },
ensure => present, ensure => present,
content => template("sendmail/submit.mc.erb", "sendmail/submit.mc.msp.erb"), content => template("sendmail/submit.mc.erb", "sendmail/submit.mc.msp.erb"),
owner => "root", owner => "root",
group => $operatingsystem ? { group => $::operatingsystem ? {
"openbsd" => "bin", "openbsd" => "bin",
default => "root", default => "root",
}, },
mode => "0644", mode => "0644",
notify => Exec["make submit.cf"], notify => Exec["make submit.cf"],
require => $operatingsystem ? { require => $::operatingsystem ? {
"openbsd" => undef, "openbsd" => undef,
default => Package["sendmail"], default => Package["sendmail"],
}, },
@ -69,12 +69,12 @@ 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",
}, },
refreshonly => true, refreshonly => true,
notify => $operatingsystem ? { notify => $::operatingsystem ? {
"openbsd" => undef, "openbsd" => undef,
default => Service["sendmail"], default => Service["sendmail"],
}, },
@ -83,13 +83,13 @@ class sendmail::client inherits sendmail::common {
file { "/etc/mail/submit.cf": file { "/etc/mail/submit.cf":
ensure => present, ensure => present,
owner => "root", owner => "root",
group => $operatingsystem ? { group => $::operatingsystem ? {
"openbsd" => "wheel", "openbsd" => "wheel",
"ubuntu" => "smmsp", "ubuntu" => "smmsp",
default => "root", default => "root",
}, },
mode => "0644", mode => "0644",
source => $operatingsystem ? { source => $::operatingsystem ? {
"openbsd" => "/usr/share/sendmail/cf/submit.cf", "openbsd" => "/usr/share/sendmail/cf/submit.cf",
default => undef, default => undef,
}, },
@ -140,8 +140,8 @@ class sendmail::server inherits sendmail::common {
type => "sendmail_exec_t", type => "sendmail_exec_t",
} }
case $operatingsystem { case $::operatingsystem {
"centos","fedora": { "centos","redhat","fedora": {
File["/etc/sysconfig/sendmail"] { File["/etc/sysconfig/sendmail"] {
content => "DAEMON=yes\nQUEUE=1h\n", content => "DAEMON=yes\nQUEUE=1h\n",
} }
@ -179,7 +179,7 @@ class sendmail::server inherits sendmail::common {
} }
file { "sendmail.mc": file { "sendmail.mc":
name => $operatingsystem ? { name => $::operatingsystem ? {
"openbsd" => "/usr/share/sendmail/cf/sendmail.mc", "openbsd" => "/usr/share/sendmail/cf/sendmail.mc",
default => "/etc/mail/sendmail.mc", default => "/etc/mail/sendmail.mc",
}, },
@ -191,11 +191,11 @@ class sendmail::server inherits sendmail::common {
} }
exec { "make sendmail.cf": exec { "make sendmail.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",
}, },
require => $operatingsystem ? { require => $::operatingsystem ? {
"openbsd" => undef, "openbsd" => undef,
default => Package["sendmail"], default => Package["sendmail"],
}, },
@ -206,7 +206,7 @@ class sendmail::server inherits sendmail::common {
mode => "0644", mode => "0644",
owner => "root", owner => "root",
group => "root", group => "root",
source => $operatingsystem ? { source => $::operatingsystem ? {
"openbsd" => "/usr/share/sendmail/cf/sendmail.cf", "openbsd" => "/usr/share/sendmail/cf/sendmail.cf",
default => undef, default => undef,
}, },
@ -231,7 +231,7 @@ class sendmail::server inherits sendmail::common {
file { "/etc/aliases": file { "/etc/aliases":
ensure => present, ensure => present,
name => $operatingsystem ? { name => $::operatingsystem ? {
"openbsd" => "/etc/mail/aliases", "openbsd" => "/etc/mail/aliases",
default => "/etc/aliases", default => "/etc/aliases",
}, },

View file

@ -2,7 +2,7 @@ divert(-1)dnl
dnl # dnl #
dnl # This file is managed by puppet so hand editing is not recommended. dnl # This file is managed by puppet so hand editing is not recommended.
dnl # dnl #
<% if ['CentOS','Fedora'].index(operatingsystem) -%> <% if ['CentOS','RedHat','Fedora'].index(operatingsystem) -%>
include(`/usr/share/sendmail-cf/m4/cf.m4')dnl include(`/usr/share/sendmail-cf/m4/cf.m4')dnl
<% elsif operatingsystem == 'Ubuntu' -%> <% elsif operatingsystem == 'Ubuntu' -%>
include(`/usr/share/sendmail/cf/m4/cf.m4')dnl include(`/usr/share/sendmail/cf/m4/cf.m4')dnl

View file

@ -15,7 +15,7 @@ divert(-1)
# #
divert(0)dnl divert(0)dnl
<% if ['CentOS','Fedora'].index(operatingsystem) -%> <% if ['CentOS','RedHat','Fedora'].index(operatingsystem) -%>
include(`/usr/share/sendmail-cf/m4/cf.m4')dnl include(`/usr/share/sendmail-cf/m4/cf.m4')dnl
<% elsif operatingsystem == 'Ubuntu' -%> <% elsif operatingsystem == 'Ubuntu' -%>
include(`/usr/share/sendmail/cf/m4/cf.m4')dnl include(`/usr/share/sendmail/cf/m4/cf.m4')dnl
@ -31,7 +31,7 @@ define(`confDIRECT_SUBMISSION_MODIFIERS',`C')dnl
<% if has_variable?('mail_domain') -%> <% if has_variable?('mail_domain') -%>
define(`confDOMAIN_NAME', `<%= mail_domain %>')dnl define(`confDOMAIN_NAME', `<%= mail_domain %>')dnl
<% end -%> <% end -%>
<% if ['CentOS','Fedora'].index(operatingsystem) -%> <% if ['CentOS','RedHat','Fedora'].index(operatingsystem) -%>
define(`confPID_FILE', `/var/run/sm-client.pid')dnl define(`confPID_FILE', `/var/run/sm-client.pid')dnl
<% end -%> <% end -%>
FEATURE(`use_ct_file')dnl FEATURE(`use_ct_file')dnl

View file

@ -6,7 +6,7 @@ class ssh::known_hosts {
ensure => present, ensure => present,
mode => "0644", mode => "0644",
owner => root, owner => root,
group => $operatingsystem ? { group => $::operatingsystem ? {
OpenBSD => wheel, OpenBSD => wheel,
default => root, default => root,
}, },
@ -36,7 +36,7 @@ class ssh::hostkeys {
source => "puppet:///private/ssh_host_dsa_key", source => "puppet:///private/ssh_host_dsa_key",
mode => "0600", mode => "0600",
owner => root, owner => root,
group => $operatingsystem ? { group => $::operatingsystem ? {
openbsd => wheel, openbsd => wheel,
default => root, default => root,
}, },
@ -46,7 +46,7 @@ class ssh::hostkeys {
source => "puppet:///private/ssh_host_dsa_key.pub", source => "puppet:///private/ssh_host_dsa_key.pub",
mode => "0644", mode => "0644",
owner => root, owner => root,
group => $operatingsystem ? { group => $::operatingsystem ? {
openbsd => wheel, openbsd => wheel,
default => root, default => root,
}, },
@ -57,7 +57,7 @@ class ssh::hostkeys {
source => "puppet:///private/ssh_host_rsa_key", source => "puppet:///private/ssh_host_rsa_key",
mode => "0600", mode => "0600",
owner => root, owner => root,
group => $operatingsystem ? { group => $::operatingsystem ? {
openbsd => wheel, openbsd => wheel,
default => root, default => root,
}, },
@ -67,7 +67,7 @@ class ssh::hostkeys {
source => "puppet:///private/ssh_host_rsa_key.pub", source => "puppet:///private/ssh_host_rsa_key.pub",
mode => "0644", mode => "0644",
owner => root, owner => root,
group => $operatingsystem ? { group => $::operatingsystem ? {
openbsd => wheel, openbsd => wheel,
default => root, default => root,
}, },
@ -78,7 +78,7 @@ class ssh::hostkeys {
source => "puppet:///private/ssh_host_key", source => "puppet:///private/ssh_host_key",
mode => "0600", mode => "0600",
owner => root, owner => root,
group => $operatingsystem ? { group => $::operatingsystem ? {
openbsd => wheel, openbsd => wheel,
default => root, default => root,
}, },
@ -88,7 +88,7 @@ class ssh::hostkeys {
source => "puppet:///private/ssh_host_key.pub", source => "puppet:///private/ssh_host_key.pub",
mode => "0644", mode => "0644",
owner => root, owner => root,
group => $operatingsystem ? { group => $::operatingsystem ? {
openbsd => wheel, openbsd => wheel,
default => root, default => root,
}, },
@ -124,7 +124,7 @@ class ssh::server {
# #
class ssh::disable inherits ssh::server { class ssh::disable inherits ssh::server {
case $operatingsystem { case $::operatingsystem {
"ubuntu": { "ubuntu": {
file { "/etc/init/ssh.conf": file { "/etc/init/ssh.conf":
ensure => present, ensure => present,

View file

@ -4,7 +4,7 @@
class ssl { class ssl {
case $::operatingsystem { case $::operatingsystem {
"centos","fedora": { "centos","redhat","fedora": {
$certs = "/etc/pki/tls/certs" $certs = "/etc/pki/tls/certs"
$private = "/etc/pki/tls/private" $private = "/etc/pki/tls/private"
} }

View file

@ -2,7 +2,7 @@
# #
class sudo { class sudo {
if $operatingsystem != "OpenBSD" { if $::operatingsystem != "OpenBSD" {
package { "sudo": package { "sudo":
ensure => installed, ensure => installed,
before => File["/etc/sudoers.d"], before => File["/etc/sudoers.d"],
@ -13,7 +13,7 @@ class sudo {
ensure => directory, ensure => directory,
mode => "0440", mode => "0440",
owner => "root", owner => "root",
group => $operatingsystem ? { group => $::operatingsystem ? {
"openbsd" => "wheel", "openbsd" => "wheel",
default => "root", default => "root",
}, },
@ -27,7 +27,7 @@ class sudo {
ensure => present, ensure => present,
mode => "0440", mode => "0440",
owner => "root", owner => "root",
group => $operatingsystem ? { group => $::operatingsystem ? {
"openbsd" => "wheel", "openbsd" => "wheel",
default => "root", default => "root",
}, },
@ -56,7 +56,7 @@ define sudo::sudoer($where="ALL", $as_whom="ALL", $what="ALL") {
ensure => present, ensure => present,
mode => "0440", mode => "0440",
owner => "root", owner => "root",
group => $operatingsystem ? { group => $::operatingsystem ? {
"openbsd" => "wheel", "openbsd" => "wheel",
default => "root", default => "root",
}, },

View file

@ -14,7 +14,7 @@ class syslog::common {
if !$syslog_type { if !$syslog_type {
case $::operatingsystem { case $::operatingsystem {
"centos": { "centos","redhat": {
$syslog_type = $::operatingsystemrelease ? { $syslog_type = $::operatingsystemrelease ? {
/^6/ => "rsyslog", /^6/ => "rsyslog",
default => "syslogd", default => "syslogd",

View file

@ -6,14 +6,14 @@ class sysstat {
} }
case $::operatingsystem { case $::operatingsystem {
ubuntu: { "ubuntu": {
file { "/etc/default/sysstat": file { "/etc/default/sysstat":
ensure => present, ensure => present,
source => "puppet:///modules/sysstat/sysstat.default", source => "puppet:///modules/sysstat/sysstat.default",
notify => Service["sysstat"], notify => Service["sysstat"],
} }
} }
centos,fedora: { "centos","redhat","fedora": {
} }
default: { default: {
fail("sysstat not supported on ${::operatingsystem}") fail("sysstat not supported on ${::operatingsystem}")

View file

@ -13,7 +13,7 @@ class tftp::server {
ensure => directory, ensure => directory,
mode => "0755", mode => "0755",
owner => "root", owner => "root",
group => $operatingsystem ? { group => $::operatingsystem ? {
openbsd => "wheel", openbsd => "wheel",
default => "root", default => "root",
}, },
@ -30,7 +30,7 @@ class tftp::server {
ensure => directory, ensure => directory,
mode => "0755", mode => "0755",
owner => "root", owner => "root",
group => $operatingsystem ? { group => $::operatingsystem ? {
"openbsd" => "wheel", "openbsd" => "wheel",
default => "root", default => "root",
}, },
@ -38,7 +38,7 @@ class tftp::server {
} }
} }
case $operatingsystem { case $::operatingsystem {
debian,fedora,ubuntu: { debian,fedora,ubuntu: {
file { "/var/lib/tftpboot": file { "/var/lib/tftpboot":
ensure => link, ensure => link,
@ -70,9 +70,9 @@ class tftp::server {
} }
} }
if $operatingsystem != "OpenBSD" { if $::operatingsystem != "OpenBSD" {
package { "tftp-server": package { "tftp-server":
name => $operatingsystem ? { name => $::operatingsystem ? {
ubuntu => "tftpd-hpa", ubuntu => "tftpd-hpa",
debian => "tftpd-hpa", debian => "tftpd-hpa",
default => "tftp-server", default => "tftp-server",
@ -81,7 +81,7 @@ class tftp::server {
} }
} }
case $operatingsystem { case $::operatingsystem {
debian,ubuntu: { debian,ubuntu: {
service { "tftpd-hpa": service { "tftpd-hpa":
ensure => running, ensure => running,
@ -95,7 +95,7 @@ class tftp::server {
include inetd::server include inetd::server
inetd::service { "tftp": inetd::service { "tftp":
ensure => present, ensure => present,
require => $operatingsystem ? { require => $::operatingsystem ? {
"openbsd" => undef, "openbsd" => undef,
default => Package["tftp-server"], default => Package["tftp-server"],
}, },

View file

@ -25,7 +25,7 @@ class time::zone {
}, },
} }
case $operatingsystem { case $::operatingsystem {
"centos","redhat": { "centos","redhat": {
file { "/etc/sysconfig/clock": file { "/etc/sysconfig/clock":
ensure => present, ensure => present,

View file

@ -6,13 +6,13 @@ class user::system {
ensure => directory, ensure => directory,
mode => "0755", mode => "0755",
owner => "root", owner => "root",
group => $operatingsystem ? { group => $::operatingsystem ? {
"openbsd" => "wheel", "openbsd" => "wheel",
default => "root", default => "root",
}, },
} }
if $operatingsystem == "ubuntu" { if $::operatingsystem == "ubuntu" {
file { "/sbin/nologin": file { "/sbin/nologin":
ensure => link, ensure => link,
target => "/usr/sbin/nologin", target => "/usr/sbin/nologin",
@ -64,7 +64,7 @@ class user::system {
gid => 802, gid => 802,
comment => "Service Jabber", comment => "Service Jabber",
home => "/var/lib/ejabberd", home => "/var/lib/ejabberd",
shell => $operatingsystem ? { shell => $::operatingsystem ? {
"ubuntu" => "/bin/sh", "ubuntu" => "/bin/sh",
default => "/sbin/nologin", default => "/sbin/nologin",
}, },
@ -261,7 +261,7 @@ define user::newuser($uid, $gid, $comment, $home, $shell, $groups=undef, $requir
shell => $shell, shell => $shell,
groups => $groups, groups => $groups,
require => $requiregroups, require => $requiregroups,
notify => $operatingsystem ? { notify => $::operatingsystem ? {
OpenBSD => [ Exec["user-mod-${name}"], OpenBSD => [ Exec["user-mod-${name}"],
Exec["user-home-${name}"], ], Exec["user-home-${name}"], ],
default => undef, default => undef,

View file

@ -41,7 +41,7 @@ define util::extract::tar($source, $ensure=present, $strip=0, $preserve=false) {
ensure => directory, ensure => directory,
mode => "0755", mode => "0755",
owner => "root", owner => "root",
group => $operatingsystem ? { group => $::operatingsystem ? {
"openbsd" => "wheel", "openbsd" => "wheel",
default => "root", default => "root",
}, },
@ -53,7 +53,7 @@ define util::extract::tar($source, $ensure=present, $strip=0, $preserve=false) {
bz2, tbz: { $cat = "bzcat" } bz2, tbz: { $cat = "bzcat" }
} }
$tar = $operatingsystem ? { $tar = $::operatingsystem ? {
"openbsd" => "gtar", "openbsd" => "gtar",
default => "tar", default => "tar",
} }

View file

@ -6,6 +6,7 @@ class vim {
package { "vim": package { "vim":
name => $::operatingsystem ? { name => $::operatingsystem ? {
"centos" => "vim-enhanced", "centos" => "vim-enhanced",
"redhat" => "vim-enhanced",
"fedora" => "vim-enhanced", "fedora" => "vim-enhanced",
default => "vim", default => "vim",
}, },

View file

@ -5,7 +5,7 @@ class vmware::guest {
case $virtual { case $virtual {
vmware: { vmware: {
case $operatingsystem { case $::operatingsystem {
centos: { include vmware::guest::centos } centos: { include vmware::guest::centos }
} }
} }

View file

@ -54,9 +54,9 @@ class vsroom::collab {
# #
class vsroom::common { class vsroom::common {
case $operatingsystem { case $::operatingsystem {
centos: { "centos","redhat": {
case $operatingsystemrelease { case $::operatingsystemrelease {
/^5/: { /^5/: {
Python::Setup::Install["/usr/local/src/vsroom"] { Python::Setup::Install["/usr/local/src/vsroom"] {
python => "python2.6", python => "python2.6",
@ -116,7 +116,7 @@ class vsroom::common {
} }
} }
$htdocs = $operatingsystem ? { $htdocs = $::operatingsystem ? {
"ubuntu" => "/usr/local/share/vsroom/htdocs", "ubuntu" => "/usr/local/share/vsroom/htdocs",
default => "/usr/share/vsroom/htdocs", default => "/usr/share/vsroom/htdocs",
} }

View file

@ -50,7 +50,7 @@ class wiki::moin {
require => Util::Patch["/usr/local/src/moin"], require => Util::Patch["/usr/local/src/moin"],
} }
$shared = $operatingsystem ? { $shared = $::operatingsystem ? {
"ubuntu" => "/usr/local/share/moin", "ubuntu" => "/usr/local/share/moin",
default => "/usr/share/moin", default => "/usr/share/moin",
} }
@ -83,7 +83,7 @@ class wiki::graphingwiki::common {
ensure => directory, ensure => directory,
mode => "0644", mode => "0644",
owner => "root", owner => "root",
group => $operatingsystem ? { group => $::operatingsystem ? {
"openbsd" => "wheel", "openbsd" => "wheel",
default => "root", default => "root",
}, },
@ -364,7 +364,7 @@ class wiki::collab::base {
cron { "collab-htaccess": cron { "collab-htaccess":
ensure => present, ensure => present,
command => $operatingsystem ? { command => $::operatingsystem ? {
ubuntu => "/usr/local/bin/collab-htaccess", ubuntu => "/usr/local/bin/collab-htaccess",
default => "/usr/bin/collab-htaccess", default => "/usr/bin/collab-htaccess",
}, },
@ -415,7 +415,7 @@ class wiki::collab::ramcache {
dump => "0", dump => "0",
pass => "0", pass => "0",
require => File["/srv/wikis/collab/cache"], require => File["/srv/wikis/collab/cache"],
before => $operatingsystem ? { before => $::operatingsystem ? {
"ubuntu" => Service["apache2"], "ubuntu" => Service["apache2"],
default => Service["httpsd"], default => Service["httpsd"],
}, },

View file

@ -45,19 +45,26 @@ class yum::cron::download {
} }
# Install changelog plugin # Install changelog plugin
# #
class yum::plugin::changelog { class yum::plugin::changelog {
package { "yum-plugin-changelog": case $::operatingsystem {
ensure => installed, "centos","redhat": {
name => $operatingsystem ? { $package = $::operatingsystemrelease ? {
"centos" => $operatingsystemrelease ? {
/^[1-5]/ => "yum-changelog", /^[1-5]/ => "yum-changelog",
default => "yum-plugin-changelog", default => "yum-plugin-changelog",
}, }
default => "yum-plugin-changelog", }
}, default: {
$package = "yum-plugin-changelog"
}
}
package { "yum-plugin-changelog":
ensure => installed,
name => $package,
} }
} }
@ -67,15 +74,21 @@ class yum::plugin::changelog {
# #
class yum::plugin::downloadonly { class yum::plugin::downloadonly {
package { "yum-plugin-downloadonly": case $::operatingsystem {
ensure => installed, "centos","redhat": {
name => $operatingsystem ? { $package = $::operatingsystemrelease ? {
"centos" => $operatingsystemrelease ? {
/^[1-5]/ => "yum-downloadonly", /^[1-5]/ => "yum-downloadonly",
default => "yum-plugin-downloadonly", default => "yum-plugin-downloadonly",
}, }
default => "yum-plugin-downloadonly", }
}, default: {
$package = "yum-plugin-downloadonly"
}
}
package { "yum-plugin-downloadonly":
ensure => installed,
name => $package,
} }
} }
@ -85,14 +98,14 @@ class yum::plugin::downloadonly {
# #
class yum::common { class yum::common {
case $operatingsystem { case $::operatingsystem {
"fedora": { "fedora": {
$osname = "fedora" $osname = "fedora"
$osver = $operatingsystemrelease $osver = $::operatingsystemrelease
} }
"centos": { "centos","redhat": {
$osname = "el" $osname = "el"
$osver = regsubst($operatingsystemrelease, '^(\d+)\..*$', '\1') $osver = regsubst($::operatingsystemrelease, '^(\d+)\..*$', '\1')
} }
} }
@ -234,8 +247,8 @@ class yum::repo::centos-cr {
tag("bootstrap") tag("bootstrap")
if $operatingsystem != "CentOS" { if $::operatingsystem != "CentOS" {
fail("CentOS CR repository not supported in ${operatingsystem}") fail("CentOS CR repository not supported in ${::operatingsystem}")
} }
package { "centos-release-cr": package { "centos-release-cr":
@ -404,7 +417,7 @@ class yum::repo::puppetlabs {
"fedora": { "fedora": {
$dir = "fedora/f\$releasever/products/\$basearch" $dir = "fedora/f\$releasever/products/\$basearch"
} }
"centos": { "centos","redhat": {
$dir = "el/\$releasever/products/\$basearch" $dir = "el/\$releasever/products/\$basearch"
} }
default: { default: {