2012-04-30 16:02:19 +00:00
|
|
|
class basics {
|
2012-06-04 14:39:23 +00:00
|
|
|
$packages = [
|
|
|
|
"ntp", "ntpdate", "gcc", "curl",
|
|
|
|
"build-essential", "patch", 'sysstat',
|
|
|
|
'git-core', 'vim'
|
|
|
|
]
|
|
|
|
|
2012-04-30 16:02:19 +00:00
|
|
|
package { $packages: ensure => installed }
|
|
|
|
|
|
|
|
bash_rc { "/etc/bash.bashrc": ensure => present }
|
|
|
|
}
|
|
|
|
|
|
|
|
class base {
|
|
|
|
$path = "/usr/bin:/bin:/usr/sbin:/sbin"
|
|
|
|
$src_path = "/usr/src"
|
|
|
|
$install_path = "/usr/local"
|
|
|
|
$config_path = "/etc"
|
|
|
|
$pid_path = "/var/run"
|
2012-05-08 19:10:26 +00:00
|
|
|
$data_path = "/var/data"
|
2012-05-02 22:17:23 +00:00
|
|
|
$log_path = "/var/log"
|
2012-04-30 16:02:19 +00:00
|
|
|
$local_path = $install_path
|
2012-05-04 17:54:50 +00:00
|
|
|
$share_path = "/usr/local/share"
|
2012-05-14 13:15:05 +00:00
|
|
|
}
|
|
|
|
|
2012-06-04 19:05:38 +00:00
|
|
|
define init_d {
|
2012-06-12 21:00:41 +00:00
|
|
|
$init_d_prerun = template("${name}/${::osfamily}/init_d_prerun")
|
|
|
|
$init_d_prolog = template("${name}/${::osfamily}/init_d_prolog")
|
2012-06-04 19:05:38 +00:00
|
|
|
|
2012-05-14 13:15:05 +00:00
|
|
|
file { "/etc/init.d/${name}":
|
|
|
|
content => template("${name}/${name}-init.d"),
|
|
|
|
mode => 755
|
|
|
|
}
|
|
|
|
|
|
|
|
$update_rc_d = "update-rc.d ${name}"
|
|
|
|
exec { $update_rc_d:
|
|
|
|
command => "update-rc.d ${name} defaults",
|
|
|
|
require => File["/etc/init.d/${name}"],
|
|
|
|
path => $base::path
|
|
|
|
}
|
|
|
|
|
|
|
|
service { $name:
|
|
|
|
require => Exec[$update_rc_d],
|
|
|
|
ensure => running
|
|
|
|
}
|
2012-04-30 16:02:19 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
node default {
|
|
|
|
include basics
|
|
|
|
include debian
|
|
|
|
|
|
|
|
class { base: require => Class['basics'] }
|
|
|
|
}
|
|
|
|
|