Skip to Content.
Sympa Menu

grouper-users - Re: [grouper-users] passing bash variables in grouper.properties file to grouper

Subject: Grouper Users - Open Discussion List

List archive

Re: [grouper-users] passing bash variables in grouper.properties file to grouper


Chronological Thread 
  • From: Jay Hoff <>
  • To: "Hyzer, Chris" <>
  • Cc: "" <>
  • Subject: Re: [grouper-users] passing bash variables in grouper.properties file to grouper
  • Date: Thu, 7 Apr 2016 12:43:32 -0400

Chris, thanks for your response. Below are some questions from one of our developers, Scott Cole. We are running RHEL 6.x, fyi.

-Jay

Hello,

We would like to be able to dynamically populate some of the property values in a configuration overlay for grouper.properties but are struggling to get our changes using the elConfig suffix to work as described in the Wiki.

Specifically, we would like to set the grouper.env.name and grouper.ui.url properties dynamically. The problem I see is that the Grouper source code seems to be expecting those property names as is, not grouper.env.name.elConfig. At least that is how the GrouperStartup printConfigOnce method handles things. 

For example, I have attempted to set the environment name as follows: grouper.env.name.elConfig = ${java.lang.System.getenv().get('IDS_ENV')}, where IDS_ENV is an environment variable with value TEST.

When we deploy that change and restart Grouper, the log file shows the <no label configured> value for the environment, presumably because the property being looked at is "grouper.env.name", not "grouper.env.name.elConfig". 

That leaves me with 2 questions:

1. Is there a way to view all of the properties that are in use while Grouper is running with the dynamic properties showing their resolved value?
2. Is it even possible to use the elConfig suffix on base properties like grouper.env.name and grouper.ui.url?

Thank you for your time."

Scott Cole


On Apr 6, 2016, at 7:30 PM, Hyzer, Chris <> wrote:

Yes, it turned out this is possible!  :)  I updated the wiki.

https://spaces.internet2.edu/display/Grouper/Grouper+configuration+overlay#Grouperconfigurationoverlay-Environmentvariables

Environment variables

If you want a config to be pulled from an environment variable, do this:

somethingWhatever.elConfig = ${java.lang.System.getenv().get('JAVA_HOME')}

That will cause the property "somethingWhatever" to have the value "c:\dev_inst\java" or whatever it is set to.  Do the following two things:

1. append    .elConfig        to the propertyName
2. this is the value: ${java.lang.System.getenv().get('JAVA_HOME')}

Thanks
Chris

-----Original Message-----
From: [mailto:] On Behalf Of Jay Hoff
Sent: Tuesday, April 05, 2016 2:55 PM
To:
Subject: [grouper-users] passing bash variables in grouper.properties file to grouper

I have a question about passing a bash variable value into Grouper.  I’m working on making the file grouper.properties free of any system specific configuration so that it can be replicated to other Grouper nodes without the need to configure the file for each specific system. Specifically, in grouper.properties I have the following line:

mail.from.address = grouper_test@$hostname.subdomain.psu.edu (the actual FQDN for the node is used)

Which is used for mailing the daily Grouper reports.

What I would like to be able to do, is to pass the value for the bash variable ${HOSTNAME} to Grouper. I’ve tried this:

mail.from.address = grouper_test@${HOSTNAME}

but the ${HOSTNAME} is treated as text and the variable is not expanded.

Any thoughts would be helpful.


Thanks much,


Jay






Attachment: signature.asc
Description: Message signed with OpenPGP using GPGMail




Archive powered by MHonArc 2.6.16.

Top of Page