[chef] Re: Re: Re: Re: how to manage dependent resources?


Chronological Thread 
  • From: Bryan Berry < >
  • To:
  • Subject: [chef] Re: Re: Re: Re: how to manage dependent resources?
  • Date: Wed, 29 Feb 2012 17:50:46 +0100
  • Authentication-results: mr.google.com; spf=pass (google.com: domain of designates 10.52.17.82 as permitted sender) ; dkim=pass

agreed and i may need to do that at some point in the future

On Wed, Feb 29, 2012 at 5:31 PM, Andrea Campi < "> > wrote:
On Wed, Feb 29, 2012 at 4:55 PM, Bryan Berry < "> > wrote:
> that's a good idea Andrea but I really like the solution that ssd7 came up
> w/
>
> I generate the base inside the initialize method for my tomcat LWRP
>
> file: tomcat/resources/default.rb
>
> def initialize(*args)s
>
>   super
>
>   @action = ":install >
>   catalina_parent = Pathname.new(node['tomcat']['home']).parent.to_s
>
>   @base = "#{catalina_parent}/ "
>
>   Chef::Log.debug("base_is ")
>
>   @supports = {:report => true, :exception => true}
>
> end
>
> now my recipe code looks like this
>
> t = tomcat "jira" do
>
>   user node['jira']['user']
>
>   action :install
>
> end
>
>
>
> # get mysql connector
>
> ivy "mysql-connector-java" do
>
>   groupId "mysql"
>
>   version "5.1.18"
>
>   dest  "#{t.base}/lib"
>
> end
>
> much more elegant

For such a simple, explicit dependency I agree, it's nice and elegant.
My approach probably works better in more complicated cases.

Andrea




Archive powered by MHonArc 2.6.16.

§