Giter Site home page Giter Site logo

deckarep / blade Goto Github PK

View Code? Open in Web Editor NEW
32.0 5.0 4.0 4.25 MB

a remote SSH command-line runner based on YAML recipe files.

Home Page: https://deckarep.github.io/blade/

License: MIT License

Go 98.64% Python 1.27% Shell 0.09%
fab knife ssh golang concurrent tcp server-management concurrency

blade's People

Contributors

deckarep avatar theremix avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

blade's Issues

Args for recipes should be able to be declared without a default value.

If you have a recipe with an arg, you should be able to define it without a default value. This means, that Blade should error out and let the user know that the arg MUST be supplied at the command line as a result.

This will allow you to define args without a bogus default value and causing an unnecessary situation where things can error out.

How to specify ssh key to use when connecting to a host?

I was playing around with bladerunner and I think I ran into an issue related with having multiple ssh keys in my ~/.ssh directory.

hostname.blade.toml

[Required]
  Commands = [
    "hostname"
  ]
  Hosts = ["165.227.192.60"]

In my .ssh/config file I have the following

Host 165.227.192.60
    Hostname 165.227.192.60
    Port 22
    User root
    IdentityFile /home/vendion/.ssh/some_ssh_key

Trying to run my hostname command results in a panic

bladerunner run ceph-test hostname --verbose
2017/09/14 19:22:31 Starting recipe: ceph-test.hostname
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x28 pc=0x6118d2]

goroutine 6 [running]:
github.com/deckarep/blade/vendor/golang.org/x/crypto/ssh.(*connection).clientAuthenticate(0xc4200c2300, 0xc4200c8180, 0x0, 0xa)
	/home/vendion/gocode/src/github.com/deckarep/blade/vendor/golang.org/x/crypto/ssh/client_auth.go:54 +0x312
github.com/deckarep/blade/vendor/golang.org/x/crypto/ssh.(*connection).clientHandshake(0xc4200c2300, 0xc4200187c0, 0x11, 0xc4200c8180, 0x0, 0x0)
	/home/vendion/gocode/src/github.com/deckarep/blade/vendor/golang.org/x/crypto/ssh/client.go:112 +0x2d9
github.com/deckarep/blade/vendor/golang.org/x/crypto/ssh.NewClientConn(0x86fce0, 0xc42000e0d0, 0xc4200187c0, 0x11, 0xc4200c8000, 0x86fce0, 0xc42000e0d0, 0x0, 0x0, 0xc420030528, ...)
	/home/vendion/gocode/src/github.com/deckarep/blade/vendor/golang.org/x/crypto/ssh/client.go:82 +0xfd
github.com/deckarep/blade/vendor/golang.org/x/crypto/ssh.Dial(0x6fe513, 0x3, 0xc4200187c0, 0x11, 0xc4200c8000, 0xa587ebce15ee000, 0x59bb0f37, 0xc420030580)
	/home/vendion/gocode/src/github.com/deckarep/blade/vendor/golang.org/x/crypto/ssh/client.go:176 +0xb3
github.com/deckarep/blade/lib/ssh.startSSHSession(0xc4200c8000, 0xc4200187c0, 0x11, 0xc420044920, 0x1, 0x1, 0x0, 0x0)
	/home/vendion/gocode/src/github.com/deckarep/blade/lib/ssh/session.go:129 +0xe0
github.com/deckarep/blade/lib/ssh.executeSession.func1(0xc42000d300, 0xc42000d300)
	/home/vendion/gocode/src/github.com/deckarep/blade/lib/ssh/session.go:112 +0x57
github.com/deckarep/blade/vendor/github.com/cenkalti/backoff.RetryNotify(0xc42005e840, 0x86c180, 0xc42000d300, 0x70f990, 0x0, 0x663d19)
	/home/vendion/gocode/src/github.com/deckarep/blade/vendor/github.com/cenkalti/backoff/retry.go:37 +0x88
github.com/deckarep/blade/lib/ssh.executeSession(0xc4200c8000, 0xc4200187c0, 0x11, 0xc420044920, 0x1, 0x1)
	/home/vendion/gocode/src/github.com/deckarep/blade/lib/ssh/session.go:111 +0x132
github.com/deckarep/blade/lib/ssh.consumeAndLimitConcurrency.func1(0xc4200c8000, 0xc420044920, 0x1, 0x1, 0xc4200187c0, 0x11)
	/home/vendion/gocode/src/github.com/deckarep/blade/lib/ssh/utils.go:75 +0x7d
created by github.com/deckarep/blade/lib/ssh.consumeAndLimitConcurrency
	/home/vendion/gocode/src/github.com/deckarep/blade/lib/ssh/utils.go:70 +0xe3

Roadmap?

re: @deckarep

I would consider this tool very early stages alpha and barely usable at this point

Are there plans to continue development into a stable production ready release?
What would it take to mature this project?

Should there be a roadmap in the wiki or something?
It would help contributors with moving this project along

Allow overriding user in Hosts

Current behavior:

  • default user is root
  • user can be overridden in [Overrides]
  • User = "ubuntu" would override every ssh connection to connect as user ubuntu

Desired behavior:

  • each host can override the user it connects as
  • if there is no inline override, fall back to previous behavior

example recipe:

[Overrides]
  User = "admin"

[Required]
  Hosts = [
    "localhost:221",
    "root@localhost:222",
    "customuser@localhost:223",
    "localhost:224"
  ]

1st connection will connect as user admin
2nd connection will connect as user root
3rd connection will connect as user customuser
4th connection will connect as user admin

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.