vagrant-boot2docker 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 6f5096cc15cecac0056def59d467781a9ad353d4
4
+ data.tar.gz: 7abf02e04bcf03a1bcae89aa49f990bae0d045fb
5
+ SHA512:
6
+ metadata.gz: 795ffc563b691645996496e5f5144f45fad751565f7f76481899aee578edecaa2f24d8b3c942f1b80ff81f8e123092c1ba83b52bcea828f9297c6c000d2b8c2c
7
+ data.tar.gz: a10759f3cd864e77f1dc9e32ce6105e1312b2124a12328ecc679083f099e80d05b3a4ed39d4c647c89c720182abdb6a074e7625c4d97c4e62c2cc3fb5825179f
data/.gitignore ADDED
@@ -0,0 +1,4 @@
1
+ Vagrantfile
2
+ .vagrant/
3
+ Gemfile.lock
4
+ pkg/
data/Gemfile ADDED
@@ -0,0 +1,11 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in vagrant-nixos.gemspec
4
+ gemspec
5
+
6
+ group :development do
7
+ # We depend on Vagrant for development, but we don't add it as a
8
+ # gem dependency because we expect to be installed within the
9
+ # Vagrant environment itself using `vagrant plugin`.
10
+ gem "vagrant", :git => "git://github.com/mitchellh/vagrant.git"
11
+ end
data/LICENSE.txt ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2014 Faisal Puthuparackat
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ 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.
data/README.md ADDED
@@ -0,0 +1,28 @@
1
+ # Boot2docker plugin
2
+
3
+ This plugin makes working with boot2docker guests in [Vagrant](http://www.vagrantup.com) a bit nicer:
4
+
5
+ * Allow network configuration to use dhcp
6
+
7
+ ## Install:
8
+
9
+ ```bash
10
+ $ vagrant plugin install vagrant-boot2docker
11
+ ```
12
+
13
+ ## Example Vagrantfile
14
+
15
+ ```ruby
16
+ Vagrant.configure("2") do |config|
17
+ ...
18
+ # Setup networking
19
+ config.vm.network "public_network", ip: "0.0.0.0"
20
+ ...
21
+ end
22
+ ```
23
+
24
+ In the above `Vagrantfile` example, setting the ip to `0.0.0.0` effectively switches off the forced ip configuration that the current tinycore implementaton does (which fails without a valid IP address).
25
+
26
+ ## Issues
27
+
28
+ This should ideally just work without a valid IP (or invalid IP in our case). That's an exercise for v 0.0.2 :)
data/Rakefile ADDED
@@ -0,0 +1,3 @@
1
+ require 'rubygems'
2
+ require 'bundler/setup'
3
+ Bundler::GemHelper.install_tasks
@@ -0,0 +1,23 @@
1
+ require "ipaddr"
2
+
3
+ module VagrantPlugins
4
+ module GuestTinyCore
5
+ module Cap
6
+ class ConfigureNetworks
7
+ def self.configure_networks(machine, networks)
8
+ machine.communicate.tap do |comm|
9
+ networks.each do |n|
10
+ if "0.0.0.0" != n[:ip]
11
+ ifc = "/sbin/ifconfig eth#{n[:interface]}"
12
+ broadcast = (IPAddr.new(n[:ip]) | (~ IPAddr.new(n[:netmask]))).to_s
13
+ comm.sudo("#{ifc} down")
14
+ comm.sudo("#{ifc} #{n[:ip]} netmask #{n[:netmask]} broadcast #{broadcast}")
15
+ comm.sudo("#{ifc} up")
16
+ end
17
+ end
18
+ end
19
+ end
20
+ end
21
+ end
22
+ end
23
+ end
@@ -0,0 +1,11 @@
1
+ module VagrantPlugins
2
+ module Nixos
3
+ class Guest < Vagrant.plugin("2", :guest)
4
+
5
+ def detect?(machine)
6
+ machine.communicate.test("test -f /etc/boot2docker")
7
+ end
8
+
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,37 @@
1
+ begin
2
+ require "vagrant"
3
+ rescue LoadError
4
+ raise "The boot2docker plugin must be run within Vagrant."
5
+ end
6
+
7
+ # This is a sanity check to make sure no one is attempting to install
8
+ # this into an early Vagrant version.
9
+ if Vagrant::VERSION < "1.2.0"
10
+ raise "The Boot2docker plugin is only compatible with Vagrant 1.2+"
11
+ end
12
+
13
+ module VagrantPlugins
14
+ module Boot2docker
15
+
16
+ @@nix_imports = {}
17
+
18
+ class Plugin < Vagrant.plugin("2")
19
+ name "boot2docker"
20
+ description <<-DESC
21
+ This plugin installs boot2docker guest capabilities.
22
+ DESC
23
+
24
+ guest("boot2docker", "tinycore") do
25
+ require_relative "guest"
26
+ Guest
27
+ end
28
+
29
+ guest_capability("boot2docker", "configure_networks") do
30
+ require_relative "cap/configure_networks"
31
+ Cap::ConfigureNetworks
32
+ end
33
+
34
+ end
35
+
36
+ end
37
+ end
@@ -0,0 +1,5 @@
1
+ module VagrantPlugins
2
+ module Boot2docker
3
+ VERSION = "0.0.1"
4
+ end
5
+ end
@@ -0,0 +1,15 @@
1
+ require "vagrant-boot2docker/version"
2
+ require "vagrant-boot2docker/plugin"
3
+
4
+ module VagrantPlugins
5
+ module Boot2docker
6
+ lib_path = Pathname.new(File.expand_path("../boot2docker", __FILE__))
7
+ autoload :Action, lib_path.join("action")
8
+ autoload :Errors, lib_path.join("errors")
9
+
10
+ # This returns the path to the source of this plugin.
11
+ def self.source_root
12
+ @source_root ||= Pathname.new(File.expand_path("../../../", __FILE__))
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,23 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'vagrant-boot2docker/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "vagrant-boot2docker"
8
+ spec.version = VagrantPlugins::Boot2docker::VERSION
9
+ spec.authors = ["Faisal P"]
10
+ spec.email = ["faisal.is@gmail.com"]
11
+ spec.summary = %q{Guest capabilities for boot2docker}
12
+ spec.description = %q{Add capabilities and fix dhcp support for boot2docker guests in Vagrant}
13
+ spec.homepage = ""
14
+ spec.license = "MIT"
15
+
16
+ spec.files = `git ls-files -z`.split("\x0")
17
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
18
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
+ spec.require_paths = ["lib"]
20
+
21
+ spec.add_development_dependency "bundler", "~> 1.5"
22
+ spec.add_development_dependency "rake"
23
+ end
metadata ADDED
@@ -0,0 +1,83 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: vagrant-boot2docker
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Faisal P
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2014-09-26 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.5'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ~>
25
+ - !ruby/object:Gem::Version
26
+ version: '1.5'
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: Add capabilities and fix dhcp support for boot2docker guests in Vagrant
42
+ email:
43
+ - faisal.is@gmail.com
44
+ executables: []
45
+ extensions: []
46
+ extra_rdoc_files: []
47
+ files:
48
+ - .gitignore
49
+ - Gemfile
50
+ - LICENSE.txt
51
+ - README.md
52
+ - Rakefile
53
+ - lib/vagrant-boot2docker.rb
54
+ - lib/vagrant-boot2docker/cap/configure_networks.rb
55
+ - lib/vagrant-boot2docker/guest.rb
56
+ - lib/vagrant-boot2docker/plugin.rb
57
+ - lib/vagrant-boot2docker/version.rb
58
+ - vagrant-boot2docker.gemspec
59
+ homepage: ''
60
+ licenses:
61
+ - MIT
62
+ metadata: {}
63
+ post_install_message:
64
+ rdoc_options: []
65
+ require_paths:
66
+ - lib
67
+ required_ruby_version: !ruby/object:Gem::Requirement
68
+ requirements:
69
+ - - '>='
70
+ - !ruby/object:Gem::Version
71
+ version: '0'
72
+ required_rubygems_version: !ruby/object:Gem::Requirement
73
+ requirements:
74
+ - - '>='
75
+ - !ruby/object:Gem::Version
76
+ version: '0'
77
+ requirements: []
78
+ rubyforge_project:
79
+ rubygems_version: 2.0.14
80
+ signing_key:
81
+ specification_version: 4
82
+ summary: Guest capabilities for boot2docker
83
+ test_files: []