You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Nick Neuberger <Ni...@sncc.com> on 2004/02/10 23:58:27 UTC

Ant with WebSphere (WSADMIN) and SSH

I'm trying to automate deployement to websphere via SSH and it looks like I
can't call multiple sshexec in a row.  This causes the ssh to make a new
connection.

The first sshexec causes a    wsadmin> (prompt) for the user.  Thus, the ant
task never returns unless if using the timeout attribute.

Am I overlooking an option in the sshexec task??  I was hoping the this task
would be similar to the telnet task.  (ie.  can't use telnet task because of
security reasons.).

Any thoughts......Should I just create a shell script and do everything from
the shell script????

	<target name="stopSSH">
		<echo message="****** Stopping via SSH... ******"/>
		<echo message="applicationName=${applicationName}"/>
		<echo message="user.id=${user.id} pw=${password}"/>

		<sshexec trust="true" failonerror="false" timeout="15000"
host="${targetMachine}" username="${user.id}" password="${password}"
command="/opt/WebSphere/AppServer/bin/wsadmin.sh"/>
		<sshexec trust="true" host="${targetMachine}"
username="${user.id}" password="${password}" command="set appman
[$AdminControl queryNames type=ApplicationManager,process=server1,*]"/>
		<sshexec trust="true" host="${targetMachine}"
username="${user.id}" password="${password}" command="$AdminControl invoke
$appman stopApplication {${applicationName}}"/>
		<sshexec trust="true" host="${targetMachine}"
username="${user.id}" password="${password}" command="exit"/>
		<sshexec trust="true" host="${targetMachine}"
username="${user.id}" password="${password}" command="exit"/>
	</target>

I got the idea from WebSphereAdvisor.com (magazine) subscription.  It shows
to use the Telnet task....bummer for me.
		
Thanks,

Nick Neuberger


- - - - - - 
This e-mail message is intended only for the use of the individual or entity
identified in the alias address of this message and may contain confidential
and privileged information. Any unauthorized review, use, disclosure or
distribution of this e-mail message is strictly prohibited. If you have
received this e-mail message in error, please notify the sender immediately
by reply e-mail and delete this message from your system. Thank you.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org