vagrant-smartos-guest 0.0.1.pre.1 → 0.0.1.pre.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ae6b489bc2acfeaffc3aaa15ed83957d7be2e816
4
- data.tar.gz: 6acc4e6487dc2d1e3b63e734fcdb1e4b77dd87df
3
+ metadata.gz: dee092fcabd9dfaf6d67050e20c22dc6ff4b905b
4
+ data.tar.gz: bf7bbca5e49a6165625955057517bab2eb02ac32
5
5
  SHA512:
6
- metadata.gz: a91738cc7e676ab5c8000053e6e2f9124efe51ba32b28024d95be7ded349a3d72eca9bc5a229303ae2bb0e26c31be401add8f51092a31bd2eb44fea9d096edbb
7
- data.tar.gz: f3e2866b278a7db8e8b4ac5db3a9ae8cd3f28f0e0336f21c53dcbd5b7ab7bb0de3dd6eceea0aea60c321c9e47a35409c424bcc2beb045ee4686522de4c24fe03
6
+ metadata.gz: eaabaeae218f672ca25b84c235459edf1e6cf55af501a62d318fe3d5d652d51c86b345e42ccb4d6f3c4dd1ce9852d0272758d48f6d0072768abfbc3cc4b4263d
7
+ data.tar.gz: e7d33aabf39a63b3eb0cd084ba3b7132dcffd72bb0b38b7398c5eceb2e49aad7860220c93f0a08230e2dbe831a1ee5bb8baacdbd013f45672b8c8913f715d851
@@ -1,2 +1,3 @@
1
+ require 'vagrant'
1
2
  require 'vagrant/smartos/guest/version'
2
3
  require 'vagrant/smartos/guest/plugin'
@@ -1,14 +1,16 @@
1
1
  module Vagrant
2
2
  module Smartos
3
- module Cap
4
- class ChangeHostName
5
- def self.change_host_name(machine, name)
6
- su_cmd = machine.config.smartos.suexec_cmd
3
+ module Guest
4
+ module Cap
5
+ class ChangeHostName
6
+ def self.change_host_name(machine, name)
7
+ su_cmd = machine.config.smartos.suexec_cmd
7
8
 
8
- # Only do this if the hostname is not already set
9
- if !machine.communicate.test("hostname | grep '#{name}'")
10
- machine.communicate.execute("#{su_cmd} sh -c \"echo '#{name}' > /etc/nodename\"")
11
- machine.communicate.execute("#{su_cmd} hostname #{name}")
9
+ # Only do this if the hostname is not already set
10
+ if !machine.communicate.test("hostname | grep '#{name}'")
11
+ machine.communicate.execute("#{su_cmd} sh -c \"echo '#{name}' > /etc/nodename\"")
12
+ machine.communicate.execute("#{su_cmd} hostname #{name}")
13
+ end
12
14
  end
13
15
  end
14
16
  end
@@ -1,22 +1,24 @@
1
1
  module Vagrant
2
2
  module Smartos
3
- module Cap
4
- class ConfigureNetworks
5
- def self.configure_networks(machine, networks)
6
- su_cmd = machine.config.smartos.suexec_cmd
3
+ module Guest
4
+ module Cap
5
+ class ConfigureNetworks
6
+ def self.configure_networks(machine, networks)
7
+ su_cmd = machine.config.smartos.suexec_cmd
7
8
 
8
- networks.each do |network|
9
- device = "#{machine.config.smartos.device}#{network[:interface]}"
10
- ifconfig_cmd = "#{su_cmd} /sbin/ifconfig #{device}"
9
+ networks.each do |network|
10
+ device = "#{machine.config.smartos.device}#{network[:interface]}"
11
+ ifconfig_cmd = "#{su_cmd} /sbin/ifconfig #{device}"
11
12
 
12
- machine.communicate.execute("#{ifconfig_cmd} plumb")
13
+ machine.communicate.execute("#{ifconfig_cmd} plumb")
13
14
 
14
- if network[:type].to_sym == :static
15
- machine.communicate.execute("#{ifconfig_cmd} inet #{network[:ip]} netmask #{network[:netmask]}")
16
- machine.communicate.execute("#{ifconfig_cmd} up")
17
- machine.communicate.execute("#{su_cmd} sh -c \"echo '#{network[:ip]}' > /etc/hostname.#{device}\"")
18
- elsif network[:type].to_sym == :dhcp
19
- machine.communicate.execute("#{ifconfig_cmd} dhcp start")
15
+ if network[:type].to_sym == :static
16
+ machine.communicate.execute("#{ifconfig_cmd} inet #{network[:ip]} netmask #{network[:netmask]}")
17
+ machine.communicate.execute("#{ifconfig_cmd} up")
18
+ machine.communicate.execute("#{su_cmd} sh -c \"echo '#{network[:ip]}' > /etc/hostname.#{device}\"")
19
+ elsif network[:type].to_sym == :dhcp
20
+ machine.communicate.execute("#{ifconfig_cmd} dhcp start")
21
+ end
20
22
  end
21
23
  end
22
24
  end
@@ -1,19 +1,21 @@
1
1
  module Vagrant
2
2
  module Smartos
3
- module Cap
4
- class Halt
5
- def self.halt(machine)
6
- # There should be an exception raised if the line
7
- #
8
- # vagrant::::profiles=Primary Administrator
9
- #
10
- # does not exist in /etc/user_attr. TODO
11
- begin
12
- machine.communicate.execute(
13
- "#{machine.config.smartos.suexec_cmd} /usr/sbin/shutdown -y -i5 -g0")
14
- rescue IOError
15
- # Ignore, this probably means connection closed because it
16
- # shut down.
3
+ module Guest
4
+ module Cap
5
+ class Halt
6
+ def self.halt(machine)
7
+ # There should be an exception raised if the line
8
+ #
9
+ # vagrant::::profiles=Primary Administrator
10
+ #
11
+ # does not exist in /etc/user_attr. TODO
12
+ begin
13
+ machine.communicate.execute(
14
+ "#{machine.config.smartos.suexec_cmd} /usr/sbin/shutdown -y -i5 -g0")
15
+ rescue IOError
16
+ # Ignore, this probably means connection closed because it
17
+ # shut down.
18
+ end
17
19
  end
18
20
  end
19
21
  end
@@ -1,14 +1,16 @@
1
1
  module Vagrant
2
2
  module Smartos
3
- module Cap
4
- class MountNFS
5
- def self.mount_nfs_folder(machine, ip, folders)
6
- sudo = machine.config.smartos.suexec_cmd
3
+ module Guest
4
+ module Cap
5
+ class MountNFS
6
+ def self.mount_nfs_folder(machine, ip, folders)
7
+ sudo = machine.config.smartos.suexec_cmd
7
8
 
8
- folders.each do |name, opts|
9
- machine.communicate.tap do |comm|
10
- comm.execute("#{sudo} mkdir -p #{opts[:guestpath]}", {:shell => "sh"})
11
- comm.execute("#{sudo} /usr/sbin/mount -F nfs '#{ip}:#{opts[:hostpath]}' '#{opts[:guestpath]}'", {:shell => "sh"})
9
+ folders.each do |name, opts|
10
+ machine.communicate.tap do |comm|
11
+ comm.execute("#{sudo} mkdir -p #{opts[:guestpath]}", {:shell => "sh"})
12
+ comm.execute("#{sudo} /usr/sbin/mount -F nfs '#{ip}:#{opts[:hostpath]}' '#{opts[:guestpath]}'", {:shell => "sh"})
13
+ end
12
14
  end
13
15
  end
14
16
  end
@@ -1,23 +1,25 @@
1
1
  module Vagrant
2
2
  module Smartos
3
- module Cap
4
- class RSync
5
- def self.rsync_installed(machine)
6
- machine.communicate.test("which rsync")
7
- end
3
+ module Guest
4
+ module Cap
5
+ class RSync
6
+ def self.rsync_installed(machine)
7
+ machine.communicate.test("which rsync")
8
+ end
8
9
 
9
- def self.rsync_install(machine, folder_opts)
10
- username = machine.ssh_info[:username]
11
- sudo = machine.config.smartos.suexec_cmd
10
+ def self.rsync_install(machine, folder_opts)
11
+ username = machine.ssh_info[:username]
12
+ sudo = machine.config.smartos.suexec_cmd
12
13
 
13
- machine.communicate.tap do |comm|
14
- comm.execute("#{sudo} mkdir -p '#{folder_opts[:guestpath]}'")
15
- comm.execute("#{sudo} chown -R #{username} '#{folder_opts[:guestpath]}'")
14
+ machine.communicate.tap do |comm|
15
+ comm.execute("#{sudo} mkdir -p '#{folder_opts[:guestpath]}'")
16
+ comm.execute("#{sudo} chown -R #{username} '#{folder_opts[:guestpath]}'")
17
+ end
16
18
  end
17
- end
18
19
 
19
- def self.rsync_pre(machine, folder_opts)
20
- rsync_install(machine, folder_opts)
20
+ def self.rsync_pre(machine, folder_opts)
21
+ rsync_install(machine, folder_opts)
22
+ end
21
23
  end
22
24
  end
23
25
  end
@@ -2,18 +2,20 @@ require 'vagrant'
2
2
 
3
3
  module Vagrant
4
4
  module Smartos
5
- class Config < Vagrant.plugin("2", :config)
6
- attr_accessor :halt_timeout
7
- attr_accessor :halt_check_interval
8
- # This sets the command to use to execute items as a superuser. sudo is default
9
- attr_accessor :suexec_cmd
10
- attr_accessor :device
5
+ module Guest
6
+ class Config < Vagrant.plugin("2", :config)
7
+ attr_accessor :halt_timeout
8
+ attr_accessor :halt_check_interval
9
+ # This sets the command to use to execute items as a superuser. sudo is default
10
+ attr_accessor :suexec_cmd
11
+ attr_accessor :device
11
12
 
12
- def initialize
13
- @halt_timeout = 30
14
- @halt_check_interval = 1
15
- @suexec_cmd = 'pfexec'
16
- @device = "e1000g"
13
+ def initialize
14
+ @halt_timeout = 30
15
+ @halt_check_interval = 1
16
+ @suexec_cmd = 'pfexec'
17
+ @device = "e1000g"
18
+ end
17
19
  end
18
20
  end
19
21
  end
@@ -2,9 +2,11 @@ require 'vagrant'
2
2
 
3
3
  module Vagrant
4
4
  module Smartos
5
- class Guest < Vagrant.plugin("2", :guest)
6
- def detect?(machine)
7
- machine.communicate.test("cat /etc/release | grep -i SmartOS")
5
+ module Guest
6
+ class Guest < Vagrant.plugin("2", :guest)
7
+ def detect?(machine)
8
+ machine.communicate.test("cat /etc/release | grep -i SmartOS")
9
+ end
8
10
  end
9
11
  end
10
12
  end
@@ -2,53 +2,55 @@ require 'vagrant'
2
2
 
3
3
  module Vagrant
4
4
  module Smartos
5
- class Plugin < Vagrant.plugin("2")
6
- name "SmartOS guest."
7
- description "SmartOS guest support."
8
-
9
- config("smartos") do
10
- require File.expand_path("../config", __FILE__)
11
- Config
12
- end
13
-
14
- guest("smartos") do
15
- require File.expand_path("../guest", __FILE__)
16
- Guest
17
- end
18
-
19
- guest_capability("smartos", "change_host_name") do
20
- require_relative "cap/change_host_name"
21
- Cap::ChangeHostName
22
- end
23
-
24
- guest_capability("smartos", "configure_networks") do
25
- require_relative "cap/configure_networks"
26
- Cap::ConfigureNetworks
27
- end
28
-
29
- guest_capability("smartos", "halt") do
30
- require_relative "cap/halt"
31
- Cap::Halt
32
- end
33
-
34
- guest_capability("smartos", "mount_nfs_folder") do
35
- require_relative "cap/mount_nfs"
36
- Cap::MountNFS
37
- end
38
-
39
- guest_capability("smartos", "rsync_installed") do
40
- require_relative "cap/rsync"
41
- Cap::RSync
42
- end
43
-
44
- guest_capability("smartos", "rsync_install") do
45
- require_relative "cap/rsync"
46
- Cap::RSync
47
- end
48
-
49
- guest_capability("smartos", "rsync_pre") do
50
- require_relative "cap/rsync"
51
- Cap::RSync
5
+ module Guest
6
+ class Plugin < Vagrant.plugin("2")
7
+ name "SmartOS guest."
8
+ description "SmartOS guest support."
9
+
10
+ config("smartos") do
11
+ require_relative 'config'
12
+ Config
13
+ end
14
+
15
+ guest("smartos") do
16
+ require_relative 'guest'
17
+ ::Vagrant::Smartos::Guest::Guest
18
+ end
19
+
20
+ guest_capability("smartos", "change_host_name") do
21
+ require_relative "cap/change_host_name"
22
+ Cap::ChangeHostName
23
+ end
24
+
25
+ guest_capability("smartos", "configure_networks") do
26
+ require_relative "cap/configure_networks"
27
+ Cap::ConfigureNetworks
28
+ end
29
+
30
+ guest_capability("smartos", "halt") do
31
+ require_relative "cap/halt"
32
+ Cap::Halt
33
+ end
34
+
35
+ guest_capability("smartos", "mount_nfs_folder") do
36
+ require_relative "cap/mount_nfs"
37
+ Cap::MountNFS
38
+ end
39
+
40
+ guest_capability("smartos", "rsync_installed") do
41
+ require_relative "cap/rsync"
42
+ Cap::RSync
43
+ end
44
+
45
+ guest_capability("smartos", "rsync_install") do
46
+ require_relative "cap/rsync"
47
+ Cap::RSync
48
+ end
49
+
50
+ guest_capability("smartos", "rsync_pre") do
51
+ require_relative "cap/rsync"
52
+ Cap::RSync
53
+ end
52
54
  end
53
55
  end
54
56
  end
@@ -1,7 +1,7 @@
1
1
  module Vagrant
2
2
  module Smartos
3
3
  module Guest
4
- VERSION = "0.0.1.pre.1"
4
+ VERSION = "0.0.1.pre.2"
5
5
  end
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vagrant-smartos-guest
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1.pre.1
4
+ version: 0.0.1.pre.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eric Saxby