vagrant-systemd 0.1.1 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -11,11 +11,15 @@ module VagrantPlugins
11
11
  module Cap
12
12
  class ChangeHostName
13
13
  def self.change_host_name(machine, name)
14
+ name = name.split('.')
15
+ hostname = name.shift
16
+ domain = name.empty? ? "local" : name.join('.')
17
+
14
18
  machine.communicate.tap do |comm|
15
19
  # Only do this if the hostname is not already set
16
- if !comm.test("sudo hostname | grep '#{name}'")
17
- comm.sudo("hostnamectl set-hostname #{name}")
18
- comm.sudo("sed -i 's@^\\(127[.]0[.]0[.]1[[:space:]]\\+\\)@\\1#{name} @' /etc/hosts")
20
+ if !comm.test("sudo hostname | grep '#{hostname}'")
21
+ comm.sudo("hostnamectl set-hostname #{hostname}")
22
+ comm.sudo("sed -i 's@^\\(127[.]0[.]0[.]1[[:space:]]\\+\\)@\\1#{hostname}.#{domain} #{hostname} @' /etc/hosts")
19
23
  end
20
24
  end
21
25
  end
@@ -24,6 +28,8 @@ module VagrantPlugins
24
28
  class ConfigureNetworks
25
29
  def self.configure_networks(machine, networks)
26
30
  networks.each do |network|
31
+ # we use arch templates here, since TemplateRenderer has hardcoded
32
+ # paths and arch already uses systemd + netctl
27
33
  entry = TemplateRenderer.render("guests/arch/network_#{network[:type]}",
28
34
  :options => network)
29
35
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = "vagrant-systemd"
5
- s.version = "0.1.1"
5
+ s.version = "0.2.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.1.1
4
+ version: 0.2.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-22 00:00:00.000000000 Z
12
+ date: 2013-06-23 00:00:00.000000000 Z
13
13
  dependencies: []
14
14
  description: Vagrant plugin to detect and support Systemd based systems
15
15
  email: