vagrant-solaris10 0.0.0 → 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.gitignore +5 -0
- data/.ruby-gemset +1 -0
- data/.ruby-version +1 -0
- data/.travis.yml +6 -0
- data/LICENSE.txt +3 -2
- data/README.md +18 -15
- data/Rakefile +1 -0
- data/lib/vagrant-solaris10/version.rb +1 -1
- data/lib/vagrant-solaris10.rb +42 -147
- data/vagrant-solaris10.gemspec +18 -15
- metadata +47 -19
- data/.rvmrc +0 -23
- data/tasks/gem.thor +0 -33
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 8dc8c986d8f6f31cdebaaf096e91caf522429e54
|
4
|
+
data.tar.gz: 249dae955333788e51ea3385c2e42ac74c5a9d62
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: b09d53c7eb2e3b3ac9b4efbc65cff0a7e1856403a7809fbe4541697464040c568eda78a1c88dc883f14135d75dcad0936436d4d0ab1ce667132fc689075c5629
|
7
|
+
data.tar.gz: 2f2e9d0faf38a9bcdbe1585234a59411532818a3ce4d4c1c338925387368c7e58a68fab1cad9d62d2619dc7a66aeb95f6d7da676ba6381a92dda3d9f7748027e
|
data/.gitignore
CHANGED
data/.ruby-gemset
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
vagrant-solaris10
|
data/.ruby-version
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
ruby-2.1.1
|
data/.travis.yml
ADDED
data/LICENSE.txt
CHANGED
@@ -1,4 +1,5 @@
|
|
1
|
-
Copyright (c) 2013 tnarik
|
1
|
+
Copyright (c) 2013-2014 tnarik
|
2
|
+
Copyright (c) 2014 Mitchell Hashimoto
|
2
3
|
|
3
4
|
MIT License
|
4
5
|
|
@@ -19,4 +20,4 @@ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
19
20
|
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
21
|
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
22
|
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
-
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
23
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
CHANGED
@@ -1,29 +1,32 @@
|
|
1
|
-
# Vagrant
|
1
|
+
# Vagrant-Solaris10
|
2
2
|
|
3
|
-
|
3
|
+
[](https://travis-ci.org/tnarik/vagrant-solaris10)
|
4
|
+
[](https://codeclimate.com/github/tnarik/vagrant-solaris10)
|
5
|
+
[](https://coveralls.io/r/tnarik/vagrant-solaris10)
|
6
|
+
[](http://rubygems.org/gems/vagrant-solaris10)
|
7
|
+
[](https://gemnasium.com/tnarik/vagrant-solaris10)
|
4
8
|
|
5
9
|
## Installation
|
6
10
|
|
7
|
-
|
11
|
+
Install via Vagrant
|
8
12
|
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
$ bundle
|
14
|
-
|
15
|
-
Or install it yourself as:
|
16
|
-
|
17
|
-
$ gem install vagrant-solaris10
|
13
|
+
```zsh
|
14
|
+
$ vagrant plugin install vagrant-solaris10
|
15
|
+
```
|
18
16
|
|
19
17
|
## Usage
|
20
18
|
|
21
|
-
|
19
|
+
This is a Vagrant plugin.
|
22
20
|
|
23
21
|
## Contributing
|
24
22
|
|
25
|
-
1. Fork it
|
23
|
+
1. Fork it ( https://github.com/tnarik/vagrant-solaris10/fork )
|
26
24
|
2. Create your feature branch (`git checkout -b my-new-feature`)
|
27
25
|
3. Commit your changes (`git commit -am 'Add some feature'`)
|
28
26
|
4. Push to the branch (`git push origin my-new-feature`)
|
29
|
-
5. Create new Pull Request
|
27
|
+
5. Create a new Pull Request
|
28
|
+
|
29
|
+
## Authors
|
30
|
+
|
31
|
+
- Tnarik Innael (@tnarik)
|
32
|
+
- Mitchell Hashimoto (@mitchellh) : portions of code used as base for capability implementation, from the original [Vagrant](https://github.com/mitchellh/vagrant) plugins code (1.6.5->1.7.x). Specific attribution will appear per file/method.
|
data/Rakefile
CHANGED
data/lib/vagrant-solaris10.rb
CHANGED
@@ -1,168 +1,63 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
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"
|
8
9
|
end
|
9
10
|
|
10
|
-
def
|
11
|
-
|
12
|
-
device = "#{vm.config.solaris.device}#{network[:interface]}"
|
13
|
-
su_cmd = vm.config.solaris.suexec_cmd
|
14
|
-
ifconfig_cmd = "#{su_cmd} /sbin/ifconfig #{device}"
|
15
|
-
|
16
|
-
vm.communicate.execute("#{ifconfig_cmd} plumb")
|
17
|
-
|
18
|
-
if network[:type].to_sym == :static
|
19
|
-
vm.communicate.execute("#{ifconfig_cmd} inet #{network[:ip]} netmask #{network[:netmask]}")
|
20
|
-
vm.communicate.execute("#{ifconfig_cmd} up")
|
21
|
-
vm.communicate.execute("#{su_cmd} sh -c \"echo '#{network[:ip]}' > /etc/hostname.#{device}\"")
|
22
|
-
elsif network[:type].to_sym == :dhcp
|
23
|
-
vm.communicate.execute("#{ifconfig_cmd} dhcp start")
|
24
|
-
end
|
25
|
-
end
|
11
|
+
def self.mount_vmware_shared_folder(machine, name, guestpath, options)
|
12
|
+
p "mount vmware"
|
26
13
|
end
|
27
14
|
|
28
|
-
|
29
|
-
|
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, "'")
|
30
19
|
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
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")
|
35
25
|
end
|
36
26
|
end
|
37
27
|
|
38
|
-
#
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
# does not exist in /etc/user_attr. TODO
|
43
|
-
def halt
|
44
|
-
# Wait until the VM's state is actually powered off. If this doesn't
|
45
|
-
# occur within a reasonable amount of time (15 seconds by default),
|
46
|
-
# then simply return and allow Vagrant to kill the vm.
|
47
|
-
count = 0
|
48
|
-
last_error = nil
|
49
|
-
while vm.state != :poweroff
|
50
|
-
begin
|
51
|
-
vm.communicate.execute("#{vm.config.solaris.suexec_cmd} /usr/sbin/poweroff")
|
52
|
-
rescue IOError => e
|
53
|
-
# Save the last error; if it's not shutdown in a reasonable amount
|
54
|
-
# of attempts we will re-raise the error so it's not hidden for
|
55
|
-
# all time
|
56
|
-
last_error = e
|
57
|
-
end
|
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, "'")
|
58
32
|
|
59
|
-
|
60
|
-
if
|
61
|
-
|
62
|
-
|
63
|
-
raise last_error
|
64
|
-
else
|
65
|
-
# Otherwise, just return
|
66
|
-
return
|
67
|
-
end
|
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")
|
68
37
|
end
|
69
|
-
|
70
|
-
# Still opportunities remaining; sleep and loop
|
71
|
-
sleep vm.config.solaris.halt_check_interval
|
72
|
-
end # while
|
73
|
-
end
|
74
|
-
|
75
|
-
def mount_shared_folder(name, guestpath, options)
|
76
|
-
# These are just far easier to use than the full options syntax
|
77
|
-
owner = options[:owner]
|
78
|
-
group = options[:group]
|
79
|
-
|
80
|
-
# Create the shared folder
|
81
|
-
vm.communicate.execute("#{vm.config.solaris.suexec_cmd} mkdir -p #{guestpath}")
|
82
|
-
|
83
|
-
# We have to use this `id` command instead of `/usr/bin/id` since this
|
84
|
-
# one accepts the "-u" and "-g" flags.
|
85
|
-
id_cmd = "/usr/xpg4/bin/id"
|
86
|
-
|
87
|
-
# Mount the folder with the proper owner/group
|
88
|
-
mount_options = "-o uid=`#{id_cmd} -u #{owner}`,gid=`#{id_cmd} -g #{group}`"
|
89
|
-
mount_options += ",#{options[:extra]}" if options[:extra]
|
90
|
-
vm.communicate.execute("#{vm.config.solaris.suexec_cmd} /sbin/mount -F vboxfs #{mount_options} #{name} #{guestpath}")
|
91
|
-
|
92
|
-
# chown the folder to the proper owner/group
|
93
|
-
vm.communicate.execute("#{vm.config.solaris.suexec_cmd} chown `#{id_cmd} -u #{owner}`.`#{id_cmd} -g #{group}` #{guestpath}")
|
94
|
-
end
|
95
|
-
end
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
class SolarisConfig < Vagrant.plugin("2", :config)
|
100
|
-
|
101
|
-
def detect?(vm)
|
102
|
-
vm.communicate.test("grep 'Solaris' /etc/release")
|
103
|
-
end
|
104
|
-
|
105
|
-
attr_accessor :halt_timeout
|
106
|
-
attr_accessor :halt_check_interval
|
107
|
-
# This sets the command to use to execute items as a superuser. pfexec is default
|
108
|
-
attr_accessor :suexec_cmd
|
109
|
-
attr_accessor :device
|
110
|
-
|
111
|
-
def initialize
|
112
|
-
@halt_timeout = 30
|
113
|
-
@halt_check_interval = 1
|
114
|
-
@suexec_cmd = 'pfexec'
|
115
|
-
@device = "e1000g"
|
116
38
|
end
|
117
39
|
end
|
40
|
+
end
|
118
41
|
|
119
|
-
|
120
|
-
# A general Vagrant system implementation for "solaris10".
|
121
42
|
class Plugin < Vagrant.plugin("2")
|
122
43
|
name "Solaris10 guest"
|
123
44
|
description "Solaris10 guest support."
|
124
45
|
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
# configurable, and this assists that goal.
|
129
|
-
|
130
|
-
guest(:solaris10) do
|
131
|
-
|
132
|
-
p "doing the guest"
|
133
|
-
p Vagrant::Plugin::V2::Plugin
|
134
|
-
|
135
|
-
Guest
|
136
|
-
end
|
137
|
-
|
138
|
-
config(:solaris10) do
|
139
|
-
SolarisConfig
|
140
|
-
end
|
46
|
+
guest_capability("solaris", "mount_vmware_shared_folder") do
|
47
|
+
A
|
48
|
+
end
|
141
49
|
|
142
|
-
|
143
|
-
|
144
|
-
|
50
|
+
guest_capability("solaris", "mount_parallels_shared_folder") do
|
51
|
+
A
|
52
|
+
end
|
145
53
|
|
54
|
+
guest_capability("solaris", "insert_public_key") do
|
55
|
+
A
|
56
|
+
end
|
146
57
|
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
# Solaris10::Guest::configure_networks
|
153
|
-
# end
|
154
|
-
#
|
155
|
-
# guest_capability("solaris10", "change_host_name") do
|
156
|
-
# Solaris10::Guest::change_host_name
|
157
|
-
# end
|
158
|
-
#
|
159
|
-
# guest_capability("solaris10", "mount_shared_folder") do
|
160
|
-
# Solaris10::Guest::mount_shared_folder
|
161
|
-
# end
|
162
|
-
#
|
163
|
-
# guest_capability("solaris10", "halt") do
|
164
|
-
# Guest::halt
|
165
|
-
# end
|
166
|
-
end
|
167
|
-
end
|
58
|
+
guest_capability("solaris", "remove_public_key") do
|
59
|
+
A
|
60
|
+
end
|
61
|
+
end
|
62
|
+
end
|
168
63
|
end
|
data/vagrant-solaris10.gemspec
CHANGED
@@ -1,21 +1,24 @@
|
|
1
|
-
#
|
1
|
+
# coding: utf-8
|
2
2
|
lib = File.expand_path('../lib', __FILE__)
|
3
3
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
4
|
require 'vagrant-solaris10/version'
|
5
5
|
|
6
|
-
Gem::Specification.new do |
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "vagrant-solaris10"
|
8
|
+
spec.version = Vagrant::Solaris10::VERSION
|
9
|
+
spec.authors = ["Tnarik Innael"]
|
10
|
+
spec.email = ["tnarik@lecafeautomatique.co.uk"]
|
11
|
+
spec.description = "Guest plugin for Vagrant Solaris10"
|
12
|
+
spec.summary = "Guest plugin for Vagrant Solaris10"
|
13
|
+
spec.homepage = "https://github.com/tnarik/vagrant-solaris10"
|
14
|
+
spec.license = "MIT"
|
14
15
|
|
15
|
-
|
16
|
+
spec.files = `git ls-files`.split($/)
|
17
|
+
spec.executables = spec.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
|
18
|
+
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
|
+
spec.require_paths = ["lib"]
|
16
20
|
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
end
|
21
|
+
# development dependencies
|
22
|
+
spec.add_development_dependency "bundler", "~> 1.6"
|
23
|
+
spec.add_development_dependency "rake"
|
24
|
+
end
|
metadata
CHANGED
@@ -1,55 +1,83 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vagrant-solaris10
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
5
|
-
prerelease:
|
4
|
+
version: 0.0.1
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Tnarik Innael
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date:
|
13
|
-
dependencies:
|
14
|
-
|
11
|
+
date: 2014-12-18 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: bundler
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1.6'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.6'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rake
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
description: Guest plugin for Vagrant Solaris10
|
15
42
|
email:
|
16
|
-
- tnarik@
|
43
|
+
- tnarik@lecafeautomatique.co.uk
|
17
44
|
executables: []
|
18
45
|
extensions: []
|
19
46
|
extra_rdoc_files: []
|
20
47
|
files:
|
21
|
-
- .gitignore
|
22
|
-
- .
|
48
|
+
- ".gitignore"
|
49
|
+
- ".ruby-gemset"
|
50
|
+
- ".ruby-version"
|
51
|
+
- ".travis.yml"
|
23
52
|
- Gemfile
|
24
53
|
- LICENSE.txt
|
25
54
|
- README.md
|
26
55
|
- Rakefile
|
27
56
|
- lib/vagrant-solaris10.rb
|
28
57
|
- lib/vagrant-solaris10/version.rb
|
29
|
-
- tasks/gem.thor
|
30
58
|
- vagrant-solaris10.gemspec
|
31
|
-
homepage:
|
32
|
-
licenses:
|
59
|
+
homepage: https://github.com/tnarik/vagrant-solaris10
|
60
|
+
licenses:
|
61
|
+
- MIT
|
62
|
+
metadata: {}
|
33
63
|
post_install_message:
|
34
64
|
rdoc_options: []
|
35
65
|
require_paths:
|
36
66
|
- lib
|
37
67
|
required_ruby_version: !ruby/object:Gem::Requirement
|
38
|
-
none: false
|
39
68
|
requirements:
|
40
|
-
- -
|
69
|
+
- - ">="
|
41
70
|
- !ruby/object:Gem::Version
|
42
71
|
version: '0'
|
43
72
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
44
|
-
none: false
|
45
73
|
requirements:
|
46
|
-
- -
|
74
|
+
- - ">="
|
47
75
|
- !ruby/object:Gem::Version
|
48
76
|
version: '0'
|
49
77
|
requirements: []
|
50
|
-
rubyforge_project:
|
51
|
-
rubygems_version:
|
78
|
+
rubyforge_project:
|
79
|
+
rubygems_version: 2.4.5
|
52
80
|
signing_key:
|
53
|
-
specification_version:
|
54
|
-
summary: Guest plugin for Vagrant
|
81
|
+
specification_version: 4
|
82
|
+
summary: Guest plugin for Vagrant Solaris10
|
55
83
|
test_files: []
|
data/.rvmrc
DELETED
@@ -1,23 +0,0 @@
|
|
1
|
-
#!/usr/bin/env bash
|
2
|
-
|
3
|
-
# This is an RVM Project .rvmrc file, used to automatically load the ruby
|
4
|
-
# development environment upon cd'ing into the directory
|
5
|
-
environment_id="ruby-1.9.3-p125@vagrant-solaris10"
|
6
|
-
|
7
|
-
# First we attempt to load the desired environment directly from the environment
|
8
|
-
# file. This is very fast and efficient compared to running through the entire
|
9
|
-
# CLI and selector. If you want feedback on which environment was used then
|
10
|
-
# insert the word 'use' after --create as this triggers verbose mode.
|
11
|
-
if [[ -d "${rvm_path:-$HOME/.rvm}/environments"
|
12
|
-
&& -s "${rvm_path:-$HOME/.rvm}/environments/$environment_id" ]]
|
13
|
-
then
|
14
|
-
\. "${rvm_path:-$HOME/.rvm}/environments/$environment_id"
|
15
|
-
[[ -s "${rvm_path:-$HOME/.rvm}/hooks/after_use" ]] &&
|
16
|
-
\. "${rvm_path:-$HOME/.rvm}/hooks/after_use" || true
|
17
|
-
else
|
18
|
-
# If the environment file has not yet been created, use the RVM CLI to select.
|
19
|
-
rvm --create use "$environment_id" || {
|
20
|
-
echo "Failed to create RVM environment '${environment_id}'."
|
21
|
-
return 1
|
22
|
-
}
|
23
|
-
fi
|
data/tasks/gem.thor
DELETED
@@ -1,33 +0,0 @@
|
|
1
|
-
class Gem < Thor
|
2
|
-
include Thor::Actions
|
3
|
-
|
4
|
-
# This allows for dynamic descriptions
|
5
|
-
begin
|
6
|
-
@gemhelper = Bundler::GemHelper.new
|
7
|
-
rescue
|
8
|
-
end
|
9
|
-
|
10
|
-
def initialize(*args)
|
11
|
-
super
|
12
|
-
@gemhelper = Bundler::GemHelper.new
|
13
|
-
end
|
14
|
-
|
15
|
-
# tasks
|
16
|
-
desc "build", @gemhelper.nil? ? "Building gem into the pkg directory" :
|
17
|
-
"Building #{@gemhelper.gemspec.name}-#{@gemhelper.gemspec.version}.gem into the pkg directory"
|
18
|
-
def build
|
19
|
-
@gemhelper.build_gem
|
20
|
-
end
|
21
|
-
|
22
|
-
desc "install", @gemhelper.nil? ? "Build and install gem into system gems" :
|
23
|
-
"Build and install #{@gemhelper.gemspec.name}-#{@gemhelper.gemspec.version}.gem into system gems"
|
24
|
-
def install
|
25
|
-
@gemhelper.install_gem
|
26
|
-
end
|
27
|
-
|
28
|
-
desc "release", @gemhelper.nil? ? "Create tag and build and push gem to Rubygems" :
|
29
|
-
"Create tag v#{@gemhelper.gemspec.version} and build and push #{@gemhelper.gemspec.name}-#{@gemhelper.gemspec.version}.gem to Rubygems"
|
30
|
-
def release
|
31
|
-
@gemhelper.release_gem
|
32
|
-
end
|
33
|
-
end
|