Skip to content
This repository was archived by the owner on May 14, 2021. It is now read-only.

Commit 4201573

Browse files
Warren Bainsethvargo
authored andcommitted
[COOK-3124] : add memcached_template attribute to memcached provider
1 parent 3d0c3ff commit 4201573

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

providers/memcached.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@
3434
Chef::Log.warn("No node with role #{new_resource.role}") unless results.any?
3535

3636
template "#{new_resource.application.path}/shared/memcached.yml" do
37-
source "memcached.yml.erb"
38-
cookbook "application_ruby"
37+
source new_resource.memcached_template || "memcached.yml.erb"
38+
cookbook new_resource.memcached_template ? new_resource.cookbook_name.to_s : "application_ruby"
3939
owner new_resource.owner
4040
group new_resource.group
4141
mode "644"

resources/memcached.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020
include ApplicationCookbook::ResourceBase
2121

2222
attribute :role, :kind_of => [String, NilClass], :default => nil
23+
# Actually defaults to "memcached.yml.erb", but nil means it wasn't set by the user
24+
attribute :memcached_template, :kind_of => [String, NilClass], :default => nil
2325

2426
def options(*args, &block)
2527
@options ||= Mash.new

0 commit comments

Comments
 (0)