It's all about the answers!

Ask a question

RAFW application deploy option


Laura Venturini (661138) | asked Sep 24 '10, 5:19 a.m.
Hi all,
we are deploying an ear file using RAFW and we have a problem mapping users and roles.
For example, using the option

options.multi.two.MapRolesToUsers=

user1 is correctly mapped to users and cn=ETA3,cn=gwas,o=organization is correctly mapped to groups,

while using the option

options.multi.two.MapRolesToUsers=

the value cn=ETA3,cn=gwas,o=organization is assigned to users instaed of groups.
How could I set an empty valeu to the user?

Another doubt: is it possible to update an application in "rollup update" mode (as WebSphere permits)? Is it possible to prevent that the was_common_deploy_install_app command stops the application before performing the update?

Thank you
Laura

2 answers



permanent link
Keir Morgan (4143) | answered Nov 10 '10, 3:08 a.m.
Hi,

I noticed this post got a number of views, but no replies. I don't have an
answer to your first question, or at least not with a bit of research and
testing however, I do have an answer to your second question.

Since this feature isn't in the product by default, the answer is to
leverage the extensible nature of RAFW and create your own custom action.

In a nutshell, you'll want to copy the ANT code for was_common_deploy_
install_app and modify it a bit to create your own version. The steps are
fairly simple, first we will locate was_common_deploy_install_app. Let's
search though the product/actions tree of RAFW and find it. Alternately, you
can use the -p option to RAFW to print out the target if it is in scope.

$ cd $RAFW_HOME/product/actions
$ find . -name '*.xml' -print | xargs grep 'name="was_common_deploy_install_app"'

Since I'm using RAFW 7.1.1.4 I found deploy_install_app in deploy_was_
applications.xml in the deploy/was/common directory.

Depending on your version of RAFW you may find the target in other
locations, such as deploy/was/common/base/server or deploy/was/common/
nd/cluster. If you are using ND, you will want the cluster version and if you
are standalone, you will want the server version. And you guessed it, if you
use both ND and standalone in your environments you will need to create two
versions of the custom action.

No big deal there, just remember which version you copied the action from as
that will determine the destination for our custom action. Simply, copy the
ANT target (everything between the <target> stanza) for this action and save
it to a file. For 7.1.1.4 you will also want to also copy the <rafwaction>
line.

Next, we need to edit our saved target and make some changes. Where you see
name="was_common_deploy_install_app", change that to something like name="
custom_was_common_deploy_install_app". For 7.1.1.4 this includes changing
the <rafwaction> line.

We also need to change or disable the bit that stops the app. Find the line
that looks like <antcall target="was_common_deploy _stop_app" /> and comment
it out. Or for 7.1.1.4 users, wrap it in a -opt option with an <if> <equals
arg1="${opt.stopAppFirst}" arg2="true" /> ... to preserve the old behavior
via a command line switch.

Now, we want to add our action to the user tree. I'm going to leave creating
the action as the server scope up the reader, but for cluster scope, edit
$RAFW_HOME/user/actions/deploy/was/common/nd/cluster/custom_deploy_was_
common_nd_cluster.xml and add your modified ANT target from the file you
just created. For 7.1.1.4 users, you will need to add an import at the top
of the file after the project description that looks like:

<import file="${RAFW_HOME}/product/lib/RAFW_lib.xml" />

Ok, assuming that you've done everything correctly let's validate our
change. Run rafw at the cluster scope in one of your environments with the
-l option to list the targets. If you didn't typo anything you should get a
list of targets. Verify that you can see custom_was_common_deploy_install_
app in the list of targets. If you can't, you likely missed changing the
target name or have the wrong scope (server vs cluster). Assuming that the
above validation passes, run the target in preview mode and validate that
it doesn't stop the app as part of the deployment.

Congratulations! You have just created a custom deploy action.

Regards,

K
-




Another doubt: is it possible to update an application in "rollup update" mode (as WebSphere permits)? Is it possible to prevent that the was_common_deploy_install_app command stops the application before performing the update?

Thank you
Laura

permanent link
Timothy Robertson (216143) | answered Nov 11 '10, 10:53 a.m.
Hi all,
we are deploying an ear file using RAFW and we have a problem mapping users and roles.
For example, using the option

options.multi.two.MapRolesToUsers=

user1 is correctly mapped to users and cn=ETA3,cn=gwas,o=organization is correctly mapped to groups,

while using the option

options.multi.two.MapRolesToUsers=

the value cn=ETA3,cn=gwas,o=organization is assigned to users instaed of groups.
How could I set an empty valeu to the user?

I see a problem with the option string you have passed in, maybe this is just a typo in the post, but you should check in your application properties file. You are using the key: options.multi.two.MapRolesToUsers
twice, for the second option you will want to use
options.multi.three.MapRolesToUsers

Also, you should be able to pass in "" to represent an empty value. However we did find a bug in the the product where were removing "", so it depends on the version of RAFW you are using. If you can post the version, I can check the status of that bug.


Another doubt: is it possible to update an application in "rollup update" mode (as WebSphere permits)? Is it possible to prevent that the was_common_deploy_install_app command stops the application before performing the update?

Thank you
Laura


As Keir mentioned, this is a great usecase for a custom action in RAFW. You can essentially take the action we have for installing applications, copy it to the user namespace and alter the behavior to match your requirements. In the 7.1.2 information center, there is some new material about extending RAFW. Depending on the version of the product you are using there might be some changes in the mechanics, but all the concepts will still apply.

http://publib.boulder.ibm.com/infocenter/rafwhelp/v7r1m2/index.jsp?nav=/24

--tim

Your answer


Register or to post your answer.


Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.