hezjing (2016-01-28 02:03):
Hi
I want to create a job that will login to multiple remote servers (and
with multiple user accounts) and install some products. How should I
create this job?
One way is to create a slave node for every user in each of the remote
servers, then trigger the job on that specific slave node.
Another way is use SSH plugin that login to the remote hosts and
execute the commands.
What are the differences between these two ways? Any better idea?
One blocker would be if you have a Windows machine to test. SSH on
Windows is very unstable (or at least I haven't found any that would
work fine with Jenkins).
For Linux machines I find it easier to setup SSH connection and it's
handy anyway. Just remember to generate password-less key. Then for each
machine just use `ssh-copy-id` to set it up.
Sometimes I even find it more convinet to use `scp` and `ssh` commands
in jenskins as you can easily do loops like:
serverList=(app1 app2 app5 app7)
for appServer in ${serverList[@]}
do
connectionString="root@$appServer"
scp commands.sh $connectionString:/remote/path/commands.sh
ssh $connectionString "cd /remote/path/; commands.sh"
done
I don't think you can easily do something like that with slaves. But
maybe you can with Groovy scripts? Haven't tried.
Regards,
Nux.
--
You received this message because you are subscribed to the Google Groups "Jenkins
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/jenkinsci-users/56A9F7A8.40709%40mol.com.pl.
For more options, visit https://groups.google.com/d/optout.