vagrant-plugin-dummy 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +20 -0
- data/Gemfile +11 -0
- data/README.md +24 -0
- data/Rakefile +15 -0
- data/lib/vagrant-plugin-dummy/communication/communicator.rb +51 -0
- data/lib/vagrant-plugin-dummy/errors.rb +13 -0
- data/lib/vagrant-plugin-dummy/guest/dummy.rb +48 -0
- data/lib/vagrant-plugin-dummy/monkey_patches/lib/vagrant/machine.rb +27 -0
- data/lib/vagrant-plugin-dummy/plugin.rb +100 -0
- data/lib/vagrant-plugin-dummy/version.rb +3 -0
- data/lib/vagrant-plugin-dummy.rb +24 -0
- data/locales/en.yml +8 -0
- data/oldgit/FETCH_HEAD +4 -0
- data/oldgit/HEAD +1 -0
- data/oldgit/ORIG_HEAD +1 -0
- data/oldgit/config +12 -0
- data/oldgit/description +1 -0
- data/oldgit/hooks/applypatch-msg.sample +15 -0
- data/oldgit/hooks/commit-msg.sample +24 -0
- data/oldgit/hooks/post-update.sample +8 -0
- data/oldgit/hooks/pre-applypatch.sample +14 -0
- data/oldgit/hooks/pre-commit.sample +50 -0
- data/oldgit/hooks/pre-rebase.sample +169 -0
- data/oldgit/hooks/prepare-commit-msg.sample +36 -0
- data/oldgit/hooks/update.sample +128 -0
- data/oldgit/index +0 -0
- data/oldgit/info/exclude +6 -0
- data/oldgit/logs/HEAD +13 -0
- data/oldgit/logs/refs/heads/dummy-master +1 -0
- data/oldgit/logs/refs/heads/master +2 -0
- data/oldgit/logs/refs/heads/vagrant-1.2 +3 -0
- data/oldgit/logs/refs/remotes/origin/HEAD +1 -0
- data/oldgit/logs/refs/remotes/origin/chef-schtasks +1 -0
- data/oldgit/logs/refs/remotes/origin/master +2 -0
- data/oldgit/logs/refs/remotes/origin/vagrant-1.2 +3 -0
- data/oldgit/logs/refs/remotes/origin/winrm-2.0 +1 -0
- data/oldgit/objects/pack/pack-829e113048479ca488917c38a7779511189ee623.idx +0 -0
- data/oldgit/objects/pack/pack-829e113048479ca488917c38a7779511189ee623.pack +0 -0
- data/oldgit/objects/pack/pack-9d783f03b5d312d0eb7c60c232336524cf240841.idx +0 -0
- data/oldgit/objects/pack/pack-9d783f03b5d312d0eb7c60c232336524cf240841.pack +0 -0
- data/oldgit/objects/pack/pack-fc30e147a30fce4b4b0e300c3cdb4743945456d4.idx +0 -0
- data/oldgit/objects/pack/pack-fc30e147a30fce4b4b0e300c3cdb4743945456d4.pack +0 -0
- data/oldgit/packed-refs +9 -0
- data/oldgit/refs/heads/dummy-master +1 -0
- data/oldgit/refs/heads/master +1 -0
- data/oldgit/refs/heads/vagrant-1.2 +1 -0
- data/oldgit/refs/remotes/origin/chef-schtasks +1 -0
- data/oldgit/refs/remotes/origin/master +1 -0
- data/oldgit/refs/remotes/origin/vagrant-1.2 +1 -0
- data/oldgit/refs/remotes/origin/winrm-2.0 +1 -0
- data/spec/vagrant-windows/config_spec.rb +58 -0
- data/spec/vagrant-windows/guestnetwork_spec.rb +48 -0
- data/spec/vagrant-windows/helper_spec.rb +38 -0
- data/spec/vagrant-windows/winrmcommunicator_spec.rb +27 -0
- data/vagrant-plugin-dummy.gemspec +53 -0
- data/windows/communication/guestnetwork.rb +133 -0
- data/windows/communication/winrmcommunicator.rb +120 -0
- data/windows/communication/winrmfinder.rb +45 -0
- data/windows/communication/winrmshell.rb +141 -0
- data/windows/config/windows.rb +35 -0
- data/windows/config/winrm.rb +51 -0
- data/windows/errors.rb +27 -0
- data/windows/guest/cap/change_host_name.rb +14 -0
- data/windows/guest/cap/configure_networks.rb +69 -0
- data/windows/guest/cap/halt.rb +22 -0
- data/windows/guest/cap/mount_virtualbox_shared_folder.rb +17 -0
- data/windows/guest/cap/mount_vmware_shared_folder.rb +15 -0
- data/windows/guest/windows.rb +71 -0
- data/windows/helper.rb +19 -0
- data/windows/monkey_patches/lib/vagrant/machine.rb +32 -0
- data/windows/monkey_patches/plugins/providers/virtualbox/action/share_folders.rb +44 -0
- data/windows/monkey_patches/plugins/providers/virtualbox/driver/version_4_2.rb +20 -0
- data/windows/monkey_patches/plugins/provisioners/chef/provisioner/chef_client.rb +1 -0
- data/windows/monkey_patches/plugins/provisioners/chef/provisioner/chef_solo.rb +106 -0
- data/windows/monkey_patches/plugins/provisioners/puppet/provisioner/puppet.rb +101 -0
- data/windows/monkey_patches/plugins/provisioners/puppet/provisioner/puppet_server.rb +1 -0
- data/windows/monkey_patches/plugins/provisioners/shell/provisioner.rb +89 -0
- data/windows/plugin.rb +129 -0
- data/windows/scripts/cheftask.ps1.erb +47 -0
- data/windows/scripts/cheftask.xml.erb +45 -0
- data/windows/scripts/cheftaskrun.ps1.erb +16 -0
- data/windows/scripts/command_alias.ps1 +36 -0
- data/windows/scripts/mount_volume.virtualbox.ps1.erb +49 -0
- data/windows/scripts/mount_volume.vmware.ps1.erb +49 -0
- data/windows/scripts/set_work_network.ps1 +6 -0
- data/windows/scripts/winrs_v3_get_adapters.ps1 +11 -0
- data/windows/version.rb +3 -0
- metadata +207 -0
@@ -0,0 +1,49 @@
|
|
1
|
+
|
2
|
+
function Test-ReparsePoint([string]$path) {
|
3
|
+
$file = Get-Item $path -Force -ea 0
|
4
|
+
return [bool]($file.Attributes -band [IO.FileAttributes]::ReparsePoint)
|
5
|
+
}
|
6
|
+
|
7
|
+
|
8
|
+
$MountPoint = [System.IO.Path]::GetFullPath("<%= options[:mount_point] %>")
|
9
|
+
$ShareName = "<%= options[:share_name] %>"
|
10
|
+
|
11
|
+
# https://github.com/BIAINC/vagrant-windows/issues/4
|
12
|
+
# Not sure why this works, but it does.
|
13
|
+
|
14
|
+
& net use $ShareName 2>&1 | Out-Null
|
15
|
+
|
16
|
+
Write-Debug "Attempting to mount $ShareName to $MountPoint"
|
17
|
+
if( (Test-Path "$MountPoint") -and (Test-ReparsePoint "$MountPoint") )
|
18
|
+
{
|
19
|
+
Write-Debug "Junction already exists, so I will delete it"
|
20
|
+
# Powershell refuses to delete junctions, oh well use cmd
|
21
|
+
cmd /c rd "$MountPoint"
|
22
|
+
|
23
|
+
if ( $LASTEXITCODE -ne 0 )
|
24
|
+
{
|
25
|
+
Write-Error "Failed to delete symbolic link at $MountPoint"
|
26
|
+
exit 1
|
27
|
+
}
|
28
|
+
|
29
|
+
}
|
30
|
+
elseif(Test-Path $MountPoint)
|
31
|
+
{
|
32
|
+
Write-Debug "Mount point already exists and is not a symbolic link"
|
33
|
+
exit 1
|
34
|
+
}
|
35
|
+
|
36
|
+
$BaseDirectory = [System.IO.Path]::GetDirectoryName($MountPoint)
|
37
|
+
|
38
|
+
if (-not (Test-Path $BaseDirectory))
|
39
|
+
{
|
40
|
+
Write-Debug "Creating parent directory for mount point $BaseDirectory"
|
41
|
+
New-Item $BaseDirectory -Type Directory -Force | Out-Null
|
42
|
+
}
|
43
|
+
|
44
|
+
cmd /c mklink /D "$MountPoint" "\\vboxsrv\$ShareName" | out-null
|
45
|
+
|
46
|
+
if ( $LASTEXITCODE -ne 0 )
|
47
|
+
{
|
48
|
+
exit 1
|
49
|
+
}
|
@@ -0,0 +1,49 @@
|
|
1
|
+
|
2
|
+
function Test-ReparsePoint([string]$path) {
|
3
|
+
$file = Get-Item $path -Force -ea 0
|
4
|
+
return [bool]($file.Attributes -band [IO.FileAttributes]::ReparsePoint)
|
5
|
+
}
|
6
|
+
|
7
|
+
|
8
|
+
$MountPoint = [System.IO.Path]::GetFullPath("<%= options[:mount_point] %>")
|
9
|
+
$ShareName = "<%= options[:share_name] %>"
|
10
|
+
|
11
|
+
# https://github.com/BIAINC/vagrant-windows/issues/4
|
12
|
+
# Not sure why this works, but it does.
|
13
|
+
|
14
|
+
& net use $ShareName 2>&1 | Out-Null
|
15
|
+
|
16
|
+
Write-Debug "Attempting to mount $ShareName to $MountPoint"
|
17
|
+
if( (Test-Path "$MountPoint") -and (Test-ReparsePoint "$MountPoint") )
|
18
|
+
{
|
19
|
+
Write-Debug "Junction already exists, so I will delete it"
|
20
|
+
# Powershell refuses to delete junctions, oh well use cmd
|
21
|
+
cmd /c rd "$MountPoint"
|
22
|
+
|
23
|
+
if ( $LASTEXITCODE -ne 0 )
|
24
|
+
{
|
25
|
+
Write-Error "Failed to delete symbolic link at $MountPoint"
|
26
|
+
exit 1
|
27
|
+
}
|
28
|
+
|
29
|
+
}
|
30
|
+
elseif(Test-Path $MountPoint)
|
31
|
+
{
|
32
|
+
Write-Debug "Mount point already exists and is not a symbolic link"
|
33
|
+
exit 1
|
34
|
+
}
|
35
|
+
|
36
|
+
$BaseDirectory = [System.IO.Path]::GetDirectoryName($MountPoint)
|
37
|
+
|
38
|
+
if (-not (Test-Path $BaseDirectory))
|
39
|
+
{
|
40
|
+
Write-Debug "Creating parent directory for mount point $BaseDirectory"
|
41
|
+
New-Item $BaseDirectory -Type Directory -Force | Out-Null
|
42
|
+
}
|
43
|
+
|
44
|
+
cmd /c mklink /D "$MountPoint" "\\vmware-host\Shared Folders\$ShareName" | out-null
|
45
|
+
|
46
|
+
if ( $LASTEXITCODE -ne 0 )
|
47
|
+
{
|
48
|
+
exit 1
|
49
|
+
}
|
@@ -0,0 +1,6 @@
|
|
1
|
+
# Get network connections
|
2
|
+
$networkListManager = [Activator]::CreateInstance([Type]::GetTypeFromCLSID([Guid]"{DCB00C01-570F-4A9B-8D69-199FDBA5723B}"))
|
3
|
+
$connections = $networkListManager.GetNetworkConnections()
|
4
|
+
|
5
|
+
# Set network location to Private for all networks
|
6
|
+
$connections | % {$_.GetNetwork().SetCategory(1)}
|
@@ -0,0 +1,11 @@
|
|
1
|
+
$adapters = get-ciminstance win32_networkadapter -filter "macaddress is not null"
|
2
|
+
$processed = @()
|
3
|
+
foreach ($adapter in $adapters) {
|
4
|
+
$Processed += new-object PSObject -Property @{
|
5
|
+
mac_address = $adapter.macaddress
|
6
|
+
net_connection_id = $adapter.netconnectionid
|
7
|
+
interface_index = $adapter.interfaceindex
|
8
|
+
index = $adapter.index
|
9
|
+
}
|
10
|
+
}
|
11
|
+
convertto-json -inputobject $processed
|
data/windows/version.rb
ADDED
metadata
ADDED
@@ -0,0 +1,207 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: vagrant-plugin-dummy
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
prerelease:
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- Bryan Bishop
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2013-09-10 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: rake
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
18
|
+
requirements:
|
19
|
+
- - ! '>='
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: '0'
|
22
|
+
type: :development
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ! '>='
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '0'
|
30
|
+
- !ruby/object:Gem::Dependency
|
31
|
+
name: rspec-core
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
33
|
+
none: false
|
34
|
+
requirements:
|
35
|
+
- - ~>
|
36
|
+
- !ruby/object:Gem::Version
|
37
|
+
version: 2.12.2
|
38
|
+
type: :development
|
39
|
+
prerelease: false
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - ~>
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: 2.12.2
|
46
|
+
- !ruby/object:Gem::Dependency
|
47
|
+
name: rspec-expectations
|
48
|
+
requirement: !ruby/object:Gem::Requirement
|
49
|
+
none: false
|
50
|
+
requirements:
|
51
|
+
- - ~>
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: 2.12.1
|
54
|
+
type: :development
|
55
|
+
prerelease: false
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
57
|
+
none: false
|
58
|
+
requirements:
|
59
|
+
- - ~>
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: 2.12.1
|
62
|
+
- !ruby/object:Gem::Dependency
|
63
|
+
name: rspec-mocks
|
64
|
+
requirement: !ruby/object:Gem::Requirement
|
65
|
+
none: false
|
66
|
+
requirements:
|
67
|
+
- - ~>
|
68
|
+
- !ruby/object:Gem::Version
|
69
|
+
version: 2.12.1
|
70
|
+
type: :development
|
71
|
+
prerelease: false
|
72
|
+
version_requirements: !ruby/object:Gem::Requirement
|
73
|
+
none: false
|
74
|
+
requirements:
|
75
|
+
- - ~>
|
76
|
+
- !ruby/object:Gem::Version
|
77
|
+
version: 2.12.1
|
78
|
+
description: Dummy Guest Support for Vagrant
|
79
|
+
email:
|
80
|
+
- kanzure@gmail.com
|
81
|
+
executables: []
|
82
|
+
extensions: []
|
83
|
+
extra_rdoc_files: []
|
84
|
+
files:
|
85
|
+
- oldgit/info/exclude
|
86
|
+
- oldgit/logs/HEAD
|
87
|
+
- oldgit/logs/refs/remotes/origin/HEAD
|
88
|
+
- oldgit/logs/refs/remotes/origin/vagrant-1.2
|
89
|
+
- oldgit/logs/refs/remotes/origin/master
|
90
|
+
- oldgit/logs/refs/remotes/origin/winrm-2.0
|
91
|
+
- oldgit/logs/refs/remotes/origin/chef-schtasks
|
92
|
+
- oldgit/logs/refs/heads/vagrant-1.2
|
93
|
+
- oldgit/logs/refs/heads/master
|
94
|
+
- oldgit/logs/refs/heads/dummy-master
|
95
|
+
- oldgit/HEAD
|
96
|
+
- oldgit/config
|
97
|
+
- oldgit/packed-refs
|
98
|
+
- oldgit/objects/pack/pack-829e113048479ca488917c38a7779511189ee623.pack
|
99
|
+
- oldgit/objects/pack/pack-fc30e147a30fce4b4b0e300c3cdb4743945456d4.pack
|
100
|
+
- oldgit/objects/pack/pack-9d783f03b5d312d0eb7c60c232336524cf240841.pack
|
101
|
+
- oldgit/objects/pack/pack-fc30e147a30fce4b4b0e300c3cdb4743945456d4.idx
|
102
|
+
- oldgit/objects/pack/pack-9d783f03b5d312d0eb7c60c232336524cf240841.idx
|
103
|
+
- oldgit/objects/pack/pack-829e113048479ca488917c38a7779511189ee623.idx
|
104
|
+
- oldgit/index
|
105
|
+
- oldgit/refs/remotes/origin/vagrant-1.2
|
106
|
+
- oldgit/refs/remotes/origin/master
|
107
|
+
- oldgit/refs/remotes/origin/winrm-2.0
|
108
|
+
- oldgit/refs/remotes/origin/chef-schtasks
|
109
|
+
- oldgit/refs/heads/vagrant-1.2
|
110
|
+
- oldgit/refs/heads/master
|
111
|
+
- oldgit/refs/heads/dummy-master
|
112
|
+
- oldgit/description
|
113
|
+
- oldgit/ORIG_HEAD
|
114
|
+
- oldgit/FETCH_HEAD
|
115
|
+
- oldgit/hooks/commit-msg.sample
|
116
|
+
- oldgit/hooks/pre-applypatch.sample
|
117
|
+
- oldgit/hooks/pre-commit.sample
|
118
|
+
- oldgit/hooks/post-update.sample
|
119
|
+
- oldgit/hooks/pre-rebase.sample
|
120
|
+
- oldgit/hooks/update.sample
|
121
|
+
- oldgit/hooks/prepare-commit-msg.sample
|
122
|
+
- oldgit/hooks/applypatch-msg.sample
|
123
|
+
- vagrant-plugin-dummy.gemspec
|
124
|
+
- README.md
|
125
|
+
- spec/vagrant-windows/winrmcommunicator_spec.rb
|
126
|
+
- spec/vagrant-windows/guestnetwork_spec.rb
|
127
|
+
- spec/vagrant-windows/config_spec.rb
|
128
|
+
- spec/vagrant-windows/helper_spec.rb
|
129
|
+
- Rakefile
|
130
|
+
- Gemfile
|
131
|
+
- lib/vagrant-plugin-dummy/guest/dummy.rb
|
132
|
+
- lib/vagrant-plugin-dummy/version.rb
|
133
|
+
- lib/vagrant-plugin-dummy/errors.rb
|
134
|
+
- lib/vagrant-plugin-dummy/monkey_patches/lib/vagrant/machine.rb
|
135
|
+
- lib/vagrant-plugin-dummy/plugin.rb
|
136
|
+
- lib/vagrant-plugin-dummy/communication/communicator.rb
|
137
|
+
- lib/vagrant-plugin-dummy.rb
|
138
|
+
- windows/guest/windows.rb
|
139
|
+
- windows/guest/cap/mount_vmware_shared_folder.rb
|
140
|
+
- windows/guest/cap/configure_networks.rb
|
141
|
+
- windows/guest/cap/mount_virtualbox_shared_folder.rb
|
142
|
+
- windows/guest/cap/halt.rb
|
143
|
+
- windows/guest/cap/change_host_name.rb
|
144
|
+
- windows/config/windows.rb
|
145
|
+
- windows/config/winrm.rb
|
146
|
+
- windows/version.rb
|
147
|
+
- windows/errors.rb
|
148
|
+
- windows/scripts/mount_volume.virtualbox.ps1.erb
|
149
|
+
- windows/scripts/set_work_network.ps1
|
150
|
+
- windows/scripts/cheftaskrun.ps1.erb
|
151
|
+
- windows/scripts/winrs_v3_get_adapters.ps1
|
152
|
+
- windows/scripts/cheftask.ps1.erb
|
153
|
+
- windows/scripts/cheftask.xml.erb
|
154
|
+
- windows/scripts/command_alias.ps1
|
155
|
+
- windows/scripts/mount_volume.vmware.ps1.erb
|
156
|
+
- windows/monkey_patches/plugins/providers/virtualbox/action/share_folders.rb
|
157
|
+
- windows/monkey_patches/plugins/providers/virtualbox/driver/version_4_2.rb
|
158
|
+
- windows/monkey_patches/plugins/provisioners/chef/provisioner/chef_solo.rb
|
159
|
+
- windows/monkey_patches/plugins/provisioners/chef/provisioner/chef_client.rb
|
160
|
+
- windows/monkey_patches/plugins/provisioners/puppet/provisioner/puppet_server.rb
|
161
|
+
- windows/monkey_patches/plugins/provisioners/puppet/provisioner/puppet.rb
|
162
|
+
- windows/monkey_patches/plugins/provisioners/shell/provisioner.rb
|
163
|
+
- windows/monkey_patches/lib/vagrant/machine.rb
|
164
|
+
- windows/plugin.rb
|
165
|
+
- windows/helper.rb
|
166
|
+
- windows/communication/guestnetwork.rb
|
167
|
+
- windows/communication/winrmshell.rb
|
168
|
+
- windows/communication/winrmfinder.rb
|
169
|
+
- windows/communication/winrmcommunicator.rb
|
170
|
+
- locales/en.yml
|
171
|
+
- .gitignore
|
172
|
+
homepage: https://github.com/kanzure/vagrant-plugin-dummy
|
173
|
+
licenses: []
|
174
|
+
post_install_message:
|
175
|
+
rdoc_options: []
|
176
|
+
require_paths:
|
177
|
+
- lib
|
178
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
179
|
+
none: false
|
180
|
+
requirements:
|
181
|
+
- - ! '>='
|
182
|
+
- !ruby/object:Gem::Version
|
183
|
+
version: '0'
|
184
|
+
segments:
|
185
|
+
- 0
|
186
|
+
hash: -1954023518708506020
|
187
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
188
|
+
none: false
|
189
|
+
requirements:
|
190
|
+
- - ! '>='
|
191
|
+
- !ruby/object:Gem::Version
|
192
|
+
version: '0'
|
193
|
+
segments:
|
194
|
+
- 0
|
195
|
+
hash: -1954023518708506020
|
196
|
+
requirements: []
|
197
|
+
rubyforge_project:
|
198
|
+
rubygems_version: 1.8.23
|
199
|
+
signing_key:
|
200
|
+
specification_version: 3
|
201
|
+
summary: A small gem that adds dummy guest support to vagrant, basically no vagrant
|
202
|
+
features
|
203
|
+
test_files:
|
204
|
+
- spec/vagrant-windows/winrmcommunicator_spec.rb
|
205
|
+
- spec/vagrant-windows/guestnetwork_spec.rb
|
206
|
+
- spec/vagrant-windows/config_spec.rb
|
207
|
+
- spec/vagrant-windows/helper_spec.rb
|