hedge hog, tks, unfortunately i don't think my particular resource can be expressed as a task or a service, and I am on RHEL :(On Wed, Feb 29, 2012 at 10:05 AM, Hedge Hog < " target="_blank"> > wrote:
On Wed, Feb 29, 2012 at 7:53 PM, Bryan Berry < " target="_blank"> > wrote:If you are on a system that provides upstart, then I think you'll find
> I have an issue where I need to provide values generated dynamically by one
> resource to resources that follow it
>
> My tomcat lwrp generates a base directory for each new instance that is a
> readable attribute "base"
>
> Following resources will use that base attribute. In this example, the ivy
> resource should place a .jar file in the #{base}/lib directory
upstart will scratch that itch most effectively[0].
Of course this assumes that each of the current resources can be
expressed as a task or service.
I generally use Chef to tweak a generic upstart conf template, and use
the emit/emits/start on/stop on to look after chaining and sequencing.
If you go down this path you might have to pay attention to upstart
synchronisation[1].
HTH
[0] http://upstart.ubuntu.com/cookbook/#run-a-job-when-a-file-or-directory-is-created-deleted
[1] http://upstart.ubuntu.com/cookbook/#synchronisation
--
>
>
> include_recipe "ark"
>
> include_recipe "tomcat::base"
>
> include_recipe "ivy"
>
>
>
> 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" # evaluates to "/lib"
>
>
> end
>
>
>
> ruby_block "foobarbaz" do
>
> block do
>
> Chef::Log.debug("t.base is #{t.base}") # t.base evaluates to
> "/usr/local/tomcat/jira"
>
> end
>
> end
>
>
> I have found a solution thanks to Jorge Espada, but there really should be a
> more straightforward way to do this.
>
> t = tomcat "jira" do
>
> user node['jira']['user']
>
> action :nothing
>
> end
>
> t.run_action :install
πόλλ' οἶδ ἀλώπηξ, ἀλλ' ἐχῖνος ἓν μέγα
[The fox knows many things, but the hedgehog knows one big thing.]
Archilochus, Greek poet (c. 680 BC – c. 645 BC)
http://hedgehogshiatus.com
Archive powered by MHonArc 2.6.16.