landrush-ip 0.2.1 → 0.2.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- OTJjMDkwMWVkMTQyMzJmNWQwOTBjMGJlYmE2MmJkZjk3NjNiODYyOA==
4
+ OTRkYWM4YjI0NmRlYzhhNTE0NjU1NmZlZDM0ODM5NGIxMDFlYTIyYQ==
5
5
  data.tar.gz: !binary |-
6
- NTU1ZDY2ODFjYTAyYzEzYmJlMGJiOGYxZmUyYmYwMDlmZTVkNTQ2MA==
6
+ YjJkYzdhNTJiZTgxNmQxZjg0NjcxOGUwYTJmN2ExMzYyM2Y5Y2I5ZQ==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- ZTg4OTdiZmVhNmRlMTE4NTk2OGJiODY5ODBmN2JhYzI0ZjU2NDJiODY0YzRh
10
- YTdhZWIwM2Q3YjBhN2Y0OGE4ZDI5YWJjMDM0MzViYzU5N2VhNzNjODgxZGM5
11
- ZTc5NzY0NmYzYzM1ODljMjllM2UwMjkwMmNiNTI0YjMwYmFmY2M=
9
+ MzIyNGUyZmUwMDJiMTQ2YTliMDE1YmQyOTJlZjBjOGUyMGI5YzNlZDVkNWQ0
10
+ MDgyMDE3NGI0ZjQwMWQ3ODZlNTFhZmNkOTM3NmY1YTAzMGM1ZWFmN2NiNGJj
11
+ MDMwYzYyNzQzNWY3Nzk3ZDdlZmRhMGVkZWMyMjAyZDkwODkxYTU=
12
12
  data.tar.gz: !binary |-
13
- ZWU4MWM1ZTk1NjYxNzllZjc3YWNkZjg3MjcxYmZjODAwNGY4MzU4MGU2ODQ0
14
- Zjc2MmFkMmJmNTkwM2Y5Yjg4M2YyYzRhNzY1YmFkMTIyNjYzZjgyZDMyYzVm
15
- YWIzNjdiMjg3N2E2NzllZDJjMjZhNWRkOWMyNDQxNTI3YTliMzI=
13
+ NTVlZjRmMmU4YWVlZTE3NTg4OTZmZjE1YjBhY2I1YjhkMDMyOGUxMTI0ZGMz
14
+ YzVjZWE4ODE0YzhiMmE0ZDk0ODRhYmEzMzQzMzM1M2NmZjRjNWMzZjQ0ZDY1
15
+ YmU0ZDhmMDFkZDYwMTU1YmY3MTM5MTA2NTdhZDQxYTdjZjFiODI=
@@ -0,0 +1,9 @@
1
+ module LandrushIp
2
+ module Cap
3
+ module Linux
4
+ def self.binary_path
5
+ '/usr/local/bin/landrush-ip'
6
+ end
7
+ end
8
+ end
9
+ end
@@ -1,4 +1,5 @@
1
1
  require 'yaml'
2
+ require 'landrush-ip/cap/linux'
2
3
 
3
4
  module LandrushIp
4
5
  module Cap
@@ -14,7 +15,7 @@ module LandrushIp
14
15
  end
15
16
 
16
17
  def self.command
17
- '/usr/local/bin/landrush-ip -yaml'
18
+ "#{LandrushIp::Cap::Linux.binary_path} -yaml"
18
19
  end
19
20
  end
20
21
  end
@@ -1,3 +1,5 @@
1
+ require 'landrush-ip/cap/linux'
2
+
1
3
  module LandrushIp
2
4
  module Cap
3
5
  module Linux
@@ -23,12 +25,11 @@ module LandrushIp
23
25
  binary = determine_binary result
24
26
 
25
27
  machine.communicate.tap do |comm|
26
- guest_path = '/usr/local/bin/landrush-ip'
27
28
  host_path = File.expand_path("util/dist/#{binary}", LandrushIp.source_root)
28
29
 
29
30
  comm.upload(host_path, '/tmp/landrush-ip')
30
- comm.sudo("mv /tmp/landrush-ip #{guest_path}")
31
- comm.sudo("chmod +x #{guest_path}", error_check: false)
31
+ comm.sudo("mv /tmp/landrush-ip #{LandrushIp::Cap::Linux.binary_path}")
32
+ comm.sudo("chmod +x #{LandrushIp::Cap::Linux.binary_path}", error_check: false)
32
33
  end
33
34
  end
34
35
  end
@@ -1,4 +1,5 @@
1
1
  require 'landrush-ip/version'
2
+ require 'landrush-ip/cap/linux'
2
3
 
3
4
  module LandrushIp
4
5
  module Cap
@@ -14,7 +15,7 @@ module LandrushIp
14
15
  end
15
16
 
16
17
  def self.command
17
- '/usr/local/bin/landrush-ip -v || echo 0'
18
+ "#{LandrushIp::Cap::Linux.binary_path} -v || echo 0"
18
19
  end
19
20
  end
20
21
  end
@@ -0,0 +1,9 @@
1
+ module LandrushIp
2
+ module Cap
3
+ module Windows
4
+ def self.binary_path
5
+ 'C:\\landrush-ip.exe'
6
+ end
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,23 @@
1
+ require 'yaml'
2
+ require 'landrush-ip/cap/windows'
3
+
4
+ module LandrushIp
5
+ module Cap
6
+ module Windows
7
+ module LandrushIpGet
8
+ def self.landrush_ip_get(machine)
9
+ result = ''
10
+ machine.communicate.execute(command) do |type, data|
11
+ result << data if type == :stdout
12
+ end
13
+
14
+ YAML.load(result)
15
+ end
16
+
17
+ def self.command
18
+ "#{LandrushIp::Cap::Windows.binary_path} -yaml"
19
+ end
20
+ end
21
+ end
22
+ end
23
+ end
@@ -0,0 +1,47 @@
1
+ require 'landrush-ip/cap/windows'
2
+
3
+ module LandrushIp
4
+ module Cap
5
+ module Windows
6
+ module LandrushIpInstall
7
+ def self.determine_binary(uname)
8
+ if uname =~ /(x64)/i
9
+ 'landrush-ip-windows_amd64.exe'
10
+ elsif result =~ /(x86)/i
11
+ 'landrush-ip-windows_386.exe'
12
+ else
13
+ raise LandrushIp::Error, :unsupported_arch
14
+ end
15
+ end
16
+
17
+ def self.landrush_ip_install(machine)
18
+ result = ''
19
+ machine.communicate.execute(command) do |type, data|
20
+ result << data if type == :stdout
21
+ end
22
+
23
+ binary = determine_binary result
24
+
25
+ machine.communicate.tap do |comm|
26
+ host_path = File.expand_path("util/dist/#{binary}", LandrushIp.source_root)
27
+
28
+ comm.upload(host_path, LandrushIp::Cap::Windows.binary_path)
29
+ end
30
+ end
31
+
32
+ def self.command
33
+ <<-CMD
34
+ $Arch = "x64"
35
+ if ("%PROCESSOR_ARCHITECTURE%" -eq "x86") {
36
+ if (not defined PROCESSOR_ARCHITEW6432) {
37
+ $Arch = "x86"
38
+ }
39
+ }
40
+ Write-Host $Arch
41
+ exit 0
42
+ CMD
43
+ end
44
+ end
45
+ end
46
+ end
47
+ end
@@ -0,0 +1,33 @@
1
+ require 'landrush-ip/version'
2
+ require 'landrush-ip/cap/windows'
3
+
4
+ module LandrushIp
5
+ module Cap
6
+ module Windows
7
+ module LandrushIpInstalled
8
+ def self.landrush_ip_installed(machine)
9
+ result = ''
10
+ machine.communicate.execute(command) do |type, data|
11
+ result << data if type == :stdout
12
+ end
13
+
14
+ result.strip! == LandrushIp::VERSION
15
+ end
16
+
17
+ def self.command
18
+ <<-CMD
19
+ try {
20
+ if(Get-Command #{LandrushIp::Cap::Windows.binary_path}){
21
+ #{LandrushIp::Cap::Windows.binary_path} -v
22
+ exit 0
23
+ }
24
+ } Catch {
25
+ Write-Host "0"
26
+ exit 0
27
+ }
28
+ CMD
29
+ end
30
+ end
31
+ end
32
+ end
33
+ end
@@ -27,11 +27,40 @@ module LandrushIp
27
27
  Cap::Linux::LandrushIpGet
28
28
  end
29
29
 
30
+ guest_capability('windows', 'landrush_ip_installed') do
31
+ require 'landrush-ip/cap/windows/landrush_ip_installed'
32
+ Cap::Windows::LandrushIpInstalled
33
+ end
34
+
35
+ guest_capability('windows', 'landrush_ip_install') do
36
+ require 'landrush-ip/cap/windows/landrush_ip_install'
37
+ Cap::Windows::LandrushIpInstall
38
+ end
39
+
40
+ guest_capability('windows', 'landrush_ip_get') do
41
+ require 'landrush-ip/cap/windows/landrush_ip_get'
42
+ Cap::Windows::LandrushIpGet
43
+ end
44
+
30
45
  require 'landrush-ip/action/install'
31
46
 
32
47
  %w(up reload).each do |action|
33
48
  action_hook(:landrush_ip, "machine_action_#{action}".to_sym) do |hook|
34
- hook.before(Landrush::Action::RedirectDns, Action::Install, :provision)
49
+ if defined?(VagrantPlugins::ProviderVirtualBox)
50
+ hook.before(VagrantPlugins::ProviderVirtualBox::Action::Network, Action::Install, :provision)
51
+ end
52
+
53
+ if defined?(VagrantPlugins::ProviderLibvirt)
54
+ hook.after(VagrantPlugins::ProviderLibvirt::Action::CreateNetworks, Action::Install, :provision)
55
+ end
56
+
57
+ if defined?(HashiCorp::VagrantVMwarefusion)
58
+ hook.before(HashiCorp::VagrantVMwarefusion::Action::Network, Action::Install, :provision)
59
+ end
60
+
61
+ if defined?(VagrantPlugins::Parallels)
62
+ hook.before(VagrantPlugins::Parallels::Action::Network, Action::Install, :provision)
63
+ end
35
64
  end
36
65
  end
37
66
  end
@@ -1,3 +1,3 @@
1
1
  module LandrushIp
2
- VERSION = '0.2.1'.freeze
2
+ VERSION = '0.2.3'.freeze
3
3
  end
metadata CHANGED
@@ -1,29 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: landrush-ip
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Paul Werelds
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-05-30 00:00:00.000000000 Z
11
+ date: 2016-06-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ~>
17
+ - - ! '>='
18
18
  - !ruby/object:Gem::Version
19
- version: '10.0'
19
+ version: '0'
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ~>
24
+ - - ! '>='
25
25
  - !ruby/object:Gem::Version
26
- version: '10.0'
26
+ version: '0'
27
27
  description:
28
28
  email:
29
29
  - paul@neverbland.com
@@ -36,9 +36,14 @@ files:
36
36
  - README.md
37
37
  - lib/landrush-ip.rb
38
38
  - lib/landrush-ip/action/install.rb
39
+ - lib/landrush-ip/cap/linux.rb
39
40
  - lib/landrush-ip/cap/linux/landrush_ip_get.rb
40
41
  - lib/landrush-ip/cap/linux/landrush_ip_install.rb
41
42
  - lib/landrush-ip/cap/linux/landrush_ip_installed.rb
43
+ - lib/landrush-ip/cap/windows.rb
44
+ - lib/landrush-ip/cap/windows/landrush_ip_get.rb
45
+ - lib/landrush-ip/cap/windows/landrush_ip_install.rb
46
+ - lib/landrush-ip/cap/windows/landrush_ip_installed.rb
42
47
  - lib/landrush-ip/config.rb
43
48
  - lib/landrush-ip/errors.rb
44
49
  - lib/landrush-ip/plugin.rb
@@ -47,6 +52,8 @@ files:
47
52
  - util/dist/landrush-ip-linux_386
48
53
  - util/dist/landrush-ip-linux_amd64
49
54
  - util/dist/landrush-ip-linux_arm
55
+ - util/dist/landrush-ip-windows_386.exe
56
+ - util/dist/landrush-ip-windows_amd64.exe
50
57
  homepage: https://github.com/Werelds/landrush-ip
51
58
  licenses:
52
59
  - MIT