vagrant-zentoo 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore ADDED
@@ -0,0 +1,15 @@
1
+ *.gem
2
+
3
+ ### Eclipse project management files
4
+ .loadpath
5
+ .buildpath
6
+ .project
7
+ .settings/*
8
+
9
+ ### Mac OS temporary files
10
+ .DS_Store
11
+ ._*
12
+
13
+ ### Windows temporary files
14
+ Thumbs.db
15
+
data/.rvmrc ADDED
@@ -0,0 +1 @@
1
+ rvm use --create ruby-1.9.3-p125@vagrant-zentoo
data/Gemfile ADDED
@@ -0,0 +1,3 @@
1
+ source :rubygems
2
+
3
+ gemspec
data/Gemfile.lock ADDED
@@ -0,0 +1,35 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ vagrant-zentoo (0.1.0)
5
+ vagrant (~> 1.0.3)
6
+
7
+ GEM
8
+ remote: http://rubygems.org/
9
+ specs:
10
+ archive-tar-minitar (0.5.2)
11
+ childprocess (0.3.2)
12
+ ffi (~> 1.0.6)
13
+ erubis (2.7.0)
14
+ ffi (1.0.11)
15
+ i18n (0.6.0)
16
+ json (1.5.4)
17
+ log4r (1.1.10)
18
+ net-scp (1.0.4)
19
+ net-ssh (>= 1.99.1)
20
+ net-ssh (2.2.2)
21
+ vagrant (1.0.3)
22
+ archive-tar-minitar (= 0.5.2)
23
+ childprocess (~> 0.3.1)
24
+ erubis (~> 2.7.0)
25
+ i18n (~> 0.6.0)
26
+ json (~> 1.5.1)
27
+ log4r (~> 1.1.9)
28
+ net-scp (~> 1.0.4)
29
+ net-ssh (~> 2.2.2)
30
+
31
+ PLATFORMS
32
+ ruby
33
+
34
+ DEPENDENCIES
35
+ vagrant-zentoo!
data/LICENSE.txt ADDED
@@ -0,0 +1,22 @@
1
+ The MIT License
2
+
3
+ Copyright (c) 2012 Benedikt Böhm <bb@xnull.de>
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.rst ADDED
@@ -0,0 +1,4 @@
1
+ Vagrant for Zentoo
2
+ ==================
3
+
4
+ This Vagrant plugin adds support for Zentoo Linux.
data/Rakefile ADDED
@@ -0,0 +1,10 @@
1
+ # encoding: utf-8
2
+
3
+ require 'rubygems'
4
+
5
+ begin
6
+ require 'bundler'
7
+ Bundler::GemHelper.install_tasks
8
+ rescue LoadError
9
+ $stderr.puts "Bundler not installed. You should install it with: gem install bundler"
10
+ end
@@ -0,0 +1,39 @@
1
+ require 'yaml'
2
+ require 'vagrant/guest/gentoo'
3
+
4
+ module Vagrant
5
+ module Guest
6
+ class Zentoo < Gentoo
7
+ TEMPLATES = YAML::load <<EOF
8
+ ---
9
+ :network_dhcp: |
10
+ # The contents below are automatically generated by Vagrant. Do not modify.
11
+ dhcpcd eth<%= options[:interface] %>
12
+ exit 0
13
+ :network_static: |
14
+ # The contents below are automatically generated by Vagrant. Donot modify.
15
+ ip addr add <%= options[:ip] %>/<%= options[:netmask] %> dev eth<%= options[:interface] %>
16
+ exit 0
17
+ EOF
18
+
19
+ def configure_networks(networks)
20
+ # Configure each network interface
21
+ networks.each do |network|
22
+ puts network[:type]
23
+ puts TEMPLATES.inspect
24
+ entry = TemplateRenderer.render_string(TEMPLATES["network_#{network[:type]}".to_sym], :options => network)
25
+
26
+ # Upload the entry to a temporary location
27
+ temp = Tempfile.new("vagrant")
28
+ temp.binmode
29
+ temp.write(entry)
30
+ temp.close
31
+
32
+ vm.channel.upload(temp.path, "/tmp/vagrant-network-entry")
33
+ vm.channel.sudo("cat /tmp/vagrant-network-entry > /etc/ifup.eth#{network[:interface]}")
34
+ vm.channel.sudo("/bin/bash /etc/ifup.eth#{network[:interface]}")
35
+ end
36
+ end
37
+ end
38
+ end
39
+ end
@@ -0,0 +1,30 @@
1
+ require 'vagrant'
2
+ require 'vagrant/guest/zentoo'
3
+
4
+ Vagrant.guests.register(:zentoo) { Vagrant::Guest::Zentoo }
5
+
6
+ module Vagrant
7
+ module Guest
8
+ class Linux
9
+ def distro_dispatch_with_zentoo
10
+ result = nil
11
+
12
+ if @vm.channel.test("cat /etc/os-release")
13
+ @vm.channel.execute("cat /etc/os-release | grep ^ID") do |type, data|
14
+ next if data.chomp.empty?
15
+ result = data.chomp.gsub(/^ID="?([^"]*)"?/, '\1').to_sym if type == :stdout
16
+ end
17
+ end
18
+
19
+ unless result
20
+ result = distro_dispatch_without_zentoo
21
+ end
22
+
23
+ result
24
+ end
25
+
26
+ alias_method :distro_dispatch_without_zentoo, :distro_dispatch
27
+ alias_method :distro_dispatch, :distro_dispatch_with_zentoo
28
+ end
29
+ end
30
+ end
@@ -0,0 +1,2 @@
1
+ # This file is automatically loaded by Vagrant to load any plugins.
2
+ require 'vagrant-zentoo'
@@ -0,0 +1,18 @@
1
+ # -*- encoding: utf-8 -*-
2
+
3
+ Gem::Specification.new do |s|
4
+ s.name = "vagrant-zentoo"
5
+ s.version = "0.1.0"
6
+ s.authors = ["Benedikt Böhm"]
7
+ s.email = ["bb@xnull.de"]
8
+ s.homepage = "http://github.com/zentoo/vagrant-zentoo"
9
+ s.summary = %q{Vagrant plugin to detect and support Zentoo Linux}
10
+ s.description = %q{Vagrant plugin to detect and support Zentoo Linux}
11
+
12
+ s.files = `git ls-files`.split("\n")
13
+ s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
14
+ s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
15
+ s.require_paths = ["lib"]
16
+
17
+ s.add_dependency "vagrant", "~> 1.0.3"
18
+ end
metadata ADDED
@@ -0,0 +1,67 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: vagrant-zentoo
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - Benedikt Böhm
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2012-05-14 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: vagrant
16
+ requirement: &6997740 !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ~>
20
+ - !ruby/object:Gem::Version
21
+ version: 1.0.3
22
+ type: :runtime
23
+ prerelease: false
24
+ version_requirements: *6997740
25
+ description: Vagrant plugin to detect and support Zentoo Linux
26
+ email:
27
+ - bb@xnull.de
28
+ executables: []
29
+ extensions: []
30
+ extra_rdoc_files: []
31
+ files:
32
+ - .gitignore
33
+ - .rvmrc
34
+ - Gemfile
35
+ - Gemfile.lock
36
+ - LICENSE.txt
37
+ - README.rst
38
+ - Rakefile
39
+ - lib/vagrant-zentoo.rb
40
+ - lib/vagrant/guest/zentoo.rb
41
+ - lib/vagrant_init.rb
42
+ - vagrant-zentoo.gemspec
43
+ homepage: http://github.com/zentoo/vagrant-zentoo
44
+ licenses: []
45
+ post_install_message:
46
+ rdoc_options: []
47
+ require_paths:
48
+ - lib
49
+ required_ruby_version: !ruby/object:Gem::Requirement
50
+ none: false
51
+ requirements:
52
+ - - ! '>='
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ required_rubygems_version: !ruby/object:Gem::Requirement
56
+ none: false
57
+ requirements:
58
+ - - ! '>='
59
+ - !ruby/object:Gem::Version
60
+ version: '0'
61
+ requirements: []
62
+ rubyforge_project:
63
+ rubygems_version: 1.8.17
64
+ signing_key:
65
+ specification_version: 3
66
+ summary: Vagrant plugin to detect and support Zentoo Linux
67
+ test_files: []