mirror of
https://github.com/inspec/inspec
synced 2025-02-20 07:58:43 +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'
|
not_if 'test -e /tmp/block_device'
|
||||||
end
|
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 tests
|
||||||
execute 'bundle install' do
|
execute 'bundle install' do
|
||||||
command '/opt/chef/embedded/bin/bundle install'
|
command '/opt/chef/embedded/bin/bundle install'
|
||||||
|
|
Loading…
Add table
Reference in a new issue