For such a simple, explicit dependency I agree, it's nice and elegant.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
My approach probably works better in more complicated cases.
Andrea
Archive powered by MHonArc 2.6.16.