About agent preferences handling (was Re: reverting commit)

Thomas Segismont tsegismo at redhat.com
Wed Mar 27 09:34:44 UTC 2013


Hi Elias,

Le 27/03/2013 08:20, Elias Ross a écrit :

> I've done it using calls to Java. It's just too complicated this way
> and error prone. RPMs are nicer, since you can customize a lot of the
> config files that get installed without having to rebuild the install
> package. For example, if you want to customize the memory use, or run
> as 'rhq' user, how can your average user customize the package? How do
> you uninstall the agent? How do you roll out customization changes
> without reinstalling the whole agent? The current system works okay
> for a few installs but not 100+.
>
> You guys are RedHat so I'm not sure what the deal is with not using RPM here.
>

There is absolutely nothing wrong with using native packages based 
installation. I just wanted to point out that using Puppet does not 
force you to use native packages. So let's just forget this :)

> The files need to be in a better place, first of all.

As indicated in the BZ, the file location will most probably 
configurable in the future, with a system property

You could then use something like:

-Dorg.rhq.core.util.preferences.FilePreferenceFactory.file=/etc/rhq/agent.conf

> But even still
> there needs to be some more thought.
>
> For your curiosity, here's more or less how you update a preference
> file in Puppet, say if the server alias changes:
>
>      augeas { "agent" :
>          lens    => "Xml.lns",
>          incl    => "$h/.java/.userPrefs/rhq-agent/default/prefs.xml",
>          changes => [
>              "set
> map/entry[#attribute/key='rhq.agent.server.alias']/#attribute/key
> rhq.agent.server.alias",
>              "set
> map/entry[#attribute/key='rhq.agent.server.alias']/#attribute/value
> ${rhq::agent::server}",
>              "set
> map/entry[#attribute/key='rhq.agent.server.bind-address']/#attribute/key
> rhq.agent.server.bind-address",
>              "set
> map/entry[#attribute/key='rhq.agent.server.bind-address']/#attribute/value
> ${rhq::agent::bind_address}",
>          ],
>          require => [ Package[$rhq::agent::p], File[$prefs] ],
>          notify => Service[$rhq::agent::service],
>      }
>
> This is, well, not ideal. I'm 100% against XML and 100% against
> putting in per-host configuration in one file. If you want a separate
> XML file for just the agent key then I'm okay since I can use
> templates for this file instead.

Like I said in my previous email, the current work aims at using a 
properties file as the preferences backend storage.

Your point on getting the agent token out of the configuration file 
sounds valid to me. Feel free to comment the BZ.

> _______________________________________________
> rhq-devel mailing list
> rhq-devel at lists.fedorahosted.org
> https://lists.fedorahosted.org/mailman/listinfo/rhq-devel
>

Regards,
Thomas


More information about the rhq-devel mailing list