Permalink
Browse files

Fixes on Puppet module. Munin module adapted to Ubuntu1004

  • Loading branch information...
1 parent c611096 commit f6f3f48da5a038d78cd285aae05d9e5f92b0107d root committed Oct 1, 2010
View
@@ -10,6 +10,12 @@
package { mailx:
ensure => present,
+ name => $operatingsystem ? {
+ ubuntu => "mailutils",
+ debian => "mailutils",
+ default => "mailx",
+ },
+
}
service {
View
@@ -6,7 +6,7 @@
# Full hostname of Puppet server
$server = $puppet_server ? {
'' => "puppet",
- default => $puppet_server,
+ default => "$puppet_server",
}
# Access lists for Puppetmaster access (can be an array)
@@ -58,19 +58,19 @@
# Define Puppet DB server ($puppet_db_server). Default: localhost
$db_server = $puppet_db_server ? {
'' => "localhost",
- default => $puppet_db_server,
+ default => "$puppet_db_server",
}
# Define Puppet DB user ($puppet_db_user). Default: root
$db_user = $puppet_db_user ? {
'' => "root",
- default => $puppet_db_user,
+ default => "$puppet_db_user",
}
# Define Puppet DB password ($puppet_db_password). Default: blank
$db_password = $puppet_db_password ? {
'' => "",
- default => $puppet_db_password,
+ default => "$puppet_db_password",
}
# Define Puppet version. Autocalculated: "0.2" for 0.24/0.25 "old" versions, 2.x for new 2.6.x branch.
@@ -87,11 +87,41 @@
default => "puppet",
}
+ $packagename_server = $operatingsystem ? {
+ debian => "puppetmaster",
+ ubuntu => "puppetmaster",
+ default => "puppet-server",
+ }
+
$servicename = $operatingsystem ? {
solaris => "puppetd",
default => "puppet",
}
+ $servicename_server = $operatingsystem ? {
+ default => "puppetmaster",
+ }
+
+ $processname = $operatingsystem ? {
+ default => "puppetd",
+ }
+
+ $processname_server = $operatingsystem ? {
+ default => "puppetmasterd",
+ }
+
+ $hasstatus = $operatingsystem ? {
+ debian => false,
+ ubuntu => false,
+ default => true,
+ }
+
+ $hasstatus_server = $operatingsystem ? {
+ debian => false,
+ ubuntu => false,
+ default => true,
+ }
+
$configfile = $operatingsystem ? {
freebsd => "/usr/local/etc/puppet/puppet.conf",
default => "/etc/puppet/puppet.conf",
@@ -120,22 +150,185 @@
default => "/usr/lib/ruby/1.8/puppet",
}
+ $debugdir = $operatingsystem ? {
+ default => "/var/lib/puppet/debug",
+ }
+
+ # Used by monitor class
+ $pidfile = $operatingsystem ? {
+ default => "/var/run/puppet/puppetd.pid",
+ }
+
+ $pidfile_server = $operatingsystem ? {
+ default => "/var/run/puppet/puppetmasterd.pid",
+ }
+
+ # Used by backup class
+ $datadir = $operatingsystem ? {
+ default => "/var/lib/puppet",
+ }
+
+ # Used by backup class - Provide the file name, if there's no dedicated dir
+ $logdir = $operatingsystem ? {
+ debian => "/var/log/syslog",
+ ubuntu => "/var/log/syslog",
+ default => "/var/log/messages",
+ }
+
+ # Used by monitor and firewall class
+ # If you need to define additional ports, call them $protocol1/$port1 and add the relevant
+ # parts in firewall.pp and monitor.pp
+ $protocol = "tcp"
+ $port = "8140"
+
+
+
+## DEFAULTS FOR MONITOR CLASS
+# These are settings that influence the (optional) puppet::monitor class
+# You can define these variables or leave the defaults
+# The apparently complex variables assignements below follow this logic:
+# - If no user variable is set, a reasonable default is used
+# - If the user has set a host-wide variable (ex: $monitor_target ) that one is set
+# - The host-wide variable can be overriden by a module specific one (ex: $puppet_monitor_target)
+
+ # How the monitor server refers to the monitor target
+ $monitor_target_real = $puppet_monitor_target ? {
+ '' => $monitor_target ? {
+ '' => "${fqdn}",
+ default => $monitor_target,
+ },
+ default => "$puppet_monitor_target",
+ }
+
+ # BaseUrl to access this host
+ $monitor_baseurl_real = $puppet_monitor_baseurl ? {
+ '' => $monitor_baseurl ? {
+ '' => "http://${fqdn}",
+ default => $monitor_baseurl,
+ },
+ default => "${puppet_monitor_baseurl}",
+ }
+
+ # Pattern to look for in the URL defined in puppet::monitor class
+ $monitor_url_pattern = $puppet_monitor_url_pattern ? {
+ '' => "OK",
+ default => "${puppet_monitor_url_pattern}",
+ }
+
+ # If puppet port monitoring is enabled
+ $monitor_port_enable = $puppet_monitor_port ? {
+ '' => $monitor_port ? {
+ '' => true,
+ default => $monitor_port,
+ },
+ default => $puppet_monitor_port,
+ }
+
+ # If puppet url monitoring is enabled
+ $monitor_url_enable = $puppet_monitor_url ? {
+ '' => $monitor_url ? {
+ '' => false,
+ default => $monitor_url,
+ },
+ default => $puppet_monitor_url,
+ }
+
+ # If puppet process monitoring is enabled
+ $monitor_process_enable = $puppet_monitor_process ? {
+ '' => $monitor_process ? {
+ '' => true,
+ default => $monitor_process,
+ },
+ default => $puppet_monitor_process,
+ }
+
+ # If puppet plugin monitoring is enabled
+ $monitor_plugin_enable = $puppet_monitor_plugin ? {
+ '' => $monitor_plugin ? {
+ '' => false,
+ default => $monitor_plugin,
+ },
+ default => $puppet_monitor_plugin,
+ }
+
+## DEFAULTS FOR BACKUP CLASS
+# These are settings that influence the (optional) puppet::backup class
+# You can define these variables or leave the defaults
+
+ # How the backup server refers to the backup target
+ $backup_target_real = $puppet_backup_target ? {
+ '' => $backup_target ? {
+ '' => "${fqdn}",
+ default => $backup_target,
+ },
+ default => "$puppet_backup_target",
+ }
+
+ # Frequency of backups
+ $backup_frequency = $puppet_backup_frequency ? {
+ '' => "daily",
+ default => "$puppet_backup_frequency",
+ }
+
+ # If puppet data have to be backed up
+ $backup_data_enable = $puppet_backup_data ? {
+ '' => $backup_data ? {
+ '' => true,
+ default => $backup_data,
+ },
+ default => $puppet_backup_data,
+ }
+
+ # If puppet logs have to be backed up
+ $backup_log_enable = $puppet_backup_log ? {
+ '' => $backup_log ? {
+ '' => false,
+ default => $backup_log,
+ },
+ default => $puppet_backup_log,
+ }
+
+
+## DEFAULTS FOR FIREWALL CLASS
+# These are settings that influence the (optional) puppet::firewall class
+# You can define these variables or leave the defaults
+
+ # Source IPs that can access this service - Use iptables friendly format
+ $firewall_source_real = $puppet_firewall_source ? {
+ '' => $firewall_source ? {
+ '' => "0.0.0.0/0",
+ default => $firewall_source,
+ },
+ default => "$puppet_firewall_source",
+ }
+
+ # Destination IP to use for this host (Default facter's $ipaddress)
+ $firewall_destination_real = $puppet_firewall_destination ? {
+ '' => $firewall_destination ? {
+ '' => "${ipaddress}",
+ default => $firewall_destination,
+ },
+ default => "$puppet_firewall_destination",
+ }
+
+
+## FILE SERVING SOURCE
# Sets the correct source for static files
# In order to provide files from different sources without modifying the module
# you can override the default source path setting the variable $base_source
# Ex: $base_source="puppet://ip.of.fileserver" or $base_source="puppet://$servername/myprojectmodule"
# What follows automatically manages the new source standard (with /modules/) from 0.25
case $base_source {
- '': { $general_base_source="puppet://$servername" }
+ '': {
+ $general_base_source = $puppetversion ? {
+ /(^0.25)/ => "puppet:///modules",
+ /(^0.)/ => "puppet://$servername",
+ default => "puppet:///modules",
+ }
+ }
default: { $general_base_source=$base_source }
}
- $puppet_source = $puppetversion ? {
- /(^0.25)/ => "$general_base_source/modules/puppet",
- /(^0.)/ => "$general_base_source/puppet",
- default => "$general_base_source/modules/puppet",
- }
-
}
@@ -5,7 +5,7 @@
path => "/etc/default/puppet",
require => Package[puppet],
ensure => present,
- source => "${puppet::params::puppet_source}/default-puppet",
+ source => "${puppet::params::general_base_source}/puppet/default-puppet",
notify => Service["puppet"],
}
@@ -0,0 +1,83 @@
+# File Managed By Puppet
+
+These are the variables used by the module puppet
+
+General Variables (how they are passed by the user - BEFORE defaults enforcing):
+
+# General variables that might be used in Example42 infrastructures
+$my_project = <%= scope.lookupvar('my_project') %>
+$site = <%= scope.lookupvar('site') %>
+$zone = <%= scope.lookupvar('zone') %>
+$type = <%= scope.lookupvar('type') %>
+$role = <%= scope.lookupvar('role') %>
+
+# General variables that might be set to use Example42 extended modules
+$monitor = <%= scope.lookupvar('monitor') %>
+$monitor_port = <%= scope.lookupvar('monitor_port') %>
+$monitor_url = <%= scope.lookupvar('monitor_url') %>
+$monitor_process = <%= scope.lookupvar('monitor_process') %>
+$monitor_plugin = <%= scope.lookupvar('monitor_plugin') %>
+$backup = <%= scope.lookupvar('backup') %>
+$backup_data = <%= scope.lookupvar('backup_data') %>
+$backup_log = <%= scope.lookupvar('backup_log') %>
+$firewall = <%= scope.lookupvar('firewall') %>
+$firewall_source = <%= scope.lookupvar('firewall_source') %>
+$firewall_destination = <%= scope.lookupvar('firewall_destination') %>
+
+User variables (AFTER defaults enforcing):
+$server = <%= scope.lookupvar('puppet::params::server') %>
+$puppet_master_local = <%= scope.lookupvar('puppet_master_local') %>
+$allow = <%= scope.lookupvar('puppet::params::allow') %>
+$nodetool = <%= scope.lookupvar('puppet::params::nodetool') %>
+$externalnodes = <%= scope.lookupvar('puppet::params::externalnodes') %>
+$passenger = <%= scope.lookupvar('puppet::params::passenger') %>
+$storeconfigs = <%= scope.lookupvar('puppet::params::storeconfigs') %>
+$db = <%= scope.lookupvar('puppet::params::db') %>
+$db_server = <%= scope.lookupvar('puppet::params::db_server') %>
+$db_user = <%= scope.lookupvar('puppet::params::db_user') %>
+#NOTSHOWN# $db_password = <%= scope.lookupvar('puppet::params::db_password-NO') %>
+
+$version = <%= scope.lookupvar('puppet::params::version') %>
+
+General internal variables:
+$packagename = <%= scope.lookupvar('puppet::params::packagename') %>
+$packagename_server = <%= scope.lookupvar('puppet::params::packagename_server') %>
+$servicename = <%= scope.lookupvar('puppet::params::servicename') %>
+$servicename_server = <%= scope.lookupvar('puppet::params::servicename_server') %>
+$processname = <%= scope.lookupvar('puppet::params::processname') %>
+$processname_server = <%= scope.lookupvar('puppet::params::processname_server') %>
+$hasstatus = <%= scope.lookupvar('puppet::params::hasstatus') %>
+$hasstatus_server = <%= scope.lookupvar('puppet::params::hasstatus_server') %>
+$configfile = <%= scope.lookupvar('puppet::params::configfile') %>
+$configfile_mode = <%= scope.lookupvar('puppet::params::configfile_mode') %>
+$configfile_owner = <%= scope.lookupvar('puppet::params::configfile_owner') %>
+$configfile_group = <%= scope.lookupvar('puppet::params::configfile_group') %>
+$configdir = <%= scope.lookupvar('puppet::params::configdir') %>
+$initconfigfile = <%= scope.lookupvar('puppet::params::initconfigfile') %>
+$pidfile = <%= scope.lookupvar('puppet::params::pidfile') %>
+$pidfile_server = <%= scope.lookupvar('puppet::params::pidfile_server') %>
+$datadir = <%= scope.lookupvar('puppet::params::datadir') %>
+$logdir = <%= scope.lookupvar('puppet::params::logdir') %>
+$protocol = <%= scope.lookupvar('puppet::params::protocol') %>
+$port = <%= scope.lookupvar('puppet::params::port') %>
+
+Variables used by monitor class:
+$monitor_target_real = <%= scope.lookupvar('puppet::params::monitor_target_real') %>
+$monitor_baseurl_real = <%= scope.lookupvar('puppet::params::monitor_baseurl_real') %>
+$monitor_url_pattern = <%= scope.lookupvar('puppet::params::monitor_url_pattern') %>
+$monitor_port_enable = <%= scope.lookupvar('puppet::params::monitor_port_enable') %>
+$monitor_url_enable = <%= scope.lookupvar('puppet::params::monitor_url_enable') %>
+$monitor_process_enable = <%= scope.lookupvar('puppet::params::monitor_process_enable') %>
+$monitor_plugin_enable = <%= scope.lookupvar('puppet::params::monitor_plugin_enable') %>
+
+Variables used by backup class:
+$backup_target_real = <%= scope.lookupvar('puppet::params::backup_target_real') %>
+$backup_frequency = <%= scope.lookupvar('puppet::params::backup_frequency') %>
+$backup_data_enable = <%= scope.lookupvar('puppet::params::backup_data_enable') %>
+$backup_log_enable = <%= scope.lookupvar('puppet::params::backup_log_enable') %>
+$general_base_source = <%= scope.lookupvar('puppet::params::general_base_source') %>
+
+Variables used by firewall class:
+$firewall_source_real = <%= scope.lookupvar('puppet::params::firewall_source_real') %>
+$firewall_destination_real = <%= scope.lookupvar('puppet::params::firewall_destination_real') %>
+

0 comments on commit f6f3f48

Please sign in to comment.