-
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy path.kitchen.libvirt.ssh.yml
106 lines (97 loc) · 4.3 KB
/
.kitchen.libvirt.ssh.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
<%
# Hack to fix a bug in TK. TK supports using an SSH gateway in its SSH transport, but appears not to support configuring
# separate keys for the gateway and the destination.
require 'kitchen/transport/ssh'
GATEWAY_KEYS = ["#{ENV['HOME']}/.ssh/identity.lyra"]
class Kitchen::Transport::Ssh::Connection
# Replace this method in TK core with a version that uses the logged in user's key to access the SSH gateway.
def establish_connection_via_gateway(opts)
retry_connection(opts) do
Net::SSH::Gateway.new(ssh_gateway, ssh_gateway_username, options.merge(keys: GATEWAY_KEYS))
.ssh(hostname, username, options)
end
end
end
%>
---
driver:
name: vagrant
provider: libvirt
vagrantfiles:
- 'test/fixtures/Vagrantfile.libvirt-ssh'
#synced_folders:
# - [".", "/tmp/kitchen/soloist", "disabled: false, type: 'rsync'"]
# TODO: Find & fix bugs in Vagrant where it checks for vagrant-host path... needs to support remote NFS & 9p libvirt mounts
# TODO: Fix mount: false setting for 9p
# TODO: Fix auto-mount capability for Darwin / macOS... needs mount_9p support (see man mount_9p)
# Need to implement mount_9p_shared_folder capability for macOS / Darwin
# https://github.com/vagrant-libvirt/vagrant-libvirt/search?q=mount_9p_shared_folder
# NOTE: For qemu+ssh remote libvirt VM, create a fake directory matching hostpath on the host running vagrant
# In this use case, both hostpath & guestpath live on the same remote libvirt + qemu hypervisor host & VM (guest)
# - ["/opt/export/terabyte", "/System/Volumes/Data/terabyte", "hostpath: '/export/terabyte', guestpath: '/System/Volumes/Data/terabyte', disabled: false, type: '9p', mount: false, accessmode: 'squash', owner:'1000'"]
# - ["/export/terabyte", "/System/Volumes/Data/terabyte", "disabled: false, type: 'nfs', nfs_export: false, bsd__nfs_options: '-fstype=nfs,nolockd,resvport,hard,bg,intr,rw,tcp,nfc'"]
# ssh_gateway_username: trinitronx
# customize:
# memory: 1024
transport:
ssh_gateway: saturn.local
ssh_gateway_username: trinitronx
# username: vagrant
provisioner:
# name: chef_zero
transport:
ssh_gateway: saturn.local
ssh_gateway_username: trinitronx
# deprecations_as_errors: true
deprecations_as_errors: false
# multiple_converge: 2
# enforce_idempotency: true
verifier:
name: inspec
# This will eventually become 'inputs'
# References:
# - https://github.com/inspec/kitchen-inspec/issues/237
# - https://github.com/inspec/inspec/pull/4398
# - https://docs.chef.io/inspec/inputs/#what-happened-to-attributes
attributes:
test_kitchen_user: 'vagrant'
## Client error, can't connect to 'ssh' backend: Only one of proxy_command or bastion_host needs to be specified]
## Apparently the transport ssh_gateway option is actually passed through to InSpec
# proxy_command: ssh saturn.local -q0 %h:%p
platforms:
# - name: ubuntu-20.04
# driver:
# box: generic/ubuntu2004
# lifecycle:
# pre_converge:
# - remote: sudo addgroup --system admin
# - remote: sudo usermod -a -G admin kitchen
- name: macos-12.1
lifecycle:
pre_converge:
- local: ssh saturn.local '[[ "$(docker ps -q --filter 'name=kitchen-installer-server-macos-12.1' | wc -l)" == '1' ]] || docker run --name=kitchen-installer-server-macos-12.1 --rm -d -v /media/terabyte/installers/:/var/www:ro -p 8888:8080 trinitronx/python-simplehttpserver'
- remote: sudo mkdir -p /tmp/kitchen
- remote: sudo chown -R vagrant:vagrant /tmp/kitchen
post_converge:
- local: ssh saturn.local '[ $(docker ps -aq --filter 'name=kitchen-installer-server-macos-12.1' | wc -l) -ge 1 ] && docker kill kitchen-installer-server-macos-12.1'
driver:
box: lyraphase-runner/macos-monterey-base
box_url: http://saturn.local:8888/lyraphase-runner-macos-monterey-base.box
communicator: ssh
gui: true
customize:
memory: 4096
# cpus: 2
attributes:
lyraphase_workstation:
ableton_live:
dmg:
source: http://saturn.local:8888/mac/ableton_live_suite_11.1.5_universal.dmg
bitfocus_companion:
dmg:
source: http://saturn.local:8888/mac/bitfocus-companion-2.2.0-ccea40c7-mac-x64.dmg
# suites:
# - name: default
# run_list:
# - recipe[sprout-base::default]
# includes: [ubuntu-20.04, macos-latest]