vagrant-skytap 0.1.11 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.byebug_history +242 -19
- data/CHANGELOG.md +9 -0
- data/README.md +30 -8
- data/Vagrantfile.rej +83 -0
- data/_patches-20160112/0 +388 -0
- data/_patches-20160112/1 +82 -0
- data/_patches-20160112/2 +239 -0
- data/_patches-20160112/COMPLETED-ABOVE-THIS-LINE +4 -0
- data/_patches-20160112/COMPLETED-BELOW-THIS-LINE +4 -0
- data/_patches-20160112/CR-ABOVE-THIS-LINE +4 -0
- data/_patches-20160112/CR-BELOW-THIS-LINE +4 -0
- data/_patches-20160112/WIP-ABOVE-THIS-LINE +4 -0
- data/_patches-20160112/WIP-BELOW-THIS-LINE +4 -0
- data/_patches-20160112/acceptance-test-runner +29 -0
- data/_patches-20160112/ansible-1 +92 -0
- data/_patches-20160112/cache-api-client-in-up +40 -0
- data/_patches-20160112/dead-code-in-actions +44 -0
- data/_patches-20160112/debug-changes +42 -0
- data/_patches-20160112/demo-rails-app +1276 -0
- data/_patches-20160112/eng-10166-halt-spec +40 -0
- data/_patches-20160112/eng-10256 +527 -0
- data/_patches-20160112/eng-10256-2 +162 -0
- data/_patches-20160112/eng-10256-ubuntu-testing +88 -0
- data/_patches-20160112/eng-10269-test-stuff +87 -0
- data/_patches-20160112/eng-10269-wtf +119 -0
- data/_patches-20160112/eng-10369 +143 -0
- data/_patches-20160112/eng-10369-tmp +60 -0
- data/_patches-20160112/eng-10919 +56 -0
- data/_patches-20160112/eng-11177-fix-actions-requires +44 -0
- data/_patches-20160112/eng-11442 +4 -0
- data/_patches-20160112/eng-11616 +403 -0
- data/_patches-20160112/eng-11616-2 +67 -0
- data/_patches-20160112/eng-11616-actual +184 -0
- data/_patches-20160112/eng-11625a +4 -0
- data/_patches-20160112/eng-11711 +85 -0
- data/_patches-20160112/eng-12232-command-spec +236 -0
- data/_patches-20160112/eng-12235 +83 -0
- data/_patches-20160112/eng-12235-override-refactor +140 -0
- data/_patches-20160112/eng-12240 +103 -0
- data/_patches-20160112/eng-12249 +40 -0
- data/_patches-20160112/eng-12301 +50 -0
- data/_patches-20160112/eng-12843 +95 -0
- data/_patches-20160112/env-source +112 -0
- data/_patches-20160112/frickin-vagrant-spec +163 -0
- data/_patches-20160112/gem-pre-version +14 -0
- data/_patches-20160112/gems-old +9 -0
- data/_patches-20160112/googles-specs +713 -0
- data/_patches-20160112/local-configs-ignore +61 -0
- data/_patches-20160112/misc +79 -0
- data/_patches-20160112/network-unreachable +31 -0
- data/_patches-20160112/new-boxfile +288 -0
- data/_patches-20160112/parallelization-maybe +198 -0
- data/_patches-20160112/read-state +23 -0
- data/_patches-20160112/refactor-to-use-public_address-cap +25 -0
- data/_patches-20160112/series +60 -0
- data/_patches-20160112/status +12 -0
- data/_patches-20160112/test-move-env-data +231 -0
- data/_patches-20160112/test-vagrantfile-vm1 +167 -0
- data/_patches-20160112/the_version_in_0.1.13.pre1 +598 -0
- data/_patches-20160112/vagrant-spec-mock-api +137 -0
- data/_patches-20160112/vagrant-vmware-plugin +233 -0
- data/_patches-20160112/vagrantfile +403 -0
- data/_patches-20160112/vagrantfile-for-acceptance-tests +29 -0
- data/_patches-20160112/vagrantfile-for-nick +95 -0
- data/_patches-20160112/vagrantfiles-to-forget-what-they-are-for +134 -0
- data/_patches-20160112/vm-vanished +42 -0
- data/_patches-20160112a/01 +148 -0
- data/_patches-20160112a/2 +239 -0
- data/_patches-20160112a/COMPLETED-ABOVE-THIS-LINE +4 -0
- data/_patches-20160112a/COMPLETED-BELOW-THIS-LINE +4 -0
- data/_patches-20160112a/CR-ABOVE-THIS-LINE +4 -0
- data/_patches-20160112a/CR-BELOW-THIS-LINE +4 -0
- data/_patches-20160112a/WIP-ABOVE-THIS-LINE +4 -0
- data/_patches-20160112a/WIP-BELOW-THIS-LINE +4 -0
- data/_patches-20160112a/acceptance-test-runner +29 -0
- data/_patches-20160112a/ansible-1 +92 -0
- data/_patches-20160112a/cache-api-client-in-up +40 -0
- data/_patches-20160112a/dead-code-in-actions +44 -0
- data/_patches-20160112a/debug-changes +42 -0
- data/_patches-20160112a/demo-rails-app +1276 -0
- data/_patches-20160112a/eng-10166-halt-spec +40 -0
- data/_patches-20160112a/eng-10256-ubuntu-testing +88 -0
- data/_patches-20160112a/eng-10269-test-stuff +87 -0
- data/_patches-20160112a/eng-10269-wtf +119 -0
- data/_patches-20160112a/eng-10369 +143 -0
- data/_patches-20160112a/eng-10369-tmp +60 -0
- data/_patches-20160112a/eng-10919 +56 -0
- data/_patches-20160112a/eng-11177-fix-actions-requires +44 -0
- data/_patches-20160112a/eng-11442 +4 -0
- data/_patches-20160112a/eng-11616 +403 -0
- data/_patches-20160112a/eng-11616-2 +67 -0
- data/_patches-20160112a/eng-11616-actual +184 -0
- data/_patches-20160112a/eng-11625a +4 -0
- data/_patches-20160112a/eng-11711 +85 -0
- data/_patches-20160112a/eng-12232-command-spec +236 -0
- data/_patches-20160112a/eng-12235 +83 -0
- data/_patches-20160112a/eng-12235-override-refactor +140 -0
- data/_patches-20160112a/eng-12240 +103 -0
- data/_patches-20160112a/eng-12249 +40 -0
- data/_patches-20160112a/eng-12301 +50 -0
- data/_patches-20160112a/eng-12843 +95 -0
- data/_patches-20160112a/env-source +112 -0
- data/_patches-20160112a/frickin-vagrant-spec +163 -0
- data/_patches-20160112a/gem-pre-version +14 -0
- data/_patches-20160112a/gems-old +9 -0
- data/_patches-20160112a/googles-specs +713 -0
- data/_patches-20160112a/local-configs-ignore +61 -0
- data/_patches-20160112a/misc +79 -0
- data/_patches-20160112a/network-unreachable +31 -0
- data/_patches-20160112a/new-boxfile +288 -0
- data/_patches-20160112a/parallelization-maybe +198 -0
- data/_patches-20160112a/read-state +23 -0
- data/_patches-20160112a/refactor-to-use-public_address-cap +25 -0
- data/_patches-20160112a/series +58 -0
- data/_patches-20160112a/status +14 -0
- data/_patches-20160112a/test-move-env-data +231 -0
- data/_patches-20160112a/test-vagrantfile-vm1 +167 -0
- data/_patches-20160112a/the_version_in_0.1.13.pre1 +612 -0
- data/_patches-20160112a/then-copy-the-newer-files +632 -0
- data/_patches-20160112a/vagrant-spec-mock-api +137 -0
- data/_patches-20160112a/vagrant-vmware-plugin +233 -0
- data/_patches-20160112a/vagrantfile +403 -0
- data/_patches-20160112a/vagrantfile-for-acceptance-tests +29 -0
- data/_patches-20160112a/vagrantfile-for-nick +95 -0
- data/_patches-20160112a/vagrantfiles-to-forget-what-they-are-for +134 -0
- data/_patches-20160112a/vm-vanished +42 -0
- data/_patches-20160113/COMPLETED-ABOVE-THIS-LINE +4 -0
- data/_patches-20160113/COMPLETED-BELOW-THIS-LINE +4 -0
- data/_patches-20160113/CR-ABOVE-THIS-LINE +4 -0
- data/_patches-20160113/CR-BELOW-THIS-LINE +4 -0
- data/_patches-20160113/WIP-ABOVE-THIS-LINE +4 -0
- data/_patches-20160113/WIP-BELOW-THIS-LINE +4 -0
- data/_patches-20160113/acceptance-test-runner +29 -0
- data/_patches-20160113/ansible-1 +92 -0
- data/_patches-20160113/cache-api-client-in-up +40 -0
- data/_patches-20160113/dead-code-in-actions +44 -0
- data/_patches-20160113/debug-changes +55 -0
- data/_patches-20160113/demo-rails-app +1276 -0
- data/_patches-20160113/eng-10166-halt-spec +40 -0
- data/_patches-20160113/eng-10256 +543 -0
- data/_patches-20160113/eng-10256-ubuntu-testing +88 -0
- data/_patches-20160113/eng-10269-test-stuff +87 -0
- data/_patches-20160113/eng-10269-wtf +119 -0
- data/_patches-20160113/eng-10369 +143 -0
- data/_patches-20160113/eng-10369-tmp +60 -0
- data/_patches-20160113/eng-10919 +56 -0
- data/_patches-20160113/eng-11177-fix-actions-requires +44 -0
- data/_patches-20160113/eng-11442 +4 -0
- data/_patches-20160113/eng-11616 +403 -0
- data/_patches-20160113/eng-11616-2 +67 -0
- data/_patches-20160113/eng-11616-actual +184 -0
- data/_patches-20160113/eng-11625a +4 -0
- data/_patches-20160113/eng-11711 +85 -0
- data/_patches-20160113/eng-12232-command-spec +236 -0
- data/_patches-20160113/eng-12235 +83 -0
- data/_patches-20160113/eng-12235-override-refactor +140 -0
- data/_patches-20160113/eng-12240 +103 -0
- data/_patches-20160113/eng-12249 +40 -0
- data/_patches-20160113/eng-12301 +50 -0
- data/_patches-20160113/eng-12720 +47 -0
- data/_patches-20160113/eng-12843 +95 -0
- data/_patches-20160113/env-source +112 -0
- data/_patches-20160113/frickin-vagrant-spec +163 -0
- data/_patches-20160113/gem-pre-version +14 -0
- data/_patches-20160113/gems-old +9 -0
- data/_patches-20160113/googles-specs +713 -0
- data/_patches-20160113/local-configs-ignore +61 -0
- data/_patches-20160113/misc +79 -0
- data/_patches-20160113/network-unreachable +31 -0
- data/_patches-20160113/new-boxfile +288 -0
- data/_patches-20160113/parallelization-maybe +198 -0
- data/_patches-20160113/read-state +23 -0
- data/_patches-20160113/refactor-to-use-public_address-cap +25 -0
- data/_patches-20160113/series +56 -0
- data/_patches-20160113/status +14 -0
- data/_patches-20160113/test-move-env-data +231 -0
- data/_patches-20160113/test-vagrantfile-vm1 +167 -0
- data/_patches-20160113/vagrant-spec-mock-api +137 -0
- data/_patches-20160113/vagrant-vmware-plugin +233 -0
- data/_patches-20160113/vagrantfile +403 -0
- data/_patches-20160113/vagrantfile-for-acceptance-tests +29 -0
- data/_patches-20160113/vagrantfile-for-nick +95 -0
- data/_patches-20160113/vagrantfiles-to-forget-what-they-are-for +134 -0
- data/_patches-20160113/vm-vanished +42 -0
- data/_patches-20160118/COMPLETED-ABOVE-THIS-LINE +4 -0
- data/_patches-20160118/COMPLETED-BELOW-THIS-LINE +4 -0
- data/_patches-20160118/CR-ABOVE-THIS-LINE +4 -0
- data/_patches-20160118/CR-BELOW-THIS-LINE +4 -0
- data/_patches-20160118/WIP-ABOVE-THIS-LINE +4 -0
- data/_patches-20160118/WIP-BELOW-THIS-LINE +4 -0
- data/_patches-20160118/acceptance-test-runner +29 -0
- data/_patches-20160118/ansible-1 +92 -0
- data/_patches-20160118/cache-api-client-in-up +40 -0
- data/_patches-20160118/dead-code-in-actions +44 -0
- data/_patches-20160118/debug-changes +55 -0
- data/_patches-20160118/demo-rails-app +1276 -0
- data/_patches-20160118/eng-10166-halt-spec +40 -0
- data/_patches-20160118/eng-10256 +554 -0
- data/_patches-20160118/eng-10256-cr +314 -0
- data/_patches-20160118/eng-10256-ubuntu-testing +88 -0
- data/_patches-20160118/eng-10269-test-stuff +87 -0
- data/_patches-20160118/eng-10269-wtf +119 -0
- data/_patches-20160118/eng-10369 +143 -0
- data/_patches-20160118/eng-10369-tmp +60 -0
- data/_patches-20160118/eng-10919 +56 -0
- data/_patches-20160118/eng-11177-fix-actions-requires +44 -0
- data/_patches-20160118/eng-11442 +4 -0
- data/_patches-20160118/eng-11616 +403 -0
- data/_patches-20160118/eng-11616-2 +67 -0
- data/_patches-20160118/eng-11616-actual +184 -0
- data/_patches-20160118/eng-11625a +4 -0
- data/_patches-20160118/eng-11711 +85 -0
- data/_patches-20160118/eng-12232-command-spec +236 -0
- data/_patches-20160118/eng-12235 +83 -0
- data/_patches-20160118/eng-12235-override-refactor +140 -0
- data/_patches-20160118/eng-12240 +103 -0
- data/_patches-20160118/eng-12249 +40 -0
- data/_patches-20160118/eng-12301 +50 -0
- data/_patches-20160118/eng-12720 +74 -0
- data/_patches-20160118/eng-12843 +95 -0
- data/_patches-20160118/eng-13040 +291 -0
- data/_patches-20160118/env-source +112 -0
- data/_patches-20160118/frickin-vagrant-spec +163 -0
- data/_patches-20160118/gem-pre-version +14 -0
- data/_patches-20160118/gems-old +9 -0
- data/_patches-20160118/googles-specs +713 -0
- data/_patches-20160118/local-configs-ignore +61 -0
- data/_patches-20160118/misc +79 -0
- data/_patches-20160118/network-unreachable +31 -0
- data/_patches-20160118/new-boxfile +288 -0
- data/_patches-20160118/parallelization-maybe +198 -0
- data/_patches-20160118/port-forwarding-processes +87 -0
- data/_patches-20160118/read-state +23 -0
- data/_patches-20160118/refactor-to-use-public_address-cap +25 -0
- data/_patches-20160118/series +59 -0
- data/_patches-20160118/status +13 -0
- data/_patches-20160118/test-move-env-data +231 -0
- data/_patches-20160118/test-vagrantfile-vm1 +167 -0
- data/_patches-20160118/vagrant-spec-mock-api +137 -0
- data/_patches-20160118/vagrant-vmware-plugin +233 -0
- data/_patches-20160118/vagrantfile +403 -0
- data/_patches-20160118/vagrantfile-for-acceptance-tests +29 -0
- data/_patches-20160118/vagrantfile-for-nick +95 -0
- data/_patches-20160118/vagrantfiles-to-forget-what-they-are-for +134 -0
- data/_patches-20160118/vm-vanished +42 -0
- data/_patches-20160118a/COMPLETED-ABOVE-THIS-LINE +4 -0
- data/_patches-20160118a/COMPLETED-BELOW-THIS-LINE +4 -0
- data/_patches-20160118a/CR-ABOVE-THIS-LINE +4 -0
- data/_patches-20160118a/CR-BELOW-THIS-LINE +4 -0
- data/_patches-20160118a/WIP-ABOVE-THIS-LINE +4 -0
- data/_patches-20160118a/WIP-BELOW-THIS-LINE +4 -0
- data/_patches-20160118a/acceptance-test-runner +29 -0
- data/_patches-20160118a/ansible-1 +92 -0
- data/_patches-20160118a/bar +189 -0
- data/_patches-20160118a/cache-api-client-in-up +40 -0
- data/_patches-20160118a/dead-code-in-actions +44 -0
- data/_patches-20160118a/debug-changes +55 -0
- data/_patches-20160118a/demo-rails-app +1276 -0
- data/_patches-20160118a/eng-10166-halt-spec +40 -0
- data/_patches-20160118a/eng-10256 +554 -0
- data/_patches-20160118a/eng-10256-cr +314 -0
- data/_patches-20160118a/eng-10256-ubuntu-testing +88 -0
- data/_patches-20160118a/eng-10269-test-stuff +87 -0
- data/_patches-20160118a/eng-10269-wtf +119 -0
- data/_patches-20160118a/eng-10369 +143 -0
- data/_patches-20160118a/eng-10369-tmp +60 -0
- data/_patches-20160118a/eng-10919 +56 -0
- data/_patches-20160118a/eng-11177-fix-actions-requires +44 -0
- data/_patches-20160118a/eng-11442 +4 -0
- data/_patches-20160118a/eng-11616 +403 -0
- data/_patches-20160118a/eng-11616-2 +67 -0
- data/_patches-20160118a/eng-11616-actual +184 -0
- data/_patches-20160118a/eng-11625a +4 -0
- data/_patches-20160118a/eng-11711 +85 -0
- data/_patches-20160118a/eng-12232-command-spec +236 -0
- data/_patches-20160118a/eng-12235 +83 -0
- data/_patches-20160118a/eng-12235-override-refactor +140 -0
- data/_patches-20160118a/eng-12240 +103 -0
- data/_patches-20160118a/eng-12249 +40 -0
- data/_patches-20160118a/eng-12301 +50 -0
- data/_patches-20160118a/eng-12720 +74 -0
- data/_patches-20160118a/eng-12843 +95 -0
- data/_patches-20160118a/eng-13040 +291 -0
- data/_patches-20160118a/env-source +112 -0
- data/_patches-20160118a/foo +169 -0
- data/_patches-20160118a/frickin-vagrant-spec +163 -0
- data/_patches-20160118a/gem-pre-version +14 -0
- data/_patches-20160118a/gems-old +9 -0
- data/_patches-20160118a/googles-specs +713 -0
- data/_patches-20160118a/guestport-madness +59 -0
- data/_patches-20160118a/local-configs-ignore +61 -0
- data/_patches-20160118a/misc +79 -0
- data/_patches-20160118a/network-unreachable +31 -0
- data/_patches-20160118a/new-boxfile +288 -0
- data/_patches-20160118a/parallelization-maybe +198 -0
- data/_patches-20160118a/port-forwarding-processes +87 -0
- data/_patches-20160118a/read-state +23 -0
- data/_patches-20160118a/refactor-to-use-public_address-cap +25 -0
- data/_patches-20160118a/series +62 -0
- data/_patches-20160118a/status +14 -0
- data/_patches-20160118a/test-move-env-data +231 -0
- data/_patches-20160118a/test-vagrantfile-vm1 +167 -0
- data/_patches-20160118a/vagrant-spec-mock-api +137 -0
- data/_patches-20160118a/vagrant-vmware-plugin +233 -0
- data/_patches-20160118a/vagrantfile +403 -0
- data/_patches-20160118a/vagrantfile-for-acceptance-tests +29 -0
- data/_patches-20160118a/vagrantfile-for-nick +95 -0
- data/_patches-20160118a/vagrantfiles-to-forget-what-they-are-for +134 -0
- data/_patches-20160118a/vm-vanished +42 -0
- data/lib/vagrant-skytap/action/clear_forwarded_ports.rb +19 -0
- data/lib/vagrant-skytap/action/forward_ports.rb +42 -0
- data/lib/vagrant-skytap/action/prepare_forwarded_port_collision_params.rb +37 -0
- data/lib/vagrant-skytap/action.rb +18 -0
- data/lib/vagrant-skytap/api/environment.rb +19 -4
- data/lib/vagrant-skytap/api/vm.rb +10 -6
- data/lib/vagrant-skytap/command/up.rb +7 -1
- data/lib/vagrant-skytap/errors.rb +4 -0
- data/lib/vagrant-skytap/hosts/bsd/cap/ssh_tunnel.rb +15 -0
- data/lib/vagrant-skytap/hosts/common/cap/ssh_tunnel.rb +183 -0
- data/lib/vagrant-skytap/hosts/linux/cap/ssh_tunnel.rb +15 -0
- data/lib/vagrant-skytap/hosts/windows/cap/ssh_tunnel.rb +27 -0
- data/lib/vagrant-skytap/model/forwarded_port.rb +78 -0
- data/lib/vagrant-skytap/plugin.rb +15 -0
- data/lib/vagrant-skytap/util/compile_forwarded_ports.rb +35 -0
- data/lib/vagrant-skytap/version.rb +1 -1
- data/locales/en.yml +3 -0
- data/spec/unit/environment_spec.rb +14 -2
- data/spec/unit/forwarded_port_spec.rb +45 -0
- data/spec/unit/hosts/common/cap/ssh_tunnel_spec.rb +180 -0
- data/spec/unit/prepare_collision_params_spec.rb +57 -0
- data/spec/unit/support/forwarded_ports/machines/vm1/skytap/id +1 -0
- data/spec/unit/support/forwarded_ports/machines/vm1/skytap/private_key +4 -0
- data/spec/unit/support/forwarded_ports/machines/vm1/skytap/tcp9000_tcp_9000_80.pid +1 -0
- data/spec/unit/support/forwarded_ports/machines/vm1/skytap/tcp9001_tcp_9001_81.pid +1 -0
- data/spec/unit/support/forwarded_ports/machines/vm1/virtualbox/id +1 -0
- data/spec/unit/support/forwarded_ports/machines/vm2/skytap/id +1 -0
- data/spec/unit/support/forwarded_ports/machines/vm2/skytap/tcp8080_tcp_8080_80.pid +1 -0
- data/spec/unit/support/forwarded_ports/machines/vm3/virtualbox/id +1 -0
- data/spec/unit/support/forwarded_ports/machines/vm4/skytap/id +1 -0
- data/spec/unit/support/forwarded_ports/machines/vm4/skytap/tcp8888_tcp_8888_80.pid +1 -0
- metadata +330 -2
@@ -0,0 +1,42 @@
|
|
1
|
+
# HG changeset patch
|
2
|
+
# Parent 1b8860f8b5129c2ab846c4464378c7a582ac0a90
|
3
|
+
raise error on vm reload if it's gone?
|
4
|
+
|
5
|
+
diff -r 1b8860f8b512 lib/vagrant-skytap/api/vm.rb
|
6
|
+
--- a/lib/vagrant-skytap/api/vm.rb Mon Nov 09 20:51:32 2015 -0800
|
7
|
+
+++ b/lib/vagrant-skytap/api/vm.rb Mon Nov 09 20:52:02 2015 -0800
|
8
|
+
@@ -35,6 +35,7 @@
|
9
|
+
end
|
10
|
+
|
11
|
+
def refresh_from_environment
|
12
|
+
+ raise VmVanished, name: machine.name unless vm = environment.get_vm_by_id(id)
|
13
|
+
refresh(vm.attrs)
|
14
|
+
end
|
15
|
+
|
16
|
+
diff -r 1b8860f8b512 lib/vagrant-skytap/errors.rb
|
17
|
+
--- a/lib/vagrant-skytap/errors.rb Mon Nov 09 20:51:32 2015 -0800
|
18
|
+
+++ b/lib/vagrant-skytap/errors.rb Mon Nov 09 20:52:02 2015 -0800
|
19
|
+
@@ -27,6 +27,10 @@
|
20
|
+
error_key(:does_not_exist)
|
21
|
+
end
|
22
|
+
|
23
|
+
+ class VmVanished < VagrantSkytapError
|
24
|
+
+ error_key(:vm_vanished)
|
25
|
+
+ end
|
26
|
+
+
|
27
|
+
class BadVmUrl < VagrantSkytapError
|
28
|
+
error_key(:bad_vm_url)
|
29
|
+
end
|
30
|
+
diff -r 1b8860f8b512 locales/en.yml
|
31
|
+
--- a/locales/en.yml Mon Nov 09 20:51:32 2015 -0800
|
32
|
+
+++ b/locales/en.yml Mon Nov 09 20:52:02 2015 -0800
|
33
|
+
@@ -76,6 +76,9 @@
|
34
|
+
does_not_exist: |-
|
35
|
+
%{object_name} was not found.
|
36
|
+
|
37
|
+
+ vm_vanished: |-
|
38
|
+
+ The VM '%{name}' no longer exists on Skytap.
|
39
|
+
+
|
40
|
+
operation_failed: |-
|
41
|
+
The operation failed: %{err}
|
42
|
+
|
@@ -0,0 +1,148 @@
|
|
1
|
+
# HG changeset patch
|
2
|
+
# Parent b151a1a45bee7b2b6d57e9259001f2f7a8ec52a8
|
3
|
+
# Parent fcbbf2b6298088fecf8f0c9150e92e5624c8dbe7
|
4
|
+
just the common host cap -- is it going the wrong way?
|
5
|
+
|
6
|
+
diff -r fcbbf2b62980 lib/vagrant-skytap/hosts/common/cap/ssh_tunnel.rb
|
7
|
+
--- a/lib/vagrant-skytap/hosts/common/cap/ssh_tunnel.rb Tue Jan 12 22:40:01 2016 -0800
|
8
|
+
+++ b/lib/vagrant-skytap/hosts/common/cap/ssh_tunnel.rb Tue Jan 12 22:43:54 2016 -0800
|
9
|
+
@@ -12,35 +12,32 @@
|
10
|
+
module HostCommon
|
11
|
+
module Cap
|
12
|
+
class SSHTunnel
|
13
|
+
- def self.create_logger
|
14
|
+
- Log4r::Logger.new("vagrant::hosts::common")
|
15
|
+
- end
|
16
|
+
+ def self.start_ssh_tunnel(env, fp, env_hash)
|
17
|
+
+ logger = Log4r::Logger.new("vagrant::hosts::bsd")
|
18
|
+
+ port = {
|
19
|
+
+ adapter: fp.adapter,
|
20
|
+
+ guestip: fp.guest_ip,
|
21
|
+
+ guestport: fp.guest_port,
|
22
|
+
+ hostip: fp.host_ip,
|
23
|
+
+ hostport: fp.host_port,
|
24
|
+
+ name: fp.id,
|
25
|
+
+ protocol: fp.protocol
|
26
|
+
+ }
|
27
|
+
|
28
|
+
- # called per port by ForwardPorts
|
29
|
+
- def self.start_ssh_tunnel(env, fp, env_hash)
|
30
|
+
- logger = create_logger
|
31
|
+
- machine = env_hash[:machine]
|
32
|
+
- pid = read_pid(File.join(machine.data_dir, pidfile_name(fp)))
|
33
|
+
+ pidfile = pidfile_name(port, env_hash)
|
34
|
+
+ pid = read_pid(pidfile)
|
35
|
+
if pid && autossh_pid?(pid)
|
36
|
+
logger.info("An autossh process already exists with pid #{pid}.")
|
37
|
+
else
|
38
|
+
- args = autossh_args(fp, pidfile, env_hash)
|
39
|
+
+ args = autossh_args(port, pidfile, env_hash)
|
40
|
+
Vagrant::Util::Subprocess.execute("autossh", *args)
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
44
|
+
- # called for machine by ClearForwardedPorts
|
45
|
+
- def self.kill_forwarded_ports(env, env_hash)
|
46
|
+
- get_pidfiles_for_machine(env_hash[:machine]).each do |pidfile|
|
47
|
+
- kill_ssh_tunnel(env, pidfile, env_hash)
|
48
|
+
- end
|
49
|
+
- end
|
50
|
+
-
|
51
|
+
- # exposed but not called currently from any action
|
52
|
+
def self.kill_ssh_tunnel(env, pidfile, env_hash)
|
53
|
+
- logger = create_logger
|
54
|
+
- machine = env_hash[:machine]
|
55
|
+
- pid = read_pid(File.join(machine.data_dir, pidfile))
|
56
|
+
+ logger = Log4r::Logger.new("vagrant::hosts::bsd")
|
57
|
+
+ pidfile = File.join(env_hash[:machine].data_dir, pidfile)
|
58
|
+
+ pid = read_pid(pidfile)
|
59
|
+
if pid && autossh_pid?(pid)
|
60
|
+
Vagrant::Util::Subprocess.execute("kill", pid.to_s)
|
61
|
+
else
|
62
|
+
@@ -49,26 +46,17 @@
|
63
|
+
end
|
64
|
+
end
|
65
|
+
|
66
|
+
- ####################################
|
67
|
+
+ private
|
68
|
+
|
69
|
+
- def self.pidfile_name(fp)
|
70
|
+
- "#{fp[:host_ip]}.pid"
|
71
|
+
+ def self.pidfile_name(port, env_hash)
|
72
|
+
+ tunnel_name = [port[:hostip], port[:name]].compact.join('_')
|
73
|
+
+ File.join(env_hash[:machine].data_dir, "#{tunnel_name}.pid")
|
74
|
+
end
|
75
|
+
|
76
|
+
- def self.read_pid(pidfile_path)
|
77
|
+
- File.read(pidfile_path).presence.try(:to_i) if File.exist?(pidfile_path)
|
78
|
+
+ def self.read_pid(pidfile)
|
79
|
+
+ File.read(pidfile).presence.try(:to_i) if File.exist?(pidfile)
|
80
|
+
end
|
81
|
+
|
82
|
+
- def self.get_pidfiles_for_machine(machine)
|
83
|
+
- pidfiles = []
|
84
|
+
- Vagrant::Util::SafeChdir.safe_chdir(machine.data_dir) do
|
85
|
+
- pidfiles = Dir.glob("*.pid")
|
86
|
+
- end
|
87
|
+
- pidfiles
|
88
|
+
- end
|
89
|
+
-
|
90
|
+
- ####################################
|
91
|
+
-
|
92
|
+
# Checks that the pid is actually an autossh process (and not
|
93
|
+
# something else using a recycled pid).
|
94
|
+
def self.autossh_pid?(pid)
|
95
|
+
@@ -77,16 +65,23 @@
|
96
|
+
end
|
97
|
+
|
98
|
+
# Get the command, minus any arguments, for the given
|
99
|
+
- # pid. This probably needs to be overridden per host cap
|
100
|
+
+ # pid. I don't expect this to be compatible cross-platform yet...
|
101
|
+
+ # This could be complicated cross-platform, and Sys::ProcTable
|
102
|
+
+ # could likewise be complicated cross-platform ...
|
103
|
+
def self.get_comm_for_pid(pid)
|
104
|
+
result = Vagrant::Util::Subprocess.execute("ps", "-p", pid.to_s, "-o", "comm")
|
105
|
+
result.stdout.split("\n").last
|
106
|
+
end
|
107
|
+
|
108
|
+
- ####################################
|
109
|
+
+ def self.read_forwarded_ports(env, env_hash, machine = nil)
|
110
|
+
+ logger = create_logger
|
111
|
+
+ machine ||= env_hash[:machine]
|
112
|
+
+ get_pidfiles_for_machine(machine).collect do |pidfile|
|
113
|
+
+ read_pid(File.join(machine.data_dir, pidfile))
|
114
|
+
+ end
|
115
|
+
+ end
|
116
|
+
|
117
|
+
- def self.autossh_args(fp, pidfile, env_hash)
|
118
|
+
- machine = env_hash[:machine]
|
119
|
+
+ def self.autossh_args(port, pidfile, env_hash)
|
120
|
+
ssh_info = env_hash[:machine_ssh_info]
|
121
|
+
ssh_options = {
|
122
|
+
"ServerAliveInterval" => 10,
|
123
|
+
@@ -96,16 +91,22 @@
|
124
|
+
environment_variables = {
|
125
|
+
env: {
|
126
|
+
"AUTOSSH_PIDFILE" => pidfile,
|
127
|
+
- "AUTOSSH_PORT" => 0, # turn off monitoring
|
128
|
+
+ "AUTOSSH_PORT" => 0, # turns off monitoring
|
129
|
+
+ #"AUTOSSH_LOGFILE" => "./autossh.log",
|
130
|
+
}
|
131
|
+
}
|
132
|
+
+ forward_string = [
|
133
|
+
+ port[:hostport],
|
134
|
+
+ "localhost",
|
135
|
+
+ port[:guestport]
|
136
|
+
+ ].join(':')
|
137
|
+
|
138
|
+
autossh_args = []
|
139
|
+
autossh_args << "-q"
|
140
|
+
autossh_args << "-N"
|
141
|
+
autossh_args << "-f"
|
142
|
+
- autossh_args << "-i" << machine.data_dir.join("private_key").to_s
|
143
|
+
- autossh_args << "-L" << "#{fp[:host_port]}:localhost:#{fp[:guest_port]}"
|
144
|
+
+ autossh_args << "-i" << env_hash[:machine].data_dir.join("private_key").to_s
|
145
|
+
+ autossh_args << "-L" << forward_string
|
146
|
+
ssh_options.each do |k, v|
|
147
|
+
autossh_args << "-o" << "#{k}=#{v}"
|
148
|
+
end
|
@@ -0,0 +1,239 @@
|
|
1
|
+
# HG changeset patch
|
2
|
+
# Parent 74d169c04caec5d9ccb8355c531b767d9225cf95
|
3
|
+
diff -r 74d169c04cae -r 5e40023c756c Vagrantfile
|
4
|
+
--- a/Vagrantfile Tue Jan 12 14:38:22 2016 -0800
|
5
|
+
+++ b/Vagrantfile Tue Jan 12 18:07:03 2016 -0800
|
6
|
+
@@ -120,12 +120,12 @@
|
7
|
+
box.ssh.password = vms[vm1_key][:password]
|
8
|
+
box.vm.communicator = vms[vm1_key][:communicator]
|
9
|
+
#box.vm.synced_folder "vm1", "/synced", type: :nfs, mount_options: ['actimeo=1']
|
10
|
+
- box.vm.synced_folder ".", "/vagrant-skytap", type: :nfs, mount_options: ['actimeo=1']
|
11
|
+
+ #box.vm.synced_folder ".", "/vagrant-skytap", type: :nfs, mount_options: ['actimeo=1']
|
12
|
+
#box.vm.provision "shell", path: "provisioning/trivial.sh"
|
13
|
+
box.vm.provision "shell", path: "provisioning/apache.sh"
|
14
|
+
box.vm.provision "shell", path: "provisioning/vagrant.sh"
|
15
|
+
|
16
|
+
- #box.vm.network :forwarded_port, guest: 80, host: 9000
|
17
|
+
+ box.vm.network :forwarded_port, guest: 80, host: 9000
|
18
|
+
#box.vm.network :forwarded_port, guest: 21, host: 9001
|
19
|
+
end
|
20
|
+
|
21
|
+
diff -r 74d169c04cae -r 5e40023c756c lib/vagrant-skytap/action/clear_forwarded_ports.rb
|
22
|
+
--- a/lib/vagrant-skytap/action/clear_forwarded_ports.rb Tue Jan 12 14:38:22 2016 -0800
|
23
|
+
+++ b/lib/vagrant-skytap/action/clear_forwarded_ports.rb Tue Jan 12 18:07:03 2016 -0800
|
24
|
+
@@ -8,12 +8,11 @@
|
25
|
+
class ClearForwardedPorts
|
26
|
+
def initialize(app, env)
|
27
|
+
@app = app
|
28
|
+
- @env = env
|
29
|
+
end
|
30
|
+
|
31
|
+
def call(env)
|
32
|
+
env[:ui].info I18n.t("vagrant.actions.vm.clear_forward_ports.deleting")
|
33
|
+
- pidfiles = @env[:host].capability(:kill_forwarded_ports, @env)
|
34
|
+
+ env[:host].capability(:kill_forwarded_ports, env)
|
35
|
+
|
36
|
+
@app.call(env)
|
37
|
+
end
|
38
|
+
diff -r 74d169c04cae -r 5e40023c756c lib/vagrant-skytap/action/prepare_forwarded_port_collision_params.rb
|
39
|
+
--- a/lib/vagrant-skytap/action/prepare_forwarded_port_collision_params.rb Tue Jan 12 14:38:22 2016 -0800
|
40
|
+
+++ b/lib/vagrant-skytap/action/prepare_forwarded_port_collision_params.rb Tue Jan 12 18:07:03 2016 -0800
|
41
|
+
@@ -1,3 +1,4 @@
|
42
|
+
+require 'byebug'
|
43
|
+
module VagrantPlugins
|
44
|
+
module Skytap
|
45
|
+
module Action
|
46
|
+
@@ -9,22 +10,23 @@
|
47
|
+
def call(env)
|
48
|
+
# Get the forwarded ports used by other virtual machines and
|
49
|
+
# consider those in use as well.
|
50
|
+
- env[:port_collision_extra_in_use] = @env[:host].capability(:read_used_ports, @env)
|
51
|
+
+ env[:port_collision_extra_in_use] = env[:host].capability(:read_used_ports, env)
|
52
|
+
|
53
|
+
# Build the remap for any existing collision detections
|
54
|
+
remap = {}
|
55
|
+
env[:port_collision_remap] = remap
|
56
|
+
- env[:host].capability(:read_forwarded_ports, env).each do |_nic, name, hostport, _guestport|
|
57
|
+
+ env[:host].capability(:read_forwarded_ports, env).each do |name, hostport|
|
58
|
+
env[:machine].config.vm.networks.each do |type, options|
|
59
|
+
next if type != :forwarded_port
|
60
|
+
|
61
|
+
# If the ID matches the name of the forwarded port, then remap.
|
62
|
+
if options[:id] == name
|
63
|
+
- remap[options[:host]] = hostport
|
64
|
+
+ remap[options[:host]] = hostport # what happens with 'ssh' ?????
|
65
|
+
break
|
66
|
+
end
|
67
|
+
end
|
68
|
+
end
|
69
|
+
+# debugger
|
70
|
+
|
71
|
+
@app.call(env)
|
72
|
+
end
|
73
|
+
@@ -32,3 +34,6 @@
|
74
|
+
end
|
75
|
+
end
|
76
|
+
end
|
77
|
+
+
|
78
|
+
+#[_nic,ssh, 2222,22]
|
79
|
+
+#[_nic,tcp3001,3001,3001]
|
80
|
+
diff -r 74d169c04cae -r 5e40023c756c lib/vagrant-skytap/hosts/bsd/cap/ssh_tunnel.rb
|
81
|
+
--- a/lib/vagrant-skytap/hosts/bsd/cap/ssh_tunnel.rb Tue Jan 12 14:38:22 2016 -0800
|
82
|
+
+++ b/lib/vagrant-skytap/hosts/bsd/cap/ssh_tunnel.rb Tue Jan 12 18:07:03 2016 -0800
|
83
|
+
@@ -4,7 +4,7 @@
|
84
|
+
module Skytap
|
85
|
+
module HostBSD
|
86
|
+
module Cap
|
87
|
+
- class SSHTunnel < VagrantPlugins::Skytap::Common::Cap::SSHTunnel
|
88
|
+
+ class SSHTunnel < VagrantPlugins::Skytap::HostCommon::Cap::SSHTunnel
|
89
|
+
def self.create_logger
|
90
|
+
Log4r::Logger.new("vagrant::hosts::bsd")
|
91
|
+
end
|
92
|
+
diff -r 74d169c04cae -r 5e40023c756c lib/vagrant-skytap/hosts/common/cap/ssh_tunnel.rb
|
93
|
+
--- a/lib/vagrant-skytap/hosts/common/cap/ssh_tunnel.rb Tue Jan 12 14:38:22 2016 -0800
|
94
|
+
+++ b/lib/vagrant-skytap/hosts/common/cap/ssh_tunnel.rb Tue Jan 12 18:07:03 2016 -0800
|
95
|
+
@@ -19,18 +19,25 @@
|
96
|
+
# called per port by ForwardPorts
|
97
|
+
def self.start_ssh_tunnel(env, fp, env_hash)
|
98
|
+
logger = create_logger
|
99
|
+
- machine = env_hash[:machine]
|
100
|
+
- pid = read_pid(File.join(machine.data_dir, pidfile_name(fp)))
|
101
|
+
- if pid && autossh_pid?(pid)
|
102
|
+
- logger.info("An autossh process already exists with pid #{pid}.")
|
103
|
+
- else
|
104
|
+
- args = autossh_args(fp, pidfile, env_hash)
|
105
|
+
- Vagrant::Util::Subprocess.execute("autossh", *args)
|
106
|
+
+ pidfile = File.join(env_hash[:machine].data_dir, pidfile_name(fp))
|
107
|
+
+ if pid = read_pid(pidfile)
|
108
|
+
+ debugger
|
109
|
+
+ if autossh_pid?(pid)
|
110
|
+
+ logger.info("An autossh process already exists with pid #{pid}.")
|
111
|
+
+ return
|
112
|
+
+ else
|
113
|
+
+ logger.info("Cleaning up stale autossh pidfile #{pidfile}.")
|
114
|
+
+ Vagrant::Util::Subprocess.execute("rm", pidfile)
|
115
|
+
+ end
|
116
|
+
end
|
117
|
+
+ debugger
|
118
|
+
+ args = autossh_args(fp, env_hash)
|
119
|
+
+ Vagrant::Util::Subprocess.execute("autossh", *args)
|
120
|
+
end
|
121
|
+
|
122
|
+
# called for machine by ClearForwardedPorts
|
123
|
+
def self.kill_forwarded_ports(env, env_hash)
|
124
|
+
+# debugger
|
125
|
+
get_pidfiles_for_machine(env_hash[:machine]).each do |pidfile|
|
126
|
+
kill_ssh_tunnel(env, pidfile, env_hash)
|
127
|
+
end
|
128
|
+
@@ -40,33 +47,48 @@
|
129
|
+
def self.kill_ssh_tunnel(env, pidfile, env_hash)
|
130
|
+
logger = create_logger
|
131
|
+
machine = env_hash[:machine]
|
132
|
+
- pid = read_pid(File.join(machine.data_dir, pidfile))
|
133
|
+
- if pid && autossh_pid?(pid)
|
134
|
+
- Vagrant::Util::Subprocess.execute("kill", pid.to_s)
|
135
|
+
+ pidfile = File.join(machine.data_dir, pidfile)
|
136
|
+
+ if pid = read_pid(pidfile)
|
137
|
+
+ debugger
|
138
|
+
+ if autossh_pid?(pid)
|
139
|
+
+ myenv = {env: {"AUTOSSH_PIDFILE" => pidfile}}
|
140
|
+
+ Vagrant::Util::Subprocess.execute("kill", pid.to_s, myenv)
|
141
|
+
+ else
|
142
|
+
+ logger.info("Cleaning up stale autossh pidfile #{pidfile}.")
|
143
|
+
+ Vagrant::Util::Subprocess.execute("rm", pidfile)
|
144
|
+
+ end
|
145
|
+
else
|
146
|
+
- logger.info("Cleaning up stale autossh pidfile #{pidfile}.")
|
147
|
+
- Vagrant::Util::Subprocess.execute("rm", pidfile)
|
148
|
+
+ debugger
|
149
|
+
+ logger.info("Pidfile #{pidfile} not found.")
|
150
|
+
end
|
151
|
+
end
|
152
|
+
|
153
|
+
####################################
|
154
|
+
|
155
|
+
- def self.read_forwarded_ports(env, env_hash, machine = nil)
|
156
|
+
- logger = create_logger
|
157
|
+
- machine ||= env_hash[:machine]
|
158
|
+
+ # forwarded ports used by ALL OTHER machines
|
159
|
+
+ def self.read_used_ports(env, env_hash)
|
160
|
+
+ # pretend for the moment that we don't care
|
161
|
+
+ []
|
162
|
+
+ end
|
163
|
+
+
|
164
|
+
+ # forwarded ports used by THIS machine
|
165
|
+
+ def self.read_forwarded_ports(env, env_hash)
|
166
|
+
+ machine = env_hash[:machine]
|
167
|
+
get_pidfiles_for_machine(machine).collect do |pidfile|
|
168
|
+
- read_pid(File.join(machine.data_dir, pidfile))
|
169
|
+
+ pidfile =~ /(.*)(\d+)/
|
170
|
+
+ [pidfile,$2]
|
171
|
+
end
|
172
|
+
end
|
173
|
+
|
174
|
+
####################################
|
175
|
+
|
176
|
+
def self.pidfile_name(fp)
|
177
|
+
- "#{fp[:host_ip]}.pid"
|
178
|
+
+ # there's one that's just named ssh, what do we do about it?
|
179
|
+
+ "#{fp.protocol}#{fp.host_port}.pid"
|
180
|
+
end
|
181
|
+
|
182
|
+
- def self.read_pid(pidfile_path)
|
183
|
+
- File.read(pidfile_path).presence.try(:to_i) if File.exist?(pidfile_path)
|
184
|
+
+ def self.read_pid(pidfile)
|
185
|
+
+ File.read(pidfile).presence.try(:to_i) if File.exist?(pidfile)
|
186
|
+
end
|
187
|
+
|
188
|
+
def self.get_pidfiles_for_machine(machine)
|
189
|
+
@@ -95,7 +117,7 @@
|
190
|
+
|
191
|
+
####################################
|
192
|
+
|
193
|
+
- def self.autossh_args(fp, pidfile, env_hash)
|
194
|
+
+ def self.autossh_args(fp, env_hash)
|
195
|
+
machine = env_hash[:machine]
|
196
|
+
ssh_info = env_hash[:machine_ssh_info]
|
197
|
+
ssh_options = {
|
198
|
+
@@ -105,7 +127,7 @@
|
199
|
+
}
|
200
|
+
environment_variables = {
|
201
|
+
env: {
|
202
|
+
- "AUTOSSH_PIDFILE" => pidfile,
|
203
|
+
+ "AUTOSSH_PIDFILE" => File.join(machine.data_dir, pidfile_name(fp)),
|
204
|
+
"AUTOSSH_PORT" => 0, # turn off monitoring
|
205
|
+
}
|
206
|
+
}
|
207
|
+
@@ -115,7 +137,7 @@
|
208
|
+
autossh_args << "-N"
|
209
|
+
autossh_args << "-f"
|
210
|
+
autossh_args << "-i" << machine.data_dir.join("private_key").to_s
|
211
|
+
- autossh_args << "-L" << "#{fp[:host_port]}:localhost:#{fp[:guest_port]}"
|
212
|
+
+ autossh_args << "-L" << "#{fp.host_port}:localhost:#{fp.guest_port}"
|
213
|
+
ssh_options.each do |k, v|
|
214
|
+
autossh_args << "-o" << "#{k}=#{v}"
|
215
|
+
end
|
216
|
+
diff -r 74d169c04cae -r 5e40023c756c lib/vagrant-skytap/hosts/linux/cap/ssh_tunnel.rb
|
217
|
+
--- a/lib/vagrant-skytap/hosts/linux/cap/ssh_tunnel.rb Tue Jan 12 14:38:22 2016 -0800
|
218
|
+
+++ b/lib/vagrant-skytap/hosts/linux/cap/ssh_tunnel.rb Tue Jan 12 18:07:03 2016 -0800
|
219
|
+
@@ -4,7 +4,7 @@
|
220
|
+
module Skytap
|
221
|
+
module HostLinux
|
222
|
+
module Cap
|
223
|
+
- class SSHTunnel < VagrantPlugins::Skytap::Common::Cap::SSHTunnel
|
224
|
+
+ class SSHTunnel < VagrantPlugins::Skytap::HostCommon::Cap::SSHTunnel
|
225
|
+
def self.create_logger
|
226
|
+
Log4r::Logger.new("vagrant::hosts::linux")
|
227
|
+
end
|
228
|
+
diff -r 74d169c04cae -r 5e40023c756c lib/vagrant-skytap/hosts/windows/cap/ssh_tunnel.rb
|
229
|
+
--- a/lib/vagrant-skytap/hosts/windows/cap/ssh_tunnel.rb Tue Jan 12 14:38:22 2016 -0800
|
230
|
+
+++ b/lib/vagrant-skytap/hosts/windows/cap/ssh_tunnel.rb Tue Jan 12 18:07:03 2016 -0800
|
231
|
+
@@ -4,7 +4,7 @@
|
232
|
+
module Skytap
|
233
|
+
module HostWindows
|
234
|
+
module Cap
|
235
|
+
- class SSHTunnel < VagrantPlugins::Skytap::Common::Cap::SSHTunnel
|
236
|
+
+ class SSHTunnel < VagrantPlugins::Skytap::HostCommon::Cap::SSHTunnel
|
237
|
+
def self.create_logger
|
238
|
+
Log4r::Logger.new("vagrant::hosts::windows")
|
239
|
+
end
|
@@ -0,0 +1,29 @@
|
|
1
|
+
# HG changeset patch
|
2
|
+
# Parent e03c705cadffcf6ca578330597f15624260a9d46
|
3
|
+
script to run acceptance tests
|
4
|
+
|
5
|
+
diff --git a/acceptance.sh b/acceptance.sh
|
6
|
+
new file mode 100755
|
7
|
+
--- /dev/null
|
8
|
+
+++ b/acceptance.sh
|
9
|
+
@@ -0,0 +1,20 @@
|
10
|
+
+#!/bin/bash
|
11
|
+
+
|
12
|
+
+VAGRANT_LOG=info \
|
13
|
+
+VAGRANT_SKYTAP_USERNAME=etrue \
|
14
|
+
+VAGRANT_SKYTAP_API_TOKEN=fcb2620b72efddbc8239e25db9d812f510c7e166 \
|
15
|
+
+ rake acceptance:run \
|
16
|
+
+ COMPONENTS=provider/skytap/up
|
17
|
+
+
|
18
|
+
+#VAGRANT_SKYTAP_USERNAME=vagrant_provider_admin \
|
19
|
+
+#VAGRANT_SKYTAP_API_TOKEN=7c5718531a32eb90e92c804ce1f73da98be22cdf \
|
20
|
+
+#VAGRANT_SKYTAP_BASE_URL=https://test.skytap.com/ \
|
21
|
+
+
|
22
|
+
+
|
23
|
+
+
|
24
|
+
+#vagrant-spec test --config=vagrant-spec.config.rb --components="$COMPONENTS"
|
25
|
+
+
|
26
|
+
+
|
27
|
+
+# How do I get log output??
|
28
|
+
+# This needs to run in vagrant-spec, not just rake. Boxes have
|
29
|
+
+# to install.
|
@@ -0,0 +1,92 @@
|
|
1
|
+
# HG changeset patch
|
2
|
+
# Parent 0bb10bac847b6ff55e16bc18e9e9e98b49f58444
|
3
|
+
try to get sbrady's ansible provisioning (codename: "chuck") to work
|
4
|
+
|
5
|
+
diff --git a/Vagrantfile.chuck b/Vagrantfile.chuck
|
6
|
+
new file mode 100644
|
7
|
+
--- /dev/null
|
8
|
+
+++ b/Vagrantfile.chuck
|
9
|
+
@@ -0,0 +1,55 @@
|
10
|
+
+# -*- mode: ruby -*-
|
11
|
+
+# vi: set ft=ruby :
|
12
|
+
+
|
13
|
+
+VM_CPU = 4 # Cores
|
14
|
+
+VM_RAM = 4096 # GB
|
15
|
+
+GENERIC_UBUNTU = 'https://cloud.skytap.com/vms/6869434'
|
16
|
+
+
|
17
|
+
+Vagrant.configure("2") do |config|
|
18
|
+
+
|
19
|
+
+ config.vm.provider :skytap do |skytap, override|
|
20
|
+
+ skytap.username = "etrue"
|
21
|
+
+ skytap.api_token = "fcb2620b72efddbc8239e25db9d812f510c7e166"
|
22
|
+
+ end
|
23
|
+
+
|
24
|
+
+ config.vm.define :dev do |dev|
|
25
|
+
+ # VMWare and VirtualBox
|
26
|
+
+ # https://vagrantcloud.com/hashicorp/boxes/precise64
|
27
|
+
+ # TODO how to specify different box files for skytap provider
|
28
|
+
+ #dev.vm.box = "hashicorp/precise64"
|
29
|
+
+ #dev.vm.box_url = "hashicorp/precise64"
|
30
|
+
+
|
31
|
+
+
|
32
|
+
+ # dev.vm.network :private_network, ip: "10.10.10.5"
|
33
|
+
+ dev.vm.network :private_network, ip: "10.1.130.252"
|
34
|
+
+ dev.vm.network :forwarded_port, guest: 3001, host: 3001
|
35
|
+
+ dev.vm.network :forwarded_port, guest: 1080, host: 1080
|
36
|
+
+
|
37
|
+
+ dev.vm.synced_folder "~/src", "/var/www/skytap", :nfs => true, :mount_options => ['actimeo=1']
|
38
|
+
+
|
39
|
+
+ dev.vm.provider :vmware_fusion do |box|
|
40
|
+
+ box.vmx["memsize"] = VM_RAM
|
41
|
+
+ box.vmx["numvcpus"] = VM_CPU
|
42
|
+
+ end
|
43
|
+
+
|
44
|
+
+ dev.vm.provider :virtualbox do |box|
|
45
|
+
+ box.customize ["modifyvm", :id, "--memory", VM_RAM]
|
46
|
+
+ box.customize ["modifyvm", :id, "--cpus", VM_CPU]
|
47
|
+
+ box.customize ["modifyvm", :id, "--ioapic", "on"]
|
48
|
+
+ end
|
49
|
+
+
|
50
|
+
+ dev.vm.provider :skytap do |box|
|
51
|
+
+ dev.vm.box = "skytap-dummy"
|
52
|
+
+ box.vm_url = GENERIC_UBUNTU
|
53
|
+
+ box.cpus = VM_CPU
|
54
|
+
+ box.ram = VM_RAM
|
55
|
+
+ box.guestos = "ubuntu"
|
56
|
+
+ end
|
57
|
+
+
|
58
|
+
+ dev.vm.provision :ansible do |ansible|
|
59
|
+
+ ansible.playbook = "ansible/playbooks/webservers.yml"
|
60
|
+
+ # with the skytap provider, let it generate the inventory (.vagrant/provisioners/..)
|
61
|
+
+ #ansible.inventory_path = "ansible/environments/dev"
|
62
|
+
+ end
|
63
|
+
+ end
|
64
|
+
+end
|
65
|
+
diff --git a/ansible b/ansible
|
66
|
+
new file mode 120000
|
67
|
+
--- /dev/null
|
68
|
+
+++ b/ansible
|
69
|
+
@@ -0,0 +1,1 @@
|
70
|
+
+../chuck/ansible
|
71
|
+
|
72
|
+
diff --git a/ansible.cfg b/ansible.cfg
|
73
|
+
new file mode 120000
|
74
|
+
--- /dev/null
|
75
|
+
+++ b/ansible.cfg
|
76
|
+
@@ -0,0 +1,1 @@
|
77
|
+
+../chuck/ansible.cfg
|
78
|
+
|
79
|
+
diff --git a/rake b/rake
|
80
|
+
new file mode 120000
|
81
|
+
--- /dev/null
|
82
|
+
+++ b/rake
|
83
|
+
@@ -0,0 +1,1 @@
|
84
|
+
+../chuck/rake
|
85
|
+
|
86
|
+
diff --git a/rakefile.rb b/rakefile.rb
|
87
|
+
new file mode 120000
|
88
|
+
--- /dev/null
|
89
|
+
+++ b/rakefile.rb
|
90
|
+
@@ -0,0 +1,1 @@
|
91
|
+
+../chuck/rakefile.rb
|
92
|
+
|
@@ -0,0 +1,40 @@
|
|
1
|
+
# HG changeset patch
|
2
|
+
# Parent 1397b5a1cf5158f68afa12477b1de4101b8da248
|
3
|
+
[mq]: cache-api-client-in-up
|
4
|
+
|
5
|
+
diff -r 1397b5a1cf51 lib/vagrant-skytap/action/initialize_api_client.rb
|
6
|
+
--- a/lib/vagrant-skytap/action/initialize_api_client.rb Mon Dec 07 19:47:09 2015 -0800
|
7
|
+
+++ b/lib/vagrant-skytap/action/initialize_api_client.rb Wed Dec 09 16:03:46 2015 -0800
|
8
|
+
@@ -13,11 +13,15 @@
|
9
|
+
end
|
10
|
+
|
11
|
+
def call(env)
|
12
|
+
- @logger.info("Connecting to Skytap...")
|
13
|
+
+ unless env[:api_client]
|
14
|
+
+ @logger.info("Connecting to Skytap...")
|
15
|
+
|
16
|
+
- client = API::Client.new(env[:machine].provider_config)
|
17
|
+
- if client.get('/configurations').code == '200'
|
18
|
+
- env[:api_client] = client
|
19
|
+
+ client = API::Client.new(env[:machine].provider_config)
|
20
|
+
+ if client.get('/configurations').code == '200'
|
21
|
+
+ env[:api_client] = client
|
22
|
+
+ end
|
23
|
+
+ else
|
24
|
+
+ @logger.info("Using cached API client")
|
25
|
+
end
|
26
|
+
|
27
|
+
@app.call(env)
|
28
|
+
diff -r 1397b5a1cf51 lib/vagrant-skytap/command/up.rb
|
29
|
+
--- a/lib/vagrant-skytap/command/up.rb Mon Dec 07 19:47:09 2015 -0800
|
30
|
+
+++ b/lib/vagrant-skytap/command/up.rb Wed Dec 09 16:03:46 2015 -0800
|
31
|
+
@@ -76,7 +76,8 @@
|
32
|
+
provider: machine.provider_name))
|
33
|
+
|
34
|
+
machines << machine
|
35
|
+
- machine.action(:create, options)
|
36
|
+
+ result = machine.action(:create, options)
|
37
|
+
+ options[:api_client] ||= result[:api_client]
|
38
|
+
machine.action(:update_hardware, options)
|
39
|
+
end
|
40
|
+
|
@@ -0,0 +1,44 @@
|
|
1
|
+
# HG changeset patch
|
2
|
+
# Parent 376d225699f6e5edced626762b20690f8a86e566
|
3
|
+
remove dead code in actions.rb
|
4
|
+
|
5
|
+
diff -r 376d225699f6 -r 57b84d076d7f lib/vagrant-skytap/action.rb
|
6
|
+
--- a/lib/vagrant-skytap/action.rb Tue Oct 20 13:31:40 2015 -0700
|
7
|
+
+++ b/lib/vagrant-skytap/action.rb Tue Oct 20 13:31:55 2015 -0700
|
8
|
+
@@ -86,17 +86,11 @@
|
9
|
+
b.use FetchEnvironment
|
10
|
+
b.use Call, EnvironmentExists do |env, b2|
|
11
|
+
if env[:result]
|
12
|
+
- b2.use Call, RunEnvironment do |env2, b3|
|
13
|
+
- if env2[:result]
|
14
|
+
- b3.use PrepareNFSSettings
|
15
|
+
- b3.use PrepareNFSValidIds
|
16
|
+
- b3.use Provision
|
17
|
+
- b3.use SyncedFolders
|
18
|
+
- else
|
19
|
+
- #TODO:NLA IMPLEMENT ME
|
20
|
+
- # b2.use RunFailed
|
21
|
+
- end
|
22
|
+
- end
|
23
|
+
+ b2.use RunEnvironment
|
24
|
+
+ b2.use PrepareNFSSettings
|
25
|
+
+ b2.use PrepareNFSValidIds
|
26
|
+
+ b2.use Provision
|
27
|
+
+ b2.use SyncedFolders
|
28
|
+
else
|
29
|
+
b2.use DeleteEnvironment
|
30
|
+
b2.use MessageNotCreated
|
31
|
+
@@ -217,12 +211,7 @@
|
32
|
+
end
|
33
|
+
end
|
34
|
+
b.use action_prepare_boot
|
35
|
+
- b.use Call, RunVm do |env, b1|
|
36
|
+
- unless env[:result]
|
37
|
+
- #TODO:NLA IMPLEMENT ME
|
38
|
+
- # b2.use RunFailed
|
39
|
+
- end
|
40
|
+
- end
|
41
|
+
+ b.use RunVm
|
42
|
+
end
|
43
|
+
end
|
44
|
+
|