vagrant-systemd 0.1.1 → 0.2.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.
- data/lib/vagrant-systemd.rb +9 -3
- data/vagrant-systemd.gemspec +1 -1
- metadata +2 -2
data/lib/vagrant-systemd.rb
CHANGED
@@ -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 '#{
|
17
|
-
comm.sudo("hostnamectl set-hostname #{
|
18
|
-
comm.sudo("sed -i 's@^\\(127[.]0[.]0[.]1[[:space:]]\\+\\)@\\1#{
|
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
|
|
data/vagrant-systemd.gemspec
CHANGED
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.
|
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-
|
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:
|