ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Anderson, Rob (Global Trade)" <Rob.Ander...@nike.com>
Subject RE: Ant with WebSphere (WSADMIN) and SSH
Date Wed, 11 Feb 2004 01:44:36 GMT
The sshexec task was designed to work the same way as ssh when you give it a command to execute
remotely...

ssh user@host 'command arg1'

You can however line up commands to execute in a single connection as follows...

<sshexec knownhosts="${env.HOME}/.ssh/known_hosts"
   host="${host}"
   username="${user}"
   keyfile="${env.HOME}/.ssh/id_dsa"
   command="command1 arg1 ; command2 arg2 ; command3 arg3"/>

This would be the equivalent of...

ssh user@host 'command1 arg1 ; command2 arg2 ; command3 arg3'

The task is not meant to mimic/automate a shell session, like the telnet task.

I know there is a way to make it so the wscp.sh utility, in WAS 4x, does not prompt for a
password. And you can also run one-liners with the wscp.sh tool. Perhaps the wsadmin tool
has the same features.

-Rob Anderson

> -----Original Message-----
> From: Nick Neuberger [mailto:Nick.Neuberger@sncc.com]
> Sent: Tuesday, February 10, 2004 2:58 PM
> To: 'user@ant.apache.org'
> Subject: 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
> 
> 
> 


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


Mime
View raw message