diff --git a/shared/additional-modules/varnish-debian/manifests/init.pp b/shared/additional-modules/varnish-debian/manifests/init.pp new file mode 100644 index 0000000..188fde8 --- /dev/null +++ b/shared/additional-modules/varnish-debian/manifests/init.pp @@ -0,0 +1,19 @@ +class varnish-debian($version, $store_file_mb => '1024') { + + $varnish_user = 'varnish' + $varnish_group = 'web' + + user { $varnish_user: + ensure => present, + uid => 25678, + groups => [ 'web' ], + require => Group['web'] + } + + class { varnish: + version => $version, + require => Package[$packages], + store_file_mb + } +} + diff --git a/shared/additional-modules/varnish-debian/templates/init_d_prerun b/shared/additional-modules/varnish-debian/templates/init_d_prerun new file mode 100644 index 0000000..9e726b9 --- /dev/null +++ b/shared/additional-modules/varnish-debian/templates/init_d_prerun @@ -0,0 +1,2 @@ +VARNISH_USERNAME=<%= varnish_user %> +VARNISH_GROUP=<%= varnish_group %> diff --git a/shared/additional-modules/varnish-debian/templates/init_d_prolog b/shared/additional-modules/varnish-debian/templates/init_d_prolog new file mode 100644 index 0000000..fea17dd --- /dev/null +++ b/shared/additional-modules/varnish-debian/templates/init_d_prolog @@ -0,0 +1,13 @@ +### BEGIN INIT INFO +# Provides: varnish +# Required-Start: $local_fs $remote_fs $network +# Required-Stop: $local_fs $remote_fs $network +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: Start HTTP accelerator +# Description: This script provides a server-side cache +# to be run in front of a httpd and should +# listen on port 80 on a properly configured +# system +### END INIT INFO + diff --git a/shared/modules/init_d_bundle/manifests/init.pp b/shared/modules/init_d_bundle/manifests/init.pp new file mode 100644 index 0000000..c625dfa --- /dev/null +++ b/shared/modules/init_d_bundle/manifests/init.pp @@ -0,0 +1,23 @@ +define init_d_bundle($init_d_prolog, $init_d_prerun) { + $init_d_source = "${base::share_path}/${name}/${name}-init.d" + file { $init_d_source: + content => template("${name}/${name}-init.d"), + mode => 755 + } + + $init_d = "/etc/init.d/${name}" + + file { $init_d: + ensure => $init_d_source, + require => File[$init_d_source] + } + + update_rc_d_defaults { $name: + require => File[$init_d] + } + + running_service { $name: + require => Update_rc_d_defaults[$name] + } +} +