- From: Adam Jacob <adam@opscode.com>
- To: chef@lists.opscode.com
- Subject: [chef] Re: Re: Libraries being used in templates.
- Date: Fri, 24 Jul 2009 08:38:52 -0700
What was it?
Adam
On Fri, Jul 24, 2009 at 12:10 AM, Scott Likens<scott@likens.us> wrote:
>
Cancel this.
>
>
Got it all straightened out.
>
>
On Jul 23, 2009, at 10:54 PM, Scott Likens wrote:
>
>
> Hello all,
>
>
>
> I had recently dug myself into using libraries and wondered if anyone had
>
> a way to make it work in templates?
>
>
>
> I was looking at http://wiki.opscode.com/display/chef/Libraries and
>
> noticed it did not mention the word templates,
>
>
>
> so I whipped up something like this,
>
>
>
> all_vhosts do |name, info|
>
> template "/etc/nginx/sites-available/#{name}.conf" do
>
> source "default-site.erb"
>
> owner "www-data"
>
> group "www-data"
>
> mode 0644
>
> variables(
>
> name => name
>
> )
>
> end
>
> end
>
>
>
> I can't seem to obviously get name to iterate properly? (not sure if
>
> that's the right word) but @name never appears in the template, as a simple
>
> <%= @name %> shows zilch.
>
>
>
> Obviously this works super clean and awesome in 1/2 of my recipe, but I
>
> was wondering if anyone had any thoughts on the last part of this hurdle?
>
> I'm sure it's something I've overlooked but I'd love a hint/pointer/etc?
>
>
>
> Thanks
>
>
>
> Sincerely,
>
>
>
> Scott M. Likens
>
>
>
> !DSPAM:4a694cb536451804284693!
>
>
>
>
>
>
--
Opscode, Inc.
Adam Jacob, CTO
T: (206) 508-7449 E: adam@opscode.com
Archive powered by MHonArc 2.6.16.