vagrant-solaris10 0.0.1 → 0.0.2

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: 8dc8c986d8f6f31cdebaaf096e91caf522429e54
4
- data.tar.gz: 249dae955333788e51ea3385c2e42ac74c5a9d62
3
+ metadata.gz: 01667b843e06f08aa5f3e746b92d57d3d394b98d
4
+ data.tar.gz: 72b7fa074ff551d7014f870b30dd5b2a3b04d48c
5
5
  SHA512:
6
- metadata.gz: b09d53c7eb2e3b3ac9b4efbc65cff0a7e1856403a7809fbe4541697464040c568eda78a1c88dc883f14135d75dcad0936436d4d0ab1ce667132fc689075c5629
7
- data.tar.gz: 2f2e9d0faf38a9bcdbe1585234a59411532818a3ce4d4c1c338925387368c7e58a68fab1cad9d62d2619dc7a66aeb95f6d7da676ba6381a92dda3d9f7748027e
6
+ metadata.gz: ec901eb2c143afa0a074e1d31c2f76f906fc9bf1dc9e24fbc167c5a1145690010546e026bb9f6d1222ac1ba590c64578db4321e4d45fd44382cfe0d42f03aecc
7
+ data.tar.gz: 2b5960d8797c505478b314471936b46cbce36e6f5eacbdb4333445ca4174e9c39f15910f4b89157f46f75efc9bb746ded46ad30b6f9fe015dabd36c35e06e688
data/README.md CHANGED
@@ -6,6 +6,13 @@
6
6
  [![RubyGems](http://img.shields.io/gem/v/vagrant-solaris10.svg)](http://rubygems.org/gems/vagrant-solaris10)
7
7
  [![Gemnasium](http://img.shields.io/gemnasium/tnarik/vagrant-solaris10.svg)](https://gemnasium.com/tnarik/vagrant-solaris10)
8
8
 
9
+ # Description
10
+
11
+ This is a Vagrant plugin for Solaris 10.
12
+ As opossed to the default implementation of the Vagrant Solaris 10 plugin part of Vagrant, this implementation tries to avoid non Solaris tools or approaches, as the main target is a 'as pure as possible' Solaris 10 machine. This means most of the tools installed in the system will be default Solaris one and not GNU replacements. GNU replacements, when installed, are available as separate commands, straight from the installation packages.
13
+
14
+ The main machine this plugin is used with is [my Solaris10 Packer build](https://github.com/tnarik/basebox-solaris10).
15
+
9
16
  ## Installation
10
17
 
11
18
  Install via Vagrant
@@ -14,10 +21,6 @@ Install via Vagrant
14
21
  $ vagrant plugin install vagrant-solaris10
15
22
  ```
16
23
 
17
- ## Usage
18
-
19
- This is a Vagrant plugin.
20
-
21
24
  ## Contributing
22
25
 
23
26
  1. Fork it ( https://github.com/tnarik/vagrant-solaris10/fork )
data/Rakefile CHANGED
@@ -1,2 +1,3 @@
1
1
  require "bundler/gem_tasks"
2
2
 
3
+ task :default => :build
@@ -0,0 +1,23 @@
1
+ # Copyright (c) 2014 Tnarik Innael - repackaged
2
+ # Copyright (c) 2014 Mitchell Hashimoto - from plugins/guest/linux/cap/insert_public_key.rb
3
+ module Vagrant
4
+ module Solaris10
5
+ module Cap
6
+ class InsertPublicKey
7
+
8
+ def self.insert_public_key(machine, contents)
9
+ contents = contents.chomp
10
+ contents = Vagrant::Util::ShellQuote.escape(contents, "'")
11
+
12
+ machine.communicate.tap do |comm|
13
+ comm.execute("mkdir -p ~/.ssh")
14
+ comm.execute("chmod 0700 ~/.ssh")
15
+ comm.execute("printf '#{contents}\\n' >> ~/.ssh/authorized_keys")
16
+ comm.execute("chmod 0600 ~/.ssh/authorized_keys")
17
+ end
18
+ end
19
+
20
+ end
21
+ end
22
+ end
23
+ end
@@ -0,0 +1,15 @@
1
+ # Copyright (c) 2014 Tnarik Innael - adaptation to Solaris and repackaging
2
+ # Copyright (c) 2013-2014 timsutton/kalmanh/lsimons - from plugins/guests/darwin/cap/mount_vmware_shared_folder.rb
3
+ module Vagrant
4
+ module Solaris10
5
+ module Cap
6
+ class MountParallelsSharedFolder
7
+
8
+ def self.mount_parallels_shared_folder(machine, name, guestpath, options)
9
+ p "mount parallels"
10
+ end
11
+
12
+ end
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,28 @@
1
+ # Copyright (c) 2014 Tnarik Innael - adaptation to Solaris and repackaging
2
+ # Copyright (c) 2013-2014 timsutton/kalmanh/lsimons - from plugins/guests/darwin/cap/mount_vmware_shared_folder.rb
3
+ module Vagrant
4
+ module Solaris10
5
+ module Cap
6
+ class MountVmwareSharedFolder
7
+
8
+ def self.mount_vmware_shared_folder(machine, name, guestpath, options)
9
+ machine.communicate.tap do |comm|
10
+ # clear prior symlink
11
+ if comm.test("test -L \"#{guestpath}\"", sudo: true)
12
+ comm.sudo("rm -f \"#{guestpath}\"")
13
+ end
14
+
15
+ # clear prior directory if exists
16
+ if comm.test("test -d \"#{guestpath}\"", sudo: true)
17
+ comm.sudo("rm -Rf \"#{guestpath}\"")
18
+ end
19
+
20
+ # finally make the symlink
21
+ comm.sudo("ln -s \"/hgfs/#{name}\" \"#{guestpath}\"")
22
+ end
23
+ end
24
+
25
+ end
26
+ end
27
+ end
28
+ end
@@ -0,0 +1,23 @@
1
+ # Copyright (c) 2014 Tnarik Innael - adaptation to Solaris and repackaging
2
+ # Copyright (c) 2014 Mitchell Hashimoto - from plugins/guest/linux/cap/remove_public_key.rb
3
+ module Vagrant
4
+ module Solaris10
5
+ module Cap
6
+ class RemovePublicKey
7
+
8
+ def self.remove_public_key(machine, contents)
9
+ contents = contents.chomp
10
+ contents = Vagrant::Util::ShellQuote.escape(contents, "'")
11
+
12
+ machine.communicate.tap do |comm|
13
+ if comm.test("test -f ~/.ssh/authorized_keys")
14
+ comm.execute(
15
+ "gsed -i '/^.*#{contents}.*$/d' ~/.ssh/authorized_keys")
16
+ end
17
+ end
18
+ end
19
+
20
+ end
21
+ end
22
+ end
23
+ end
@@ -0,0 +1,15 @@
1
+ module Vagrant
2
+ module Solaris10
3
+ module Cap
4
+ class RSync
5
+
6
+ def self.rsync_post(machine, opts)
7
+ machine.communicate.execute(
8
+ "#{machine.config.solaris.suexec_cmd} find '#{opts[:guestpath]}' '(' ! -user #{opts[:owner]} -o ! -group #{opts[:group]} ')' " +
9
+ " -exec chown #{opts[:owner]}:#{opts[:group]} {} +")
10
+ end
11
+
12
+ end
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,36 @@
1
+ require "vagrant"
2
+
3
+ module Vagrant
4
+ module Solaris10
5
+
6
+ class Plugin < Vagrant.plugin("2")
7
+ name "Solaris10 guest"
8
+ description "Solaris10 guest support."
9
+
10
+ guest_capability("solaris", "mount_vmware_shared_folder") do
11
+ require_relative "cap/mount_vmware_shared_folder"
12
+ Cap::MountVmwareSharedFolder
13
+ end
14
+
15
+ guest_capability("solaris", "mount_parallels_shared_folder") do
16
+ require_relative "cap/mount_parallels_shared_folder"
17
+ Cap::MountParallelsSharedFolder
18
+ end
19
+
20
+ guest_capability("solaris", "insert_public_key") do
21
+ require_relative "cap/insert_public_key"
22
+ Cap::InsertPublicKey
23
+ end
24
+
25
+ guest_capability("solaris", "remove_public_key") do
26
+ require_relative "cap/remove_public_key"
27
+ Cap::RemovePublicKey
28
+ end
29
+
30
+ guest_capability("solaris", "rsync_post") do
31
+ require_relative "cap/rsync"
32
+ Cap::RSync
33
+ end
34
+ end
35
+ end
36
+ end
@@ -1,5 +1,5 @@
1
1
  module Vagrant
2
2
  module Solaris10
3
- VERSION = "0.0.1"
3
+ VERSION = "0.0.2"
4
4
  end
5
- end
5
+ end
@@ -1,63 +1,2 @@
1
1
  require "vagrant-solaris10/version"
2
- require "vagrant"
3
-
4
- module Vagrant
5
- module Solaris10
6
- class A
7
- def self.mount_parallels_shared_folder(machine, name, guestpath, options)
8
- p "mount parallels"
9
- end
10
-
11
- def self.mount_vmware_shared_folder(machine, name, guestpath, options)
12
- p "mount vmware"
13
- end
14
-
15
- # Copyright (c) 2014 Mitchell Hashimoto
16
- def self.insert_public_key(machine, contents)
17
- contents = contents.chomp
18
- contents = Vagrant::Util::ShellQuote.escape(contents, "'")
19
-
20
- machine.communicate.tap do |comm|
21
- comm.execute("mkdir -p ~/.ssh")
22
- comm.execute("chmod 0700 ~/.ssh")
23
- comm.execute("printf '#{contents}\\n' >> ~/.ssh/authorized_keys")
24
- comm.execute("chmod 0600 ~/.ssh/authorized_keys")
25
- end
26
- end
27
-
28
- # Copyright (c) 2014 Mitchell Hashimoto
29
- def self.remove_public_key(machine, contents)
30
- contents = contents.chomp
31
- contents = Vagrant::Util::ShellQuote.escape(contents, "'")
32
-
33
- machine.communicate.tap do |comm|
34
- if comm.test("test -f ~/.ssh/authorized_keys")
35
- comm.execute(
36
- "gsed -i '/^.*#{contents}.*$/d' ~/.ssh/authorized_keys")
37
- end
38
- end
39
- end
40
- end
41
-
42
- class Plugin < Vagrant.plugin("2")
43
- name "Solaris10 guest"
44
- description "Solaris10 guest support."
45
-
46
- guest_capability("solaris", "mount_vmware_shared_folder") do
47
- A
48
- end
49
-
50
- guest_capability("solaris", "mount_parallels_shared_folder") do
51
- A
52
- end
53
-
54
- guest_capability("solaris", "insert_public_key") do
55
- A
56
- end
57
-
58
- guest_capability("solaris", "remove_public_key") do
59
- A
60
- end
61
- end
62
- end
63
- end
2
+ require "vagrant-solaris10/plugin"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vagrant-solaris10
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tnarik Innael
@@ -54,6 +54,12 @@ files:
54
54
  - README.md
55
55
  - Rakefile
56
56
  - lib/vagrant-solaris10.rb
57
+ - lib/vagrant-solaris10/cap/insert_public_key.rb
58
+ - lib/vagrant-solaris10/cap/mount_parallels_shared_folder.rb
59
+ - lib/vagrant-solaris10/cap/mount_vmware_shared_folder.rb
60
+ - lib/vagrant-solaris10/cap/remove_public_key.rb
61
+ - lib/vagrant-solaris10/cap/rsync.rb
62
+ - lib/vagrant-solaris10/plugin.rb
57
63
  - lib/vagrant-solaris10/version.rb
58
64
  - vagrant-solaris10.gemspec
59
65
  homepage: https://github.com/tnarik/vagrant-solaris10