mirror of
https://github.com/inspec/inspec
synced 2024-11-23 21:23:29 +00:00
add local ssh config to runner kitchen tests
Signed-off-by: Dominik Richter <dominik.richter@gmail.com>
This commit is contained in:
parent
a67a5b6deb
commit
519d60c9d6
1 changed files with 18 additions and 0 deletions
|
@ -41,6 +41,24 @@ execute 'create block_device' do
|
|||
not_if 'test -e /tmp/block_device'
|
||||
end
|
||||
|
||||
# prepare ssh for backend
|
||||
execute 'create ssh key' do
|
||||
command 'ssh-keygen -t rsa -b 2048 -f /root/.ssh/id_rsa -N ""'
|
||||
not_if 'test -e /root/.ssh/id_rsa'
|
||||
end
|
||||
|
||||
remote_file 'copy ssh key to authorized keys' do
|
||||
path '/root/.ssh/authorized_keys'
|
||||
source 'file:///root/.ssh/id_rsa.pub'
|
||||
owner 'root'
|
||||
group 'root'
|
||||
mode 0644
|
||||
end
|
||||
|
||||
execute 'test ssh connection' do
|
||||
command 'ssh -o StrictHostKeyChecking=no -i /root/.ssh/id_rsa root@localhost "echo 1"'
|
||||
end
|
||||
|
||||
# execute tests
|
||||
execute 'bundle install' do
|
||||
command '/opt/chef/embedded/bin/bundle install'
|
||||
|
|
Loading…
Reference in a new issue