ensemble should make it easy to share data between hooks
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
pyjuju |
Confirmed
|
Wishlist
|
Unassigned |
Bug Description
In Ensemble, once a relationship is made, the hooks are called that allow the creation of relationship bits via relation-set <blah>=<value of blah>.
During the install script, there is no apparent mechanism by which to start saving variables and their corresponding values. Maybe this is a design issue but, there are formulas the need to have information preserved at the install level and not at the relationship level.
A good example of this is tomcat: In tomcat, the server.xml file needs to be created with static members that require a unique identifier as well as a unique id for each node of the "cluster".
The problem with this is that when the peer-relation hook is called it will only have the necessary information of the remote host but not that of itself.
I can ( on install ) write all of the necessary values to a file and work from there but, I believe an equivalent command to relation-
This information ( or fact-db ) will become increasingly necessary as we continue to develop and deploy formulas that require uuid's and clusternames for their proper clustering ( ie: cassandra, cloudfoundry, tomcat, mondgodb, etc.)
-Juan
I don't think I understand the problem. Hooks reflect specific events, and do not enforce in any way what you're supposed to be doing within them. The install hook, by design, is called just once when the formula is first installed, and in general is a convenient location to run installation of software. That said, there's nothing preventing you from running logic in any of the other hooks. If you can only install/start the software when a relation is established, you should feel free to do so.