On Thu, Jan 28, 2010 at 5:26 AM, chuck clark <ccl...@ziclix.com> wrote: > Has anyone found a clean way to manage Glassfish configuration with puppet? > Glassfish was designed to be managed through a WebUI or a CLI tool known as > asadmin. Making changes using these tools modifies a domain.xml file. > Glassfish reads and writes this file every time it restarts, even if the > contents are the same, which changes the timestamp. I believe this can be > addressed by setting puppet to use a different checksum. > However, the real question is should the domain.xml be managed directly? It > is a messy file and some configuration updates made through the asadmin tool > change the file in several places. I thought I might make things simpler by > using templates and creating a domain.xml.erb and this is working but > porting changes I make from a local development Glassfish instance back to > that file is tedious and error prone. > One approach could be to create a mechanism to manage incremental changes > (asadmin commands) which modify the underlying structure (domain.xml) like > RoR's migrations or Java's bering do with SQL statements to modify a schema. > But I don't see an easy way to use the current abstractions in puppet to do > this. > Another approach would be to have puppet really understand Glassfish as a > resource similar to users in puppet currently. You manage them at a high > level using tools like adduser to make modifications and getent to verify a > configuration as opposed to managing the /etc/passwd and /etc/group files > directly. My fear with this approach is I'm not sure asadmin is robust > enough to query and return current settings and that I'll end up writing a > lot of code to parse and search for nasty XML fragments and this will be > brittle as the Glassfish team changes the format of the domain.xml as > development progresses.
I think a custom resource to drive asadmin is probably the right way to go. What version are you using? As of Glassfish v3 there's a good REST API ( v3asadmin is essentially a http client). See the article here: http://blogs.sun.com/aquatic/entry/glassfish_rest_interface_for_management (there are links to the dev. api there too). Out of interest, how do you install glassfish? I had a look round a while back and couldn't find any RPMs at all. -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-us...@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.