[ssh_tools] Update README, deprecate
* Updated documentation to point to the new script names. * The user is now advised to use Ansible if possible. We provide Ansible equivalents to these scripts.
This commit is contained in:
parent
a8b48a2771
commit
1a0c6183c4
|
@ -1,17 +1,25 @@
|
|||
The cluster utilities are script allowing to work in parallel with a
|
||||
number of remote hosts, using utilities such as Parallel SSH (pssh) or
|
||||
fping. They all take as first and mandatory positional argument a host
|
||||
list name “NAME”; the list will be searched according to the following
|
||||
pattern:
|
||||
Use Ansible instead
|
||||
===================
|
||||
|
||||
$XDG_CONFIG_HOME/cluster/NAME.lst
|
||||
These utilities are script allowing one to work in parallel with a number of
|
||||
remote hosts, using utilities such as Parallel SSH (pssh) or fping. Nowadays,
|
||||
you're much better off using Ansible, which covers everything these scripts do,
|
||||
and much more. The only exception might be `tabssh.sh`.
|
||||
|
||||
Original documentation
|
||||
======================
|
||||
|
||||
All these scripts take as first and mandatory positional argument a host list
|
||||
name “NAME”; the list will be searched according to the following pattern:
|
||||
|
||||
$XDG_CONFIG_HOME/ssh_tools/NAME.lst
|
||||
|
||||
(`$XDG_CONFIG_HOME` being equivalent to `$HOME/.config` if unset.)
|
||||
For example, one can call the `cluster-ping.sh` script typing:
|
||||
For example, one can call the `multiping.sh` script typing:
|
||||
|
||||
cluster-ping my_hosts
|
||||
multiping my_hosts
|
||||
|
||||
to use the hosts' file `$XDG_CONFIG_HOME/cluster/my_hosts.lst`.
|
||||
to use the hosts' file `$XDG_CONFIG_HOME/ssh_tools/my_hosts.lst`.
|
||||
|
||||
The format of such a .lst file is one line per host name or IP address,
|
||||
for example:
|
||||
|
@ -26,46 +34,56 @@ The scripts based on SSH use the local user's login name as remote login;
|
|||
this can be changed using the `-l` option, that must appear before the
|
||||
hosts list on the command line, for example:
|
||||
|
||||
cluster-run -l root openwrt_machines opkg install screen
|
||||
multissh -l root openwrt_machines opkg install screen
|
||||
|
||||
The provided scripts are detailed in the sequel.
|
||||
|
||||
multiping.sh
|
||||
------------
|
||||
|
||||
cluster-ping.sh
|
||||
---------------
|
||||
|
||||
Test the connectivity with the hosts of the list by sending them a ICMP
|
||||
Tests the connectivity with the hosts of the list by sending them a ICMP
|
||||
echo packet.
|
||||
|
||||
**Dependency**: `fping`
|
||||
|
||||
**Ansible replacement**:
|
||||
|
||||
cluster-ssh.sh
|
||||
--------------
|
||||
ansible <group> -m ping
|
||||
|
||||
Open a GNU Screen tab with an interactive SSH session for each host of
|
||||
tabssh.sh
|
||||
---------
|
||||
|
||||
Opens a GNU Screen tab with an interactive SSH session for each host of
|
||||
the hosts list. Must be run inside of an existing Screen.
|
||||
|
||||
**Dependencies**: `screen`, `ssh`
|
||||
|
||||
**Ansible replacement**: not really. Maybe see this StackOverflow question for
|
||||
inspiration:
|
||||
<https://stackoverflow.com/questions/47887379/how-could-i-open-a-ssh-shell-to-remote-with-ansible>
|
||||
|
||||
cluster-run.sh
|
||||
--------------
|
||||
multissh.sh
|
||||
-----------
|
||||
|
||||
Run the same command on every host of the hosts list.
|
||||
Runs the same command on every host of the hosts list.
|
||||
|
||||
**Dependency**: `parallel-ssh` (`pssh`)
|
||||
|
||||
**Ansible replacement**: use Ansible's `command` module (i.e. the default
|
||||
module), or the `shell` module if using pipes or redirections.
|
||||
|
||||
cluster-deploy.sh
|
||||
-----------------
|
||||
ansible <group> -a '<command>'
|
||||
ansible <group> -m shell -a '<command with pipes>'
|
||||
|
||||
Deploy one or more files in parallel on every host of the hosts list.
|
||||
multicopy.sh
|
||||
------------
|
||||
|
||||
Deploys one or more files in parallel on every host of the hosts list.
|
||||
The files are copied in the remote user's home directory.
|
||||
|
||||
By default, the files are transferred one by one, to make sure you notice
|
||||
the errors for each file (bad permissions, out of space, etc.), but you
|
||||
can use the `-P` switch to transfer them all at once (faster).
|
||||
can use the `-P` switch to transfer them all at once (which is much faster).
|
||||
|
||||
While it is possible to transfer directories with the default option, to
|
||||
synchronise directories one would rather use the `-r` option, that uses
|
||||
|
@ -78,4 +96,10 @@ Please note that unlike rsync, prsync cannot handle multiple local files,
|
|||
therefore the `-P` option is ignored when passed along with `-r` or `-R`.
|
||||
|
||||
**Dependencies**: `parallel-scp` (`pscp`), `parallel-rsync` (`prsync`),
|
||||
`cluster-ping` (see above)
|
||||
`multiping` (see above)
|
||||
|
||||
**Ansible replacement**: use Ansible `copy` module. See also modules `fetch`
|
||||
(to retrieve files instead of pushing them), `synchronize`, `rsync` and
|
||||
`unarchive`.
|
||||
|
||||
ansible <group> -m copy -a 'src=/local/path dest=/remote/path'
|
||||
|
|
Loading…
Reference in New Issue