vagrant-solaris10 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8fe793851c454fdf9487f7926caeb4315a77694b
4
- data.tar.gz: a23a987241ac69f815e8aa308b732e5467e63e36
3
+ metadata.gz: a9ee3c6ec71a972047619e746f4d28c6f994f348
4
+ data.tar.gz: 05b2380b38d9bac9575b223c79daa257eae1d741
5
5
  SHA512:
6
- metadata.gz: 194c73b855a7bef609f32aedf674e2e4000f9de77ea9bd2f929cc80346778aed199492cac7ac77f2151fdafdc0bb9357c6fda2f4dc561c7bdfd3bd2734f57301
7
- data.tar.gz: 4751b5fba00849c604785c02b2796ca1c3d87821e9d94072dcd87a5b3d2dda88a774fcea2bc74af4c5f35f6f3c874635cf7b3e24c4554ccc2eeb8d0673d7e284
6
+ metadata.gz: a5e58cfd6b6a4de58b038535755e3cace82eb6d6d12a0bde9878f096317dce7d6f07364f4f3357327e0c9fde9d8c333841088a29ee4311ad4ee562dbf16edb83
7
+ data.tar.gz: a9a35bee667e6405c22d655c62a2dfec3b3b14057a9eba7c78a7cd9edefab578c164c5e7e9aa0c672857ca3fdad0a0effc35f3a6478c29fb84f67b1bab09f258
@@ -0,0 +1,38 @@
1
+ # Copyright (c) 2014 Tnarik Innael - fix to properly work with Solaris 10 and repackaging
2
+ # Copyright (c) 2013 Mitchell Hashimoto - from plugins/guest/solaris/cap/change_host_name.rb
3
+ module Vagrant
4
+ module Solaris10
5
+ module Cap
6
+ class ChangeHostName
7
+
8
+ def self.change_host_name(machine, name)
9
+
10
+ # Only do this if the hostname is not already set
11
+ machine.communicate.tap do |comm|
12
+ if !comm.test("#{machine.config.solaris.suexec_cmd} hostname | grep '#{name}")
13
+ ifconfig = nil
14
+ # Get ifconfig output
15
+ comm.execute("ifconfig -a") do |type, data|
16
+ if type == :stdout
17
+ ifconfig ||= ""
18
+ ifconfig += data
19
+ end
20
+ end
21
+
22
+ broadcasting_interface = ifconfig.scan(/^(\w+).*BROADCAST/)[0][0]
23
+ broadcasting_ip = ifconfig.scan(/inet\s(\S+).*broadcast/)[0][0]
24
+
25
+ comm.sudo("sh -c \"echo '#{name}' > /etc/nodename\"")
26
+ comm.sudo("sh -c \"echo '#{name}' > /etc/hostname.#{broadcasting_interface}\"")
27
+ comm.sudo("sh -c \"gsed -i -e 's/\\(#{broadcasting_ip}\\s*\\).*/\\1#{name}/g' /etc/hosts\"")
28
+
29
+ comm.sudo("uname -S #{name}")
30
+ end
31
+ end
32
+
33
+ end
34
+
35
+ end
36
+ end
37
+ end
38
+ end
@@ -21,6 +21,11 @@ module Vagrant
21
21
  Cap::MountNFSFolder
22
22
  end
23
23
 
24
+ guest_capability("solaris", "change_host_name") do
25
+ require_relative "cap/change_host_name"
26
+ Cap::ChangeHostName
27
+ end
28
+
24
29
  guest_capability("solaris", "insert_public_key") do
25
30
  require_relative "cap/insert_public_key"
26
31
  Cap::InsertPublicKey
@@ -42,4 +47,4 @@ module Vagrant
42
47
  end
43
48
  end
44
49
  end
45
- end
50
+ end
@@ -1,5 +1,5 @@
1
1
  module Vagrant
2
2
  module Solaris10
3
- VERSION = "0.0.3"
3
+ VERSION = "0.0.4"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vagrant-solaris10
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tnarik Innael
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-12-18 00:00:00.000000000 Z
11
+ date: 2014-12-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -54,6 +54,7 @@ files:
54
54
  - README.md
55
55
  - Rakefile
56
56
  - lib/vagrant-solaris10.rb
57
+ - lib/vagrant-solaris10/cap/change_host_name.rb
57
58
  - lib/vagrant-solaris10/cap/insert_public_key.rb
58
59
  - lib/vagrant-solaris10/cap/mount_nfs_folder.rb
59
60
  - lib/vagrant-solaris10/cap/mount_parallels_shared_folder.rb