Skip to content

Commit b2d6425

Browse files
author
Patrick Connolly
committed
Added recipe for adding varnish project apt repo.
1 parent 4e8ccd7 commit b2d6425

File tree

4 files changed

+42
-3
lines changed

4 files changed

+42
-3
lines changed

README.md

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ Attributes
2121
directory
2222
* `node['varnish']['default']` - location of the `default` file that
2323
controls the varnish init script on Debian/Ubuntu systems.
24+
* `node['varnish']['version']` - If retrieving from official Varnish project
25+
repository, may choose 2.1 or 3.0. No effect when using default ubuntu repo. (2.1)
2426
* `node['varnish']['start']` - Should we start varnishd at boot? Set to "no" to disable (yes)
2527
* `node['varnish']['nfiles']` - Open files (131072)
2628
* `node['varnish']['memlock']` - Maxiumum locked memory size for shared memory log (82000)
@@ -55,6 +57,13 @@ default
5557
Installs the varnish package, manages the default varnish
5658
configuration file, and the init script defaults file.
5759

60+
varnish_repo
61+
------------
62+
63+
If placed before the default recipe in the run list, the official
64+
Varnish project apt repository will offer access to more version and
65+
platform support.
66+
5867
Usage
5968
=====
6069

@@ -67,7 +76,11 @@ a simple `default.vcl`.
6776
License and Author
6877
==================
6978

70-
Author:: Joe Williams <[email protected]> Author:: Lew Goettner <[email protected]>
79+
Author:: Joe Williams <[email protected]>
80+
81+
Author:: Lew Goettner <[email protected]>
82+
83+
Contributor:: Patrick Connolly <[email protected]>
7184

7285
Copyright:: 2008-2009, Joe Williams
7386

attributes/default.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
set['varnish']['default'] = "/etc/default/varnish"
55
end
66

7+
default['varnish']['version'] = "2.1"
8+
79
default['varnish']['start'] = 'yes'
810
default['varnish']['nfiles'] = 131072
911
default['varnish']['memlock'] = 82000

metadata.rb

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
maintainer "Opscode, Inc."
22
maintainer_email "[email protected]"
33
license "Apache 2.0"
4-
description "Instsalls and configures varnish"
4+
description "Installs and configures varnish"
55
version "0.8"
66

7-
recipe "varnish", "Installs and configures varnish"
7+
recipe "varnish", "Installs and configures varnish"
8+
recipe "varnish_repo", "Adds the official varnish project apt repository"
89

910
%w{ubuntu debian}.each do |os|
1011
supports os

recipes/varnish_repo.rb

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Cookbook Name:: varnish
2+
# Recipe:: varnish_repo
3+
# Author:: Patrick Connolly <[email protected]>
4+
#
5+
# Licensed under the Apache License, Version 2.0 (the "License");
6+
# you may not use this file except in compliance with the License.
7+
# You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
#
17+
18+
apt_repository "varnish-cache" do
19+
uri "http://repo.varnish-cache.org/#{node['platform']}"
20+
distribution node['lsb']['codename']
21+
components ["varnish-#{node['varnish']['version']}"]
22+
key "http://repo.varnish-cache.org/#{node['platform']}/GPG-key.txt"
23+
end

0 commit comments

Comments
 (0)