rearrange a ton of things

This commit is contained in:
John Bintz 2012-06-04 10:39:23 -04:00
parent eccb9e1cee
commit 5f5731868f
7 changed files with 51 additions and 7 deletions

View File

@ -1,5 +1,10 @@
class basics {
$packages = [ "ntp", "ntpdate", "gcc", "curl", "build-essential", "patch", 'sysstat', 'git-core', 'vim' ]
$packages = [
"ntp", "ntpdate", "gcc", "curl",
"build-essential", "patch", 'sysstat',
'git-core', 'vim'
]
package { $packages: ensure => installed }
bash_rc { "/etc/bash.bashrc": ensure => present }

View File

@ -1,6 +1,6 @@
class varnish::debian($version, $vcl_template, $store_file_mb = 1024) {
$varnish_user = 'varnish'
$varnish_group = 'varnish'
class varnish::debian($version, $vcl, $store_file_mb = 1024) {
$user = 'varnish'
$group = 'varnish'
user { $varnish_user: uid => 27835 }
@ -11,7 +11,7 @@ class varnish::debian($version, $vcl_template, $store_file_mb = 1024) {
class { 'varnish':
version => $version,
require => Package[$packages],
vcl_template => $vcl_template
vcl_template => $vcl
}
init_d { 'varnish':
@ -21,7 +21,7 @@ class varnish::debian($version, $vcl_template, $store_file_mb = 1024) {
}
exec { 'ensure-data-store-ownership':
command => "chown -R ${varnish_user}:${varnish_group} ${varnish::data}",
command => "chown -R ${user}:${group} ${varnish::data}",
path => $base::path,
require => Class['varnish']
}

View File

@ -42,7 +42,7 @@ class varnish($version, $vcl_template, $store_file_mb = 1024) {
$varnish_stop = "service varnish stop"
file { $vcl_path:
content => template($vcl_template),
content => $vcl_template,
require => Build_and_install[$name]
}

View File

@ -0,0 +1,17 @@
class varnish::redhat($version, $user, $group, $vcl) {
$init_d_prolog = template('varnish/redhat/init-d-prolog')
$init_d_prerun = template('varnish/redhat/init-d-prerun')
class { varnish:
vcl_template => $vcl,
version => $version
}
$varnish_init_d = "${varnish::share}/varnish-init.d"
file { $varnish_init_d:
content => template('varnish/varnish-init.d'),
require => Mkdir_p[$varnish::share],
mode => 755
}
}

View File

@ -0,0 +1,19 @@
#
# varnish Control the Varnish Cache
#
# chkconfig: - 90 10
# description: Varnish is a high-perfomance HTTP accelerator
# processname: varnishd
# config: /etc/sysconfig/varnish
# pidfile: /var/run/varnishd.pid
### BEGIN INIT INFO
# Provides: varnish
# Required-Start: $network $local_fs $remote_fs
# Required-Stop: $network $local_fs $remote_fs
# Default-Start:
# Default-Stop:
# Should-Start: $syslog
# Short-Description: start and stop varnishd
# Description: Varnish is a high-perfomance HTTP accelerator
### END INIT INFO

View File

@ -3,6 +3,9 @@
<%= init_d_prolog %>
<%= init_d_prerun %>
USER=<%= user %>
GROUP=<%= group %>
start() {
echo -n "Starting $NAME: "