Create template from library method?

Hey Chefs,

I have a method in a library (I know, I know, I need to convert it to an LWRP–one day) that creates a template. It looks like this:

When it gets run, I see "Giving [user] root access to MySQL server in the Chef log, but the template file never gets created.

When I run the same template block with a normal template resource in a recipe, it works.

Anyone know why it’s not creating the template?

Wes

Since you are not using the template dsl and instead are creating a
template object I would imagine you would still need to tell it to run.

http://wiki.opscode.com/display/chef/Evaluate+and+Run+Resources+at+Compile+Time

On Wed, Aug 1, 2012 at 3:59 PM, Wes Morgan cap10morgan@gmail.com wrote:

Hey Chefs,

I have a method in a library (I know, I know, I need to convert it to an
LWRP–one day) that creates a template. It looks like this:

Template from library method · GitHub

When it gets run, I see "Giving [user] root access to MySQL server in the
Chef log, but the template file never gets created.

When I run the same template block with a normal template resource in a
recipe, it works.

Anyone know why it's not creating the template?

Wes

--
-Bryan

That makes an enormous amount of sense. Thanks!

Wes

On Aug 1, 2012, at 3:10 PM, Bryan Baugher bjbq4d@gmail.com wrote:

Since you are not using the template dsl and instead are creating a template object I would imagine you would still need to tell it to run.

http://wiki.opscode.com/display/chef/Evaluate+and+Run+Resources+at+Compile+Time

On Wed, Aug 1, 2012 at 3:59 PM, Wes Morgan cap10morgan@gmail.com wrote:
Hey Chefs,

I have a method in a library (I know, I know, I need to convert it to an LWRP–one day) that creates a template. It looks like this:

Template from library method · GitHub

When it gets run, I see "Giving [user] root access to MySQL server in the Chef log, but the template file never gets created.

When I run the same template block with a normal template resource in a recipe, it works.

Anyone know why it's not creating the template?

Wes

--
-Bryan