vagrant-systemd 0.2.0 → 0.3.0

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.
@@ -1,3 +1,4 @@
1
+ require "tempfile"
1
2
  require "vagrant"
2
3
 
3
4
  module VagrantPlugins
@@ -28,14 +29,12 @@ module VagrantPlugins
28
29
  class ConfigureNetworks
29
30
  def self.configure_networks(machine, networks)
30
31
  networks.each do |network|
31
- # we use arch templates here, since TemplateRenderer has hardcoded
32
- # paths and arch already uses systemd + netctl
33
- entry = TemplateRenderer.render("guests/arch/network_#{network[:type]}",
34
- :options => network)
32
+ template_path = File.expand_path("../../templates/network_#{network[:type]}.erb", __FILE__)
33
+ template = File.read(template_path)
35
34
 
36
35
  temp = Tempfile.new("vagrant")
37
36
  temp.binmode
38
- temp.write(entry)
37
+ temp.write(Erubis::Eruby.new(template, :trim => true).result(binding))
39
38
  temp.close
40
39
 
41
40
  machine.communicate.upload(temp.path, "/tmp/vagrant_network")
@@ -0,0 +1,5 @@
1
+ Description='A basic static ethernet connection'
2
+ Interface=eth<%= network[:interface] %>
3
+ Connection=ethernet
4
+ ForceConnect=yes
5
+ IP=dhcp
@@ -0,0 +1,7 @@
1
+ Description='A basic static ethernet connection'
2
+ Interface=eth<%= network[:interface] %>
3
+ Connection=ethernet
4
+ ForceConnect=yes
5
+ IP=static
6
+ Address=('<%= network[:ip]%>')
7
+ Netmask='<%= network[:netmask] %>'
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = "vagrant-systemd"
5
- s.version = "0.2.0"
5
+ s.version = "0.3.0"
6
6
  s.authors = ["Benedikt Böhm"]
7
7
  s.email = ["bb@xnull.de"]
8
8
  s.homepage = "http://github.com/zentoo/vagrant-systemd"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vagrant-systemd
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-06-23 00:00:00.000000000 Z
12
+ date: 2013-06-24 00:00:00.000000000 Z
13
13
  dependencies: []
14
14
  description: Vagrant plugin to detect and support Systemd based systems
15
15
  email:
@@ -25,6 +25,8 @@ files:
25
25
  - Rakefile
26
26
  - Vagrantfile
27
27
  - lib/vagrant-systemd.rb
28
+ - templates/network_dhcp.erb
29
+ - templates/network_static.erb
28
30
  - vagrant-systemd.gemspec
29
31
  homepage: http://github.com/zentoo/vagrant-systemd
30
32
  licenses: []