sshrunner

command module
v0.0.0-...-d573b72 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 17, 2018 License: Apache-2.0 Imports: 1 Imported by: 0

README

sshrunner CircleCI Build Status Coverage Status Go Report Card Documentation Apache Licensed

Run commands across servers using ssh

Usage

Sshrunner runs an ssh command across multiple servers

Usage:
  sshrunner [flags]

Flags:
  -s, --agentsocket string   Socket for the ssh agent (default "/private/tmp/com.apple.launchd.xxx/Listeners")
  -c, --command string       Command to run
      --config string        config file (default is $HOME/.sshrunner.yaml)
  -h, --help                 help for sshrunner
  -k, --key string           Ssh key to use for authentication, full path (default "/Users/raravena/.ssh/id_rsa")
  -m, --machines strings     Hosts to run command on
  -p, --port int             Ssh port to connect to (default 22)
  -a, --useagent             Use agent for authentication
  -u, --user string          User to run the command as (default "raravena")

Examples

Makes /tmp/tmpdir in 17.2.2.2 and 17.2.3.2:

$ sshrunner -c "mkdir /tmp/tmpdir" -m 17.2.2.2,17.2.3.2

Creates /tmp/file file in host1 and host2

$ sshrunner -c "touch /tmp/file" -m host1,host2

Moves a file and creates another one in host1 and host2:

$ sshrunner -c "mv /tmp/file1 /tmp/file2; touch /tmp/file3" -m host1,host2

Runs with default in ~/.sshrunner.yaml

$ sshrunner

Config

Sample ~/.sshrunner.yaml

sshrunner:
  user: ubuntu
  key: /Users/username/.ssh/id_rsa
  useagent: true
  machines:
    - 172.1.1.1
    - 172.1.1.2
    - 172.1.1.3
    - 172.1.1.4
    - 172.1.1.5
  command: sudo rm -f /var/log/syslog.*

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL