vagrant-skytap 0.2.2 → 0.2.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/vagrant-skytap/action/add_vm_to_environment.rb +4 -4
- data/lib/vagrant-skytap/action/compose_environment.rb +131 -0
- data/lib/vagrant-skytap/action/create_environment.rb +3 -1
- data/lib/vagrant-skytap/action/initialize_api_client.rb +6 -5
- data/lib/vagrant-skytap/action/set_up_vm.rb +3 -1
- data/lib/vagrant-skytap/action/store_extra_data.rb +4 -2
- data/lib/vagrant-skytap/action.rb +4 -17
- data/lib/vagrant-skytap/api/environment.rb +53 -25
- data/lib/vagrant-skytap/api/vm.rb +9 -3
- data/lib/vagrant-skytap/command/up.rb +46 -30
- data/lib/vagrant-skytap/errors.rb +4 -0
- data/lib/vagrant-skytap/version.rb +1 -1
- data/locales/en.yml +5 -1
- data/spec/unit/actions/compose_environment_spec.rb +101 -0
- data/spec/unit/environment_spec.rb +26 -45
- data/spec/unit/support/shared/skytap_context.rb +5 -0
- data/vagrant-skytap.gemspec +3 -3
- metadata +9 -311
- data/.byebug_history +0 -256
- data/.project +0 -11
- data/_patches-20160112/0 +0 -388
- data/_patches-20160112/1 +0 -82
- data/_patches-20160112/2 +0 -239
- data/_patches-20160112/COMPLETED-ABOVE-THIS-LINE +0 -4
- data/_patches-20160112/COMPLETED-BELOW-THIS-LINE +0 -4
- data/_patches-20160112/CR-ABOVE-THIS-LINE +0 -4
- data/_patches-20160112/CR-BELOW-THIS-LINE +0 -4
- data/_patches-20160112/WIP-ABOVE-THIS-LINE +0 -4
- data/_patches-20160112/WIP-BELOW-THIS-LINE +0 -4
- data/_patches-20160112/acceptance-test-runner +0 -29
- data/_patches-20160112/ansible-1 +0 -92
- data/_patches-20160112/cache-api-client-in-up +0 -40
- data/_patches-20160112/dead-code-in-actions +0 -44
- data/_patches-20160112/debug-changes +0 -42
- data/_patches-20160112/demo-rails-app +0 -1276
- data/_patches-20160112/eng-10166-halt-spec +0 -40
- data/_patches-20160112/eng-10256 +0 -527
- data/_patches-20160112/eng-10256-2 +0 -162
- data/_patches-20160112/eng-10256-ubuntu-testing +0 -88
- data/_patches-20160112/eng-10269-test-stuff +0 -87
- data/_patches-20160112/eng-10269-wtf +0 -119
- data/_patches-20160112/eng-10369 +0 -143
- data/_patches-20160112/eng-10369-tmp +0 -60
- data/_patches-20160112/eng-10919 +0 -56
- data/_patches-20160112/eng-11177-fix-actions-requires +0 -44
- data/_patches-20160112/eng-11442 +0 -4
- data/_patches-20160112/eng-11616 +0 -403
- data/_patches-20160112/eng-11616-2 +0 -67
- data/_patches-20160112/eng-11616-actual +0 -184
- data/_patches-20160112/eng-11625a +0 -4
- data/_patches-20160112/eng-11711 +0 -85
- data/_patches-20160112/eng-12232-command-spec +0 -236
- data/_patches-20160112/eng-12235 +0 -83
- data/_patches-20160112/eng-12235-override-refactor +0 -140
- data/_patches-20160112/eng-12240 +0 -103
- data/_patches-20160112/eng-12249 +0 -40
- data/_patches-20160112/eng-12301 +0 -50
- data/_patches-20160112/eng-12843 +0 -95
- data/_patches-20160112/env-source +0 -112
- data/_patches-20160112/frickin-vagrant-spec +0 -163
- data/_patches-20160112/gem-pre-version +0 -14
- data/_patches-20160112/gems-old +0 -9
- data/_patches-20160112/googles-specs +0 -713
- data/_patches-20160112/local-configs-ignore +0 -61
- data/_patches-20160112/misc +0 -79
- data/_patches-20160112/network-unreachable +0 -31
- data/_patches-20160112/new-boxfile +0 -288
- data/_patches-20160112/parallelization-maybe +0 -198
- data/_patches-20160112/read-state +0 -23
- data/_patches-20160112/refactor-to-use-public_address-cap +0 -25
- data/_patches-20160112/series +0 -60
- data/_patches-20160112/status +0 -12
- data/_patches-20160112/test-move-env-data +0 -231
- data/_patches-20160112/test-vagrantfile-vm1 +0 -167
- data/_patches-20160112/the_version_in_0.1.13.pre1 +0 -598
- data/_patches-20160112/vagrant-spec-mock-api +0 -137
- data/_patches-20160112/vagrant-vmware-plugin +0 -233
- data/_patches-20160112/vagrantfile +0 -403
- data/_patches-20160112/vagrantfile-for-acceptance-tests +0 -29
- data/_patches-20160112/vagrantfile-for-nick +0 -95
- data/_patches-20160112/vagrantfiles-to-forget-what-they-are-for +0 -134
- data/_patches-20160112/vm-vanished +0 -42
- data/_patches-20160112a/01 +0 -148
- data/_patches-20160112a/2 +0 -239
- data/_patches-20160112a/COMPLETED-ABOVE-THIS-LINE +0 -4
- data/_patches-20160112a/COMPLETED-BELOW-THIS-LINE +0 -4
- data/_patches-20160112a/CR-ABOVE-THIS-LINE +0 -4
- data/_patches-20160112a/CR-BELOW-THIS-LINE +0 -4
- data/_patches-20160112a/WIP-ABOVE-THIS-LINE +0 -4
- data/_patches-20160112a/WIP-BELOW-THIS-LINE +0 -4
- data/_patches-20160112a/acceptance-test-runner +0 -29
- data/_patches-20160112a/ansible-1 +0 -92
- data/_patches-20160112a/cache-api-client-in-up +0 -40
- data/_patches-20160112a/dead-code-in-actions +0 -44
- data/_patches-20160112a/debug-changes +0 -42
- data/_patches-20160112a/demo-rails-app +0 -1276
- data/_patches-20160112a/eng-10166-halt-spec +0 -40
- data/_patches-20160112a/eng-10256-ubuntu-testing +0 -88
- data/_patches-20160112a/eng-10269-test-stuff +0 -87
- data/_patches-20160112a/eng-10269-wtf +0 -119
- data/_patches-20160112a/eng-10369 +0 -143
- data/_patches-20160112a/eng-10369-tmp +0 -60
- data/_patches-20160112a/eng-10919 +0 -56
- data/_patches-20160112a/eng-11177-fix-actions-requires +0 -44
- data/_patches-20160112a/eng-11442 +0 -4
- data/_patches-20160112a/eng-11616 +0 -403
- data/_patches-20160112a/eng-11616-2 +0 -67
- data/_patches-20160112a/eng-11616-actual +0 -184
- data/_patches-20160112a/eng-11625a +0 -4
- data/_patches-20160112a/eng-11711 +0 -85
- data/_patches-20160112a/eng-12232-command-spec +0 -236
- data/_patches-20160112a/eng-12235 +0 -83
- data/_patches-20160112a/eng-12235-override-refactor +0 -140
- data/_patches-20160112a/eng-12240 +0 -103
- data/_patches-20160112a/eng-12249 +0 -40
- data/_patches-20160112a/eng-12301 +0 -50
- data/_patches-20160112a/eng-12843 +0 -95
- data/_patches-20160112a/env-source +0 -112
- data/_patches-20160112a/frickin-vagrant-spec +0 -163
- data/_patches-20160112a/gem-pre-version +0 -14
- data/_patches-20160112a/gems-old +0 -9
- data/_patches-20160112a/googles-specs +0 -713
- data/_patches-20160112a/local-configs-ignore +0 -61
- data/_patches-20160112a/misc +0 -79
- data/_patches-20160112a/network-unreachable +0 -31
- data/_patches-20160112a/new-boxfile +0 -288
- data/_patches-20160112a/parallelization-maybe +0 -198
- data/_patches-20160112a/read-state +0 -23
- data/_patches-20160112a/refactor-to-use-public_address-cap +0 -25
- data/_patches-20160112a/series +0 -58
- data/_patches-20160112a/status +0 -14
- data/_patches-20160112a/test-move-env-data +0 -231
- data/_patches-20160112a/test-vagrantfile-vm1 +0 -167
- data/_patches-20160112a/the_version_in_0.1.13.pre1 +0 -612
- data/_patches-20160112a/then-copy-the-newer-files +0 -632
- data/_patches-20160112a/vagrant-spec-mock-api +0 -137
- data/_patches-20160112a/vagrant-vmware-plugin +0 -233
- data/_patches-20160112a/vagrantfile +0 -403
- data/_patches-20160112a/vagrantfile-for-acceptance-tests +0 -29
- data/_patches-20160112a/vagrantfile-for-nick +0 -95
- data/_patches-20160112a/vagrantfiles-to-forget-what-they-are-for +0 -134
- data/_patches-20160112a/vm-vanished +0 -42
- data/_patches-20160113/COMPLETED-ABOVE-THIS-LINE +0 -4
- data/_patches-20160113/COMPLETED-BELOW-THIS-LINE +0 -4
- data/_patches-20160113/CR-ABOVE-THIS-LINE +0 -4
- data/_patches-20160113/CR-BELOW-THIS-LINE +0 -4
- data/_patches-20160113/WIP-ABOVE-THIS-LINE +0 -4
- data/_patches-20160113/WIP-BELOW-THIS-LINE +0 -4
- data/_patches-20160113/acceptance-test-runner +0 -29
- data/_patches-20160113/ansible-1 +0 -92
- data/_patches-20160113/cache-api-client-in-up +0 -40
- data/_patches-20160113/dead-code-in-actions +0 -44
- data/_patches-20160113/debug-changes +0 -55
- data/_patches-20160113/demo-rails-app +0 -1276
- data/_patches-20160113/eng-10166-halt-spec +0 -40
- data/_patches-20160113/eng-10256 +0 -543
- data/_patches-20160113/eng-10256-ubuntu-testing +0 -88
- data/_patches-20160113/eng-10269-test-stuff +0 -87
- data/_patches-20160113/eng-10269-wtf +0 -119
- data/_patches-20160113/eng-10369 +0 -143
- data/_patches-20160113/eng-10369-tmp +0 -60
- data/_patches-20160113/eng-10919 +0 -56
- data/_patches-20160113/eng-11177-fix-actions-requires +0 -44
- data/_patches-20160113/eng-11442 +0 -4
- data/_patches-20160113/eng-11616 +0 -403
- data/_patches-20160113/eng-11616-2 +0 -67
- data/_patches-20160113/eng-11616-actual +0 -184
- data/_patches-20160113/eng-11625a +0 -4
- data/_patches-20160113/eng-11711 +0 -85
- data/_patches-20160113/eng-12232-command-spec +0 -236
- data/_patches-20160113/eng-12235 +0 -83
- data/_patches-20160113/eng-12235-override-refactor +0 -140
- data/_patches-20160113/eng-12240 +0 -103
- data/_patches-20160113/eng-12249 +0 -40
- data/_patches-20160113/eng-12301 +0 -50
- data/_patches-20160113/eng-12720 +0 -47
- data/_patches-20160113/eng-12843 +0 -95
- data/_patches-20160113/env-source +0 -112
- data/_patches-20160113/frickin-vagrant-spec +0 -163
- data/_patches-20160113/gem-pre-version +0 -14
- data/_patches-20160113/gems-old +0 -9
- data/_patches-20160113/googles-specs +0 -713
- data/_patches-20160113/local-configs-ignore +0 -61
- data/_patches-20160113/misc +0 -79
- data/_patches-20160113/network-unreachable +0 -31
- data/_patches-20160113/new-boxfile +0 -288
- data/_patches-20160113/parallelization-maybe +0 -198
- data/_patches-20160113/read-state +0 -23
- data/_patches-20160113/refactor-to-use-public_address-cap +0 -25
- data/_patches-20160113/series +0 -56
- data/_patches-20160113/status +0 -14
- data/_patches-20160113/test-move-env-data +0 -231
- data/_patches-20160113/test-vagrantfile-vm1 +0 -167
- data/_patches-20160113/vagrant-spec-mock-api +0 -137
- data/_patches-20160113/vagrant-vmware-plugin +0 -233
- data/_patches-20160113/vagrantfile +0 -403
- data/_patches-20160113/vagrantfile-for-acceptance-tests +0 -29
- data/_patches-20160113/vagrantfile-for-nick +0 -95
- data/_patches-20160113/vagrantfiles-to-forget-what-they-are-for +0 -134
- data/_patches-20160113/vm-vanished +0 -42
- data/_patches-20160118/COMPLETED-ABOVE-THIS-LINE +0 -4
- data/_patches-20160118/COMPLETED-BELOW-THIS-LINE +0 -4
- data/_patches-20160118/CR-ABOVE-THIS-LINE +0 -4
- data/_patches-20160118/CR-BELOW-THIS-LINE +0 -4
- data/_patches-20160118/WIP-ABOVE-THIS-LINE +0 -4
- data/_patches-20160118/WIP-BELOW-THIS-LINE +0 -4
- data/_patches-20160118/acceptance-test-runner +0 -29
- data/_patches-20160118/ansible-1 +0 -92
- data/_patches-20160118/cache-api-client-in-up +0 -40
- data/_patches-20160118/dead-code-in-actions +0 -44
- data/_patches-20160118/debug-changes +0 -55
- data/_patches-20160118/demo-rails-app +0 -1276
- data/_patches-20160118/eng-10166-halt-spec +0 -40
- data/_patches-20160118/eng-10256 +0 -554
- data/_patches-20160118/eng-10256-cr +0 -314
- data/_patches-20160118/eng-10256-ubuntu-testing +0 -88
- data/_patches-20160118/eng-10269-test-stuff +0 -87
- data/_patches-20160118/eng-10269-wtf +0 -119
- data/_patches-20160118/eng-10369 +0 -143
- data/_patches-20160118/eng-10369-tmp +0 -60
- data/_patches-20160118/eng-10919 +0 -56
- data/_patches-20160118/eng-11177-fix-actions-requires +0 -44
- data/_patches-20160118/eng-11442 +0 -4
- data/_patches-20160118/eng-11616 +0 -403
- data/_patches-20160118/eng-11616-2 +0 -67
- data/_patches-20160118/eng-11616-actual +0 -184
- data/_patches-20160118/eng-11625a +0 -4
- data/_patches-20160118/eng-11711 +0 -85
- data/_patches-20160118/eng-12232-command-spec +0 -236
- data/_patches-20160118/eng-12235 +0 -83
- data/_patches-20160118/eng-12235-override-refactor +0 -140
- data/_patches-20160118/eng-12240 +0 -103
- data/_patches-20160118/eng-12249 +0 -40
- data/_patches-20160118/eng-12301 +0 -50
- data/_patches-20160118/eng-12720 +0 -74
- data/_patches-20160118/eng-12843 +0 -95
- data/_patches-20160118/eng-13040 +0 -291
- data/_patches-20160118/env-source +0 -112
- data/_patches-20160118/frickin-vagrant-spec +0 -163
- data/_patches-20160118/gem-pre-version +0 -14
- data/_patches-20160118/gems-old +0 -9
- data/_patches-20160118/googles-specs +0 -713
- data/_patches-20160118/local-configs-ignore +0 -61
- data/_patches-20160118/misc +0 -79
- data/_patches-20160118/network-unreachable +0 -31
- data/_patches-20160118/new-boxfile +0 -288
- data/_patches-20160118/parallelization-maybe +0 -198
- data/_patches-20160118/port-forwarding-processes +0 -87
- data/_patches-20160118/read-state +0 -23
- data/_patches-20160118/refactor-to-use-public_address-cap +0 -25
- data/_patches-20160118/series +0 -59
- data/_patches-20160118/status +0 -13
- data/_patches-20160118/test-move-env-data +0 -231
- data/_patches-20160118/test-vagrantfile-vm1 +0 -167
- data/_patches-20160118/vagrant-spec-mock-api +0 -137
- data/_patches-20160118/vagrant-vmware-plugin +0 -233
- data/_patches-20160118/vagrantfile +0 -403
- data/_patches-20160118/vagrantfile-for-acceptance-tests +0 -29
- data/_patches-20160118/vagrantfile-for-nick +0 -95
- data/_patches-20160118/vagrantfiles-to-forget-what-they-are-for +0 -134
- data/_patches-20160118/vm-vanished +0 -42
- data/_patches-20160118a/COMPLETED-ABOVE-THIS-LINE +0 -4
- data/_patches-20160118a/COMPLETED-BELOW-THIS-LINE +0 -4
- data/_patches-20160118a/CR-ABOVE-THIS-LINE +0 -4
- data/_patches-20160118a/CR-BELOW-THIS-LINE +0 -4
- data/_patches-20160118a/WIP-ABOVE-THIS-LINE +0 -4
- data/_patches-20160118a/WIP-BELOW-THIS-LINE +0 -4
- data/_patches-20160118a/acceptance-test-runner +0 -29
- data/_patches-20160118a/ansible-1 +0 -92
- data/_patches-20160118a/bar +0 -189
- data/_patches-20160118a/cache-api-client-in-up +0 -40
- data/_patches-20160118a/dead-code-in-actions +0 -44
- data/_patches-20160118a/debug-changes +0 -55
- data/_patches-20160118a/demo-rails-app +0 -1276
- data/_patches-20160118a/eng-10166-halt-spec +0 -40
- data/_patches-20160118a/eng-10256 +0 -554
- data/_patches-20160118a/eng-10256-cr +0 -314
- data/_patches-20160118a/eng-10256-ubuntu-testing +0 -88
- data/_patches-20160118a/eng-10269-test-stuff +0 -87
- data/_patches-20160118a/eng-10269-wtf +0 -119
- data/_patches-20160118a/eng-10369 +0 -143
- data/_patches-20160118a/eng-10369-tmp +0 -60
- data/_patches-20160118a/eng-10919 +0 -56
- data/_patches-20160118a/eng-11177-fix-actions-requires +0 -44
- data/_patches-20160118a/eng-11442 +0 -4
- data/_patches-20160118a/eng-11616 +0 -403
- data/_patches-20160118a/eng-11616-2 +0 -67
- data/_patches-20160118a/eng-11616-actual +0 -184
- data/_patches-20160118a/eng-11625a +0 -4
- data/_patches-20160118a/eng-11711 +0 -85
- data/_patches-20160118a/eng-12232-command-spec +0 -236
- data/_patches-20160118a/eng-12235 +0 -83
- data/_patches-20160118a/eng-12235-override-refactor +0 -140
- data/_patches-20160118a/eng-12240 +0 -103
- data/_patches-20160118a/eng-12249 +0 -40
- data/_patches-20160118a/eng-12301 +0 -50
- data/_patches-20160118a/eng-12720 +0 -74
- data/_patches-20160118a/eng-12843 +0 -95
- data/_patches-20160118a/eng-13040 +0 -291
- data/_patches-20160118a/env-source +0 -112
- data/_patches-20160118a/foo +0 -169
- data/_patches-20160118a/frickin-vagrant-spec +0 -163
- data/_patches-20160118a/gem-pre-version +0 -14
- data/_patches-20160118a/gems-old +0 -9
- data/_patches-20160118a/googles-specs +0 -713
- data/_patches-20160118a/guestport-madness +0 -59
- data/_patches-20160118a/local-configs-ignore +0 -61
- data/_patches-20160118a/misc +0 -79
- data/_patches-20160118a/network-unreachable +0 -31
- data/_patches-20160118a/new-boxfile +0 -288
- data/_patches-20160118a/parallelization-maybe +0 -198
- data/_patches-20160118a/port-forwarding-processes +0 -87
- data/_patches-20160118a/read-state +0 -23
- data/_patches-20160118a/refactor-to-use-public_address-cap +0 -25
- data/_patches-20160118a/series +0 -62
- data/_patches-20160118a/status +0 -14
- data/_patches-20160118a/test-move-env-data +0 -231
- data/_patches-20160118a/test-vagrantfile-vm1 +0 -167
- data/_patches-20160118a/vagrant-spec-mock-api +0 -137
- data/_patches-20160118a/vagrant-vmware-plugin +0 -233
- data/_patches-20160118a/vagrantfile +0 -403
- data/_patches-20160118a/vagrantfile-for-acceptance-tests +0 -29
- data/_patches-20160118a/vagrantfile-for-nick +0 -95
- data/_patches-20160118a/vagrantfiles-to-forget-what-they-are-for +0 -134
- data/_patches-20160118a/vm-vanished +0 -42
@@ -1,612 +0,0 @@
|
|
1
|
-
# HG changeset patch
|
2
|
-
# Parent 9277259db23ef4e33b90e83fbd16f6624145b338
|
3
|
-
DO NOT FOLD!!!! imported patch the_version_in_0.1.13.pre1
|
4
|
-
|
5
|
-
diff -r 9277259db23e Vagrantfile
|
6
|
-
--- a/Vagrantfile Fri Jan 08 11:52:01 2016 -0800
|
7
|
-
+++ b/Vagrantfile Tue Jan 12 22:30:01 2016 -0800
|
8
|
-
@@ -125,7 +125,7 @@
|
9
|
-
box.vm.provision "shell", path: "provisioning/apache.sh"
|
10
|
-
box.vm.provision "shell", path: "provisioning/vagrant.sh"
|
11
|
-
|
12
|
-
- #box.vm.network :forwarded_port, guest: 80, host: 9000
|
13
|
-
+ box.vm.network :forwarded_port, guest: 80, host: 9000
|
14
|
-
#box.vm.network :forwarded_port, guest: 21, host: 9001
|
15
|
-
end
|
16
|
-
|
17
|
-
diff -r 9277259db23e lib/vagrant-skytap/action.rb
|
18
|
-
--- a/lib/vagrant-skytap/action.rb Fri Jan 08 11:52:01 2016 -0800
|
19
|
-
+++ b/lib/vagrant-skytap/action.rb Tue Jan 12 22:30:01 2016 -0800
|
20
|
-
@@ -16,6 +16,7 @@
|
21
|
-
b1.use MessageNotCreated
|
22
|
-
else
|
23
|
-
b1.use StopVm
|
24
|
-
+ b1.use ClearForwardedPorts
|
25
|
-
end
|
26
|
-
end
|
27
|
-
end
|
28
|
-
@@ -31,6 +32,7 @@
|
29
|
-
b1.use MessageNotCreated
|
30
|
-
else
|
31
|
-
b1.use SuspendVm
|
32
|
-
+ b1.use ClearForwardedPorts
|
33
|
-
end
|
34
|
-
end
|
35
|
-
end
|
36
|
-
@@ -65,6 +67,7 @@
|
37
|
-
end
|
38
|
-
end
|
39
|
-
end
|
40
|
-
+ b.use ClearForwardedPorts
|
41
|
-
b.use PrepareNFSValidIds
|
42
|
-
b.use SyncedFolderCleanup
|
43
|
-
end
|
44
|
-
@@ -251,6 +254,7 @@
|
45
|
-
end
|
46
|
-
end
|
47
|
-
b.use WaitForCommunicator
|
48
|
-
+ b.use action_forward_ports
|
49
|
-
end
|
50
|
-
end
|
51
|
-
|
52
|
-
@@ -281,15 +285,29 @@
|
53
|
-
end
|
54
|
-
end
|
55
|
-
|
56
|
-
+ def self.action_forward_ports
|
57
|
-
+ Vagrant::Action::Builder.new.tap do |b|
|
58
|
-
+ b.use ClearForwardedPorts
|
59
|
-
+ b.use ReadSSHInfo
|
60
|
-
+ b.use Message, "forwarding ports"
|
61
|
-
+ #b.use EnvSet, port_collision_repair: true # does it just work?
|
62
|
-
+ #b.use PrepareForwardedPortCollisionParams
|
63
|
-
+ #b.use HandleForwardedPortCollisions
|
64
|
-
+ b.use ForwardPorts
|
65
|
-
+ end
|
66
|
-
+ end
|
67
|
-
+
|
68
|
-
# The autoload farm
|
69
|
-
action_root = Pathname.new(File.expand_path("../action", __FILE__))
|
70
|
-
autoload :StoreExtraData, action_root.join("store_extra_data")
|
71
|
-
autoload :AddVmToEnvironment, action_root.join("add_vm_to_environment")
|
72
|
-
+ autoload :ClearForwardedPorts, action_root.join("clear_forwarded_ports")
|
73
|
-
autoload :CreateEnvironment, action_root.join("create_environment")
|
74
|
-
autoload :DeleteEnvironment, action_root.join("delete_environment")
|
75
|
-
autoload :DeleteVm, action_root.join("delete_vm")
|
76
|
-
autoload :ExistenceCheck, action_root.join("existence_check")
|
77
|
-
autoload :FetchEnvironment, action_root.join("fetch_environment")
|
78
|
-
+ autoload :ForwardPorts, action_root.join("forward_ports")
|
79
|
-
autoload :InitializeAPIClient, action_root.join("initialize_api_client")
|
80
|
-
autoload :InitialState, action_root.join("initial_state")
|
81
|
-
autoload :IsParallelized, action_root.join("is_parallelized")
|
82
|
-
@@ -302,6 +320,7 @@
|
83
|
-
autoload :MessageEnvironmentUrl, action_root.join("message_environment_url")
|
84
|
-
autoload :MessageResuming, action_root.join("message_resuming")
|
85
|
-
autoload :MessageWillNotDestroy, action_root.join("message_will_not_destroy")
|
86
|
-
+ autoload :PrepareForwardedPortCollisionParams, action_root.join("prepare_forwarded_port_collision_params")
|
87
|
-
autoload :PrepareNFSSettings, action_root.join("prepare_nfs_settings")
|
88
|
-
autoload :PrepareNFSValidIds, action_root.join("prepare_nfs_valid_ids")
|
89
|
-
autoload :ReadSSHInfo, action_root.join("read_ssh_info")
|
90
|
-
diff -r 9277259db23e lib/vagrant-skytap/action/clear_forwarded_ports.rb
|
91
|
-
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
|
92
|
-
+++ b/lib/vagrant-skytap/action/clear_forwarded_ports.rb Tue Jan 12 22:30:01 2016 -0800
|
93
|
-
@@ -0,0 +1,39 @@
|
94
|
-
+#require 'byebug'
|
95
|
-
+require "vagrant/util/safe_chdir"
|
96
|
-
+
|
97
|
-
+
|
98
|
-
+module VagrantPlugins
|
99
|
-
+ module Skytap
|
100
|
-
+ module Action
|
101
|
-
+ class ClearForwardedPorts
|
102
|
-
+ def initialize(app, env)
|
103
|
-
+ @app = app
|
104
|
-
+ @env = env
|
105
|
-
+ end
|
106
|
-
+
|
107
|
-
+ def call(env)
|
108
|
-
+ if pidfiles = read_pidfiles.presence
|
109
|
-
+ env[:ui].info I18n.t("vagrant.actions.vm.clear_forward_ports.deleting")
|
110
|
-
+ kill_tunnels(pidfiles)
|
111
|
-
+ end
|
112
|
-
+
|
113
|
-
+ @app.call(env)
|
114
|
-
+ end
|
115
|
-
+
|
116
|
-
+ def read_pidfiles
|
117
|
-
+ pidfiles = []
|
118
|
-
+ Vagrant::Util::SafeChdir.safe_chdir(@env[:machine].data_dir) do
|
119
|
-
+ pidfiles = Dir.glob("*.pid")
|
120
|
-
+ end
|
121
|
-
+ pidfiles
|
122
|
-
+ end
|
123
|
-
+
|
124
|
-
+ def kill_tunnels(pidfiles)
|
125
|
-
+ pidfiles.each do |pidfile|
|
126
|
-
+ @env[:host].capability(:kill_ssh_tunnel, pidfile, @env)
|
127
|
-
+ end
|
128
|
-
+ end
|
129
|
-
+ end
|
130
|
-
+ end
|
131
|
-
+ end
|
132
|
-
+end
|
133
|
-
diff -r 9277259db23e lib/vagrant-skytap/action/forward_ports.rb
|
134
|
-
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
|
135
|
-
+++ b/lib/vagrant-skytap/action/forward_ports.rb Tue Jan 12 22:30:01 2016 -0800
|
136
|
-
@@ -0,0 +1,51 @@
|
137
|
-
+require 'vagrant-skytap/util/compile_forwarded_ports'
|
138
|
-
+#require 'byebug'
|
139
|
-
+
|
140
|
-
+module VagrantPlugins
|
141
|
-
+ module Skytap
|
142
|
-
+ module Action
|
143
|
-
+ class ForwardPorts
|
144
|
-
+ include Util::CompileForwardedPorts
|
145
|
-
+
|
146
|
-
+ def initialize(app, env)
|
147
|
-
+ @app = app
|
148
|
-
+ end
|
149
|
-
+
|
150
|
-
+ #--------------------------------------------------------------
|
151
|
-
+ # Execution
|
152
|
-
+ #--------------------------------------------------------------
|
153
|
-
+ def call(env)
|
154
|
-
+ @env = env
|
155
|
-
+
|
156
|
-
+ # Get the ports we're forwarding
|
157
|
-
+ env[:forwarded_ports] ||= compile_forwarded_ports(env[:machine].config)
|
158
|
-
+
|
159
|
-
+ # Warn if we're port forwarding to any privileged ports...
|
160
|
-
+ env[:forwarded_ports].each do |fp|
|
161
|
-
+ if fp.host_port <= 1024
|
162
|
-
+ env[:ui].warn I18n.t("vagrant.actions.vm.forward_ports.privileged_ports")
|
163
|
-
+ break
|
164
|
-
+ end
|
165
|
-
+ end
|
166
|
-
+
|
167
|
-
+ env[:ui].output(I18n.t("vagrant.actions.vm.forward_ports.forwarding"))
|
168
|
-
+ forward_ports
|
169
|
-
+
|
170
|
-
+ @app.call(env)
|
171
|
-
+ end
|
172
|
-
+
|
173
|
-
+ def forward_ports
|
174
|
-
+ @env[:forwarded_ports].each do |fp|
|
175
|
-
+ unless fp.guest_port == 22 && fp.host_port == 2222
|
176
|
-
+ @env[:ui].detail(I18n.t("vagrant.actions.vm.forward_ports.forwarding_entry",
|
177
|
-
+ adapter: fp.adapter,
|
178
|
-
+ guest_port: fp.guest_port,
|
179
|
-
+ host_port: fp.host_port))
|
180
|
-
+ @env[:host].capability(:start_ssh_tunnel, fp, @env)
|
181
|
-
+ end
|
182
|
-
+ end
|
183
|
-
+ end
|
184
|
-
+ end
|
185
|
-
+ end
|
186
|
-
+ end
|
187
|
-
+end
|
188
|
-
diff -r 9277259db23e lib/vagrant-skytap/action/prepare_forwarded_port_collision_params.rb
|
189
|
-
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
|
190
|
-
+++ b/lib/vagrant-skytap/action/prepare_forwarded_port_collision_params.rb Tue Jan 12 22:30:01 2016 -0800
|
191
|
-
@@ -0,0 +1,45 @@
|
192
|
-
+module VagrantPlugins
|
193
|
-
+ module Skytap
|
194
|
-
+ module Action
|
195
|
-
+ class PrepareForwardedPortCollisionParams
|
196
|
-
+ def initialize(app, env)
|
197
|
-
+ @app = app
|
198
|
-
+ end
|
199
|
-
+
|
200
|
-
+ def call(env)
|
201
|
-
+ # Get the forwarded ports used by other virtual machines and
|
202
|
-
+ # consider those in use as well.
|
203
|
-
+ env[:port_collision_extra_in_use] = read_used_ports
|
204
|
-
+
|
205
|
-
+ # Build the remap for any existing collision detections
|
206
|
-
+ remap = {}
|
207
|
-
+ env[:port_collision_remap] = remap
|
208
|
-
+ read_forwarded_ports.each do |_nic, name, hostport, _guestport|
|
209
|
-
+ env[:machine].config.vm.networks.each do |type, options|
|
210
|
-
+ next if type != :forwarded_port
|
211
|
-
+
|
212
|
-
+ # If the ID matches the name of the forwarded port, then
|
213
|
-
+ # remap.
|
214
|
-
+ if options[:id] == name
|
215
|
-
+ remap[options[:host]] = hostport
|
216
|
-
+ break
|
217
|
-
+ end
|
218
|
-
+ end
|
219
|
-
+ end
|
220
|
-
+
|
221
|
-
+ @app.call(env)
|
222
|
-
+ end
|
223
|
-
+
|
224
|
-
+ def read_used_ports
|
225
|
-
+ #env[:machine].provider.driver.read_used_ports
|
226
|
-
+ []
|
227
|
-
+ end
|
228
|
-
+
|
229
|
-
+ def read_forwarded_ports
|
230
|
-
+ #env[:machine].provider.driver.read_forwarded_ports
|
231
|
-
+ []
|
232
|
-
+ end
|
233
|
-
+ end
|
234
|
-
+ end
|
235
|
-
+ end
|
236
|
-
+end
|
237
|
-
diff -r 9277259db23e lib/vagrant-skytap/hosts/bsd/cap/ssh_tunnel.rb
|
238
|
-
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
|
239
|
-
+++ b/lib/vagrant-skytap/hosts/bsd/cap/ssh_tunnel.rb Tue Jan 12 22:30:01 2016 -0800
|
240
|
-
@@ -0,0 +1,112 @@
|
241
|
-
+require "pathname"
|
242
|
-
+require "tmpdir"
|
243
|
-
+require 'childprocess'
|
244
|
-
+require "vagrant/util/subprocess"
|
245
|
-
+#require 'byebug'
|
246
|
-
+#require 'ap'
|
247
|
-
+require 'log4r'
|
248
|
-
+require "vagrant/util/safe_chdir"
|
249
|
-
+
|
250
|
-
+module VagrantPlugins
|
251
|
-
+ module Skytap
|
252
|
-
+ module HostBSD
|
253
|
-
+ module Cap
|
254
|
-
+ class SSHTunnel
|
255
|
-
+ def self.start_ssh_tunnel(env, fp, env_hash)
|
256
|
-
+ logger = Log4r::Logger.new("vagrant::hosts::bsd")
|
257
|
-
+ port = {
|
258
|
-
+ adapter: fp.adapter,
|
259
|
-
+ guestip: fp.guest_ip,
|
260
|
-
+ guestport: fp.guest_port,
|
261
|
-
+ hostip: fp.host_ip,
|
262
|
-
+ hostport: fp.host_port,
|
263
|
-
+ name: fp.id,
|
264
|
-
+ protocol: fp.protocol
|
265
|
-
+ }
|
266
|
-
+
|
267
|
-
+ pidfile = pidfile_name(port, env_hash)
|
268
|
-
+ pid = read_pid(pidfile)
|
269
|
-
+ if pid && autossh_pid?(pid)
|
270
|
-
+ logger.info("An autossh process already exists with pid #{pid}.")
|
271
|
-
+ else
|
272
|
-
+ args = autossh_args(port, pidfile, env_hash)
|
273
|
-
+ Vagrant::Util::Subprocess.execute("autossh", *args)
|
274
|
-
+ end
|
275
|
-
+ end
|
276
|
-
+
|
277
|
-
+ def self.kill_ssh_tunnel(env, pidfile, env_hash)
|
278
|
-
+ logger = Log4r::Logger.new("vagrant::hosts::bsd")
|
279
|
-
+ pidfile = File.join(env_hash[:machine].data_dir, pidfile)
|
280
|
-
+ pid = read_pid(pidfile)
|
281
|
-
+ if pid && autossh_pid?(pid)
|
282
|
-
+ Vagrant::Util::Subprocess.execute("kill", pid.to_s)
|
283
|
-
+ else
|
284
|
-
+ logger.info("Cleaning up stale autossh pidfile #{pidfile}.")
|
285
|
-
+ Vagrant::Util::Subprocess.execute("rm", pidfile)
|
286
|
-
+ end
|
287
|
-
+ end
|
288
|
-
+
|
289
|
-
+ private
|
290
|
-
+
|
291
|
-
+ def self.pidfile_name(port, env_hash)
|
292
|
-
+ tunnel_name = [port[:hostip], port[:name]].compact.join('_')
|
293
|
-
+ File.join(env_hash[:machine].data_dir, "#{tunnel_name}.pid")
|
294
|
-
+ end
|
295
|
-
+
|
296
|
-
+ def self.read_pid(pidfile)
|
297
|
-
+ File.read(pidfile).presence.try(:to_i) if File.exist?(pidfile)
|
298
|
-
+ end
|
299
|
-
+
|
300
|
-
+ # Checks that the pid is actually an autossh process (and not
|
301
|
-
+ # something else using a recycled pid).
|
302
|
-
+ def self.autossh_pid?(pid)
|
303
|
-
+ # get_comm_for_pid(pid) == 'autossh'
|
304
|
-
+ true
|
305
|
-
+ end
|
306
|
-
+
|
307
|
-
+ # Get the command, minus any arguments, for the given
|
308
|
-
+ # pid. I don't expect this to be compatible cross-platform yet...
|
309
|
-
+ # This could be complicated cross-platform, and Sys::ProcTable
|
310
|
-
+ # could likewise be complicated cross-platform ...
|
311
|
-
+ def self.get_comm_for_pid(pid)
|
312
|
-
+ result = Vagrant::Util::Subprocess.execute("ps", "-p", pid.to_s, "-o", "comm")
|
313
|
-
+ result.stdout.split("\n").last
|
314
|
-
+ end
|
315
|
-
+
|
316
|
-
+ def self.autossh_args(port, pidfile, env_hash)
|
317
|
-
+ ssh_info = env_hash[:machine_ssh_info]
|
318
|
-
+ ssh_options = {
|
319
|
-
+ "ServerAliveInterval" => 10,
|
320
|
-
+ "ServerAliveCountMax" => 3,
|
321
|
-
+ "StrictHostKeyChecking" => "no",
|
322
|
-
+ }
|
323
|
-
+ environment_variables = {
|
324
|
-
+ env: {
|
325
|
-
+ "AUTOSSH_PIDFILE" => pidfile,
|
326
|
-
+ "AUTOSSH_PORT" => 0, # turns off monitoring
|
327
|
-
+ "AUTOSSH_LOGFILE" => "/tmp/autossh.log",
|
328
|
-
+ }
|
329
|
-
+ }
|
330
|
-
+ forward_string = [
|
331
|
-
+ port[:hostport],
|
332
|
-
+ "localhost",
|
333
|
-
+ port[:guestport]
|
334
|
-
+ ].join(':')
|
335
|
-
+
|
336
|
-
+ autossh_args = []
|
337
|
-
+ autossh_args << "-q"
|
338
|
-
+ autossh_args << "-N"
|
339
|
-
+ autossh_args << "-f"
|
340
|
-
+ autossh_args << "-i" << env_hash[:machine].data_dir.join("private_key").to_s
|
341
|
-
+ autossh_args << "-L" << forward_string
|
342
|
-
+ ssh_options.each do |k, v|
|
343
|
-
+ autossh_args << "-o" << "#{k}=#{v}"
|
344
|
-
+ end
|
345
|
-
+ autossh_args << "#{ssh_info[:username]}@#{ssh_info[:host]}"
|
346
|
-
+ autossh_args << environment_variables
|
347
|
-
+ end
|
348
|
-
+ end
|
349
|
-
+ end
|
350
|
-
+ end
|
351
|
-
+ end
|
352
|
-
+end
|
353
|
-
diff -r 9277259db23e lib/vagrant-skytap/hosts/linux/cap/ssh_tunnel.rb
|
354
|
-
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
|
355
|
-
+++ b/lib/vagrant-skytap/hosts/linux/cap/ssh_tunnel.rb Tue Jan 12 22:30:01 2016 -0800
|
356
|
-
@@ -0,0 +1,112 @@
|
357
|
-
+require "pathname"
|
358
|
-
+require "tmpdir"
|
359
|
-
+require 'childprocess'
|
360
|
-
+require "vagrant/util/subprocess"
|
361
|
-
+#require 'byebug'
|
362
|
-
+#require 'ap'
|
363
|
-
+require 'log4r'
|
364
|
-
+require "vagrant/util/safe_chdir"
|
365
|
-
+
|
366
|
-
+module VagrantPlugins
|
367
|
-
+ module Skytap
|
368
|
-
+ module HostLinux
|
369
|
-
+ module Cap
|
370
|
-
+ class SSHTunnel
|
371
|
-
+ def self.start_ssh_tunnel(env, fp, env_hash)
|
372
|
-
+ logger = Log4r::Logger.new("vagrant::hosts::bsd")
|
373
|
-
+ port = {
|
374
|
-
+ adapter: fp.adapter,
|
375
|
-
+ guestip: fp.guest_ip,
|
376
|
-
+ guestport: fp.guest_port,
|
377
|
-
+ hostip: fp.host_ip,
|
378
|
-
+ hostport: fp.host_port,
|
379
|
-
+ name: fp.id,
|
380
|
-
+ protocol: fp.protocol
|
381
|
-
+ }
|
382
|
-
+
|
383
|
-
+ pidfile = pidfile_name(port, env_hash)
|
384
|
-
+ pid = read_pid(pidfile)
|
385
|
-
+ if pid && autossh_pid?(pid)
|
386
|
-
+ logger.info("An autossh process already exists with pid #{pid}.")
|
387
|
-
+ else
|
388
|
-
+ args = autossh_args(port, pidfile, env_hash)
|
389
|
-
+ Vagrant::Util::Subprocess.execute("autossh", *args)
|
390
|
-
+ end
|
391
|
-
+ end
|
392
|
-
+
|
393
|
-
+ def self.kill_ssh_tunnel(env, pidfile, env_hash)
|
394
|
-
+ logger = Log4r::Logger.new("vagrant::hosts::bsd")
|
395
|
-
+ pidfile = File.join(env_hash[:machine].data_dir, pidfile)
|
396
|
-
+ pid = read_pid(pidfile)
|
397
|
-
+ if pid && autossh_pid?(pid)
|
398
|
-
+ Vagrant::Util::Subprocess.execute("kill", pid.to_s)
|
399
|
-
+ else
|
400
|
-
+ logger.info("Cleaning up stale autossh pidfile #{pidfile}.")
|
401
|
-
+ Vagrant::Util::Subprocess.execute("rm", pidfile)
|
402
|
-
+ end
|
403
|
-
+ end
|
404
|
-
+
|
405
|
-
+ private
|
406
|
-
+
|
407
|
-
+ def self.pidfile_name(port, env_hash)
|
408
|
-
+ tunnel_name = [port[:hostip], port[:name]].compact.join('_')
|
409
|
-
+ File.join(env_hash[:machine].data_dir, "#{tunnel_name}.pid")
|
410
|
-
+ end
|
411
|
-
+
|
412
|
-
+ def self.read_pid(pidfile)
|
413
|
-
+ File.read(pidfile).presence.try(:to_i) if File.exist?(pidfile)
|
414
|
-
+ end
|
415
|
-
+
|
416
|
-
+ # Checks that the pid is actually an autossh process (and not
|
417
|
-
+ # something else using a recycled pid).
|
418
|
-
+ def self.autossh_pid?(pid)
|
419
|
-
+ # get_comm_for_pid(pid) == 'autossh'
|
420
|
-
+ true
|
421
|
-
+ end
|
422
|
-
+
|
423
|
-
+ # Get the command, minus any arguments, for the given
|
424
|
-
+ # pid. I don't expect this to be compatible cross-platform yet...
|
425
|
-
+ # This could be complicated cross-platform, and Sys::ProcTable
|
426
|
-
+ # could likewise be complicated cross-platform ...
|
427
|
-
+ def self.get_comm_for_pid(pid)
|
428
|
-
+ result = Vagrant::Util::Subprocess.execute("ps", "-p", pid.to_s, "-o", "comm")
|
429
|
-
+ result.stdout.split("\n").last
|
430
|
-
+ end
|
431
|
-
+
|
432
|
-
+ def self.autossh_args(port, pidfile, env_hash)
|
433
|
-
+ ssh_info = env_hash[:machine_ssh_info]
|
434
|
-
+ ssh_options = {
|
435
|
-
+ "ServerAliveInterval" => 10,
|
436
|
-
+ "ServerAliveCountMax" => 3,
|
437
|
-
+ "StrictHostKeyChecking" => "no",
|
438
|
-
+ }
|
439
|
-
+ environment_variables = {
|
440
|
-
+ env: {
|
441
|
-
+ "AUTOSSH_PIDFILE" => pidfile,
|
442
|
-
+ "AUTOSSH_PORT" => 0, # turns off monitoring
|
443
|
-
+ #"AUTOSSH_LOGFILE" => "./autossh.log",
|
444
|
-
+ }
|
445
|
-
+ }
|
446
|
-
+ forward_string = [
|
447
|
-
+ port[:hostport],
|
448
|
-
+ "localhost",
|
449
|
-
+ port[:guestport]
|
450
|
-
+ ].join(':')
|
451
|
-
+
|
452
|
-
+ autossh_args = []
|
453
|
-
+ autossh_args << "-q"
|
454
|
-
+ autossh_args << "-N"
|
455
|
-
+ autossh_args << "-f"
|
456
|
-
+ autossh_args << "-i" << env_hash[:machine].data_dir.join("private_key").to_s
|
457
|
-
+ autossh_args << "-L" << forward_string
|
458
|
-
+ ssh_options.each do |k, v|
|
459
|
-
+ autossh_args << "-o" << "#{k}=#{v}"
|
460
|
-
+ end
|
461
|
-
+ autossh_args << "#{ssh_info[:username]}@#{ssh_info[:host]}"
|
462
|
-
+ autossh_args << environment_variables
|
463
|
-
+ end
|
464
|
-
+ end
|
465
|
-
+ end
|
466
|
-
+ end
|
467
|
-
+ end
|
468
|
-
+end
|
469
|
-
diff -r 9277259db23e lib/vagrant-skytap/model/forwarded_port.rb
|
470
|
-
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
|
471
|
-
+++ b/lib/vagrant-skytap/model/forwarded_port.rb Tue Jan 12 22:30:01 2016 -0800
|
472
|
-
@@ -0,0 +1,70 @@
|
473
|
-
+module VagrantPlugins
|
474
|
-
+ module Skytap
|
475
|
-
+ module Model
|
476
|
-
+ # Represents a single forwarded port for VirtualBox. This has various
|
477
|
-
+ # helpers and defaults for a forwarded port.
|
478
|
-
+ class ForwardedPort
|
479
|
-
+ # The NAT adapter on which to attach the forwarded port.
|
480
|
-
+ #
|
481
|
-
+ # @return [Integer]
|
482
|
-
+ attr_reader :adapter
|
483
|
-
+
|
484
|
-
+ # If true, this port should be auto-corrected.
|
485
|
-
+ #
|
486
|
-
+ # @return [Boolean]
|
487
|
-
+ attr_reader :auto_correct
|
488
|
-
+
|
489
|
-
+ # The unique ID for the forwarded port.
|
490
|
-
+ #
|
491
|
-
+ # @return [String]
|
492
|
-
+ attr_reader :id
|
493
|
-
+
|
494
|
-
+ # The protocol to forward.
|
495
|
-
+ #
|
496
|
-
+ # @return [String]
|
497
|
-
+ attr_reader :protocol
|
498
|
-
+
|
499
|
-
+ # The IP that the forwarded port will connect to on the guest machine.
|
500
|
-
+ #
|
501
|
-
+ # @return [String]
|
502
|
-
+ attr_reader :guest_ip
|
503
|
-
+
|
504
|
-
+ # The port on the guest to be exposed on the host.
|
505
|
-
+ #
|
506
|
-
+ # @return [Integer]
|
507
|
-
+ attr_reader :guest_port
|
508
|
-
+
|
509
|
-
+ # The IP that the forwarded port will bind to on the host machine.
|
510
|
-
+ #
|
511
|
-
+ # @return [String]
|
512
|
-
+ attr_reader :host_ip
|
513
|
-
+
|
514
|
-
+ # The port on the host used to access the port on the guest.
|
515
|
-
+ #
|
516
|
-
+ # @return [Integer]
|
517
|
-
+ attr_reader :host_port
|
518
|
-
+
|
519
|
-
+ def initialize(id, host_port, guest_port, options)
|
520
|
-
+ @id = id
|
521
|
-
+ @guest_port = guest_port
|
522
|
-
+ @host_port = host_port
|
523
|
-
+
|
524
|
-
+ options ||= {}
|
525
|
-
+ @auto_correct = false
|
526
|
-
+ @auto_correct = options[:auto_correct] if options.key?(:auto_correct)
|
527
|
-
+ @adapter = (options[:adapter] || 1).to_i
|
528
|
-
+ @guest_ip = options[:guest_ip] || nil
|
529
|
-
+ @host_ip = options[:host_ip] || nil
|
530
|
-
+ @protocol = options[:protocol] || "tcp"
|
531
|
-
+ end
|
532
|
-
+
|
533
|
-
+ # This corrects the host port and changes it to the given new port.
|
534
|
-
+ #
|
535
|
-
+ # @param [Integer] new_port The new port
|
536
|
-
+ def correct_host_port(new_port)
|
537
|
-
+ @host_port = new_port
|
538
|
-
+ end
|
539
|
-
+ end
|
540
|
-
+ end
|
541
|
-
+ end
|
542
|
-
+end
|
543
|
-
diff -r 9277259db23e lib/vagrant-skytap/plugin.rb
|
544
|
-
--- a/lib/vagrant-skytap/plugin.rb Fri Jan 08 11:52:01 2016 -0800
|
545
|
-
+++ b/lib/vagrant-skytap/plugin.rb Tue Jan 12 22:30:01 2016 -0800
|
546
|
-
@@ -49,6 +49,26 @@
|
547
|
-
Cap::PublicAddress
|
548
|
-
end
|
549
|
-
|
550
|
-
+ host_capability("bsd", "start_ssh_tunnel") do
|
551
|
-
+ require_relative "hosts/bsd/cap/ssh_tunnel"
|
552
|
-
+ HostBSD::Cap::SSHTunnel
|
553
|
-
+ end
|
554
|
-
+
|
555
|
-
+ host_capability("bsd", "kill_ssh_tunnel") do
|
556
|
-
+ require_relative "hosts/bsd/cap/ssh_tunnel"
|
557
|
-
+ HostBSD::Cap::SSHTunnel
|
558
|
-
+ end
|
559
|
-
+
|
560
|
-
+ host_capability("linux", "start_ssh_tunnel") do
|
561
|
-
+ require_relative "hosts/linux/cap/ssh_tunnel"
|
562
|
-
+ HostLinux::Cap::SSHTunnel
|
563
|
-
+ end
|
564
|
-
+
|
565
|
-
+ host_capability("linux", "kill_ssh_tunnel") do
|
566
|
-
+ require_relative "hosts/linux/cap/ssh_tunnel"
|
567
|
-
+ HostLinux::Cap::SSHTunnel
|
568
|
-
+ end
|
569
|
-
+
|
570
|
-
# This initializes the internationalization strings.
|
571
|
-
def self.setup_i18n
|
572
|
-
I18n.load_path << File.expand_path("locales/en.yml", Skytap.source_root)
|
573
|
-
diff -r 9277259db23e lib/vagrant-skytap/util/compile_forwarded_ports.rb
|
574
|
-
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
|
575
|
-
+++ b/lib/vagrant-skytap/util/compile_forwarded_ports.rb Tue Jan 12 22:30:01 2016 -0800
|
576
|
-
@@ -0,0 +1,36 @@
|
577
|
-
+require "vagrant/util/scoped_hash_override"
|
578
|
-
+require 'vagrant-skytap/model/forwarded_port'
|
579
|
-
+module VagrantPlugins
|
580
|
-
+ module Skytap
|
581
|
-
+ module Util
|
582
|
-
+ module CompileForwardedPorts
|
583
|
-
+ include Vagrant::Util::ScopedHashOverride
|
584
|
-
+
|
585
|
-
+ # This method compiles the forwarded ports into {ForwardedPort}
|
586
|
-
+ # models.
|
587
|
-
+ def compile_forwarded_ports(config)
|
588
|
-
+ mappings = {}
|
589
|
-
+
|
590
|
-
+ config.vm.networks.each do |type, options|
|
591
|
-
+# puts type, options
|
592
|
-
+# debugger
|
593
|
-
+ if type == :forwarded_port
|
594
|
-
+ guest_port = options[:guest]
|
595
|
-
+ host_port = options[:host]
|
596
|
-
+ protocol = options[:protocol] || "tcp"
|
597
|
-
+ options = scoped_hash_override(options, :skytap)
|
598
|
-
+ id = options[:id]
|
599
|
-
+
|
600
|
-
+ # If the forwarded port was marked as disabled, ignore.
|
601
|
-
+ next if options[:disabled]
|
602
|
-
+ mappings[host_port.to_s + protocol.to_s] =
|
603
|
-
+ Model::ForwardedPort.new(id, host_port, guest_port, options)
|
604
|
-
+ end
|
605
|
-
+ end
|
606
|
-
+
|
607
|
-
+ mappings.values
|
608
|
-
+ end
|
609
|
-
+ end
|
610
|
-
+ end
|
611
|
-
+ end
|
612
|
-
+end
|