ssh and ssh_gzip driver for test-kitchen for any running server with an ip address.
As well as ssh it supports a second driver called ssh_gzip that will also gzip file before transfer which can provide a big performance improvement when alot of files are transfered.
server must be created and destroyed natively (e.g. via cloudformation, heat, or cloud or virtualization console). specify driver parameters
- hostname
- port
- username
- password
- sudo
- ssh_key
- forward_agent
NOTE: ssh driver is compatibile with test-kitchen 1.4 while ssh_gzip has legacy driver compatiability with test-kitchen 1.4
Add this line to your application's Gemfile:
gem 'kitchen-ssh', group: :integration
And then execute:
$ bundle
Or install it yourself as:
$ gem install kitchen-ssh
In your .kitchen.yml file set driver to be 'ssh' or 'ssh_gzip'.
##Example
---
driver:
name: ssh
hostname: your-ip
port: 22
username: username
ssh_key: /path/to/id_rsa
or
---
driver:
name: ssh_gzip
hostname: your-ip
port: 22
username: username
ssh_key: /path/to/id_rsa
If you use a bastion host, add the following lines:
transport:
name: ssh
ssh_gateway: bastion-ip
ssh_gateway_username: bastion-user
Alternatively add ProxyCommand ssh -W %h:%p bastion-user@bastion-ip
to your ssh_config(5)
If you get a hang while running kitchen-ssh with a non-root user check that the user was not set to be NOPASSWORD in the sudoer file either. So it hang there waiting for input of the password prompted. After changing the user and key to be root in the .kitchen.yml file, everything worked.