vagrant-lube 0.1.4 → 0.1.5
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/Gemfile
CHANGED
|
@@ -4,11 +4,11 @@ module Vagrant
|
|
|
4
4
|
module Action
|
|
5
5
|
module VM
|
|
6
6
|
class SetHostName
|
|
7
|
-
def initialize
|
|
7
|
+
def initialize app, env
|
|
8
8
|
@app = app
|
|
9
9
|
end
|
|
10
10
|
|
|
11
|
-
def call
|
|
11
|
+
def call env
|
|
12
12
|
if env[:vm].config.vm.host_name.nil?
|
|
13
13
|
host = File.basename(env[:vm].env.root_path).gsub(/_/, '-')
|
|
14
14
|
env[:vm].config.vm.host_name = "#{host}.vagrantup.com"
|
|
@@ -20,14 +20,12 @@ module Vagrant
|
|
|
20
20
|
end
|
|
21
21
|
end
|
|
22
22
|
|
|
23
|
-
def change_host_name
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
ssh.exec!("sudo sed -i 's@^\\(127[.]0[.]0[.]1[[:space:]]\\+\\)@\\1#{name} #{name.split('.')[0]} @' /etc/hosts")
|
|
30
|
-
end
|
|
23
|
+
def change_host_name name
|
|
24
|
+
# Only do this if the hostname is not already set
|
|
25
|
+
if !vm.channel.test("sudo hostname | grep '#{name}'")
|
|
26
|
+
vm.channel.sudo("sed -i 's/\\(linux\\).*/\\1#{name}/' /etc/HOSTNAME")
|
|
27
|
+
vm.channel.sudo("hostname #{name}")
|
|
28
|
+
vm.channel.sudo("sed -i 's@^\\(127[.]0[.]0[.]1[[:space:]]\\+\\)@\\1#{name} #{name.split('.')[0]} @' /etc/hosts")
|
|
31
29
|
end
|
|
32
30
|
end
|
|
33
31
|
end
|
data/lib/vagrant/lube/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: vagrant-lube
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.5
|
|
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-02-
|
|
12
|
+
date: 2013-02-26 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
|
14
14
|
- !ruby/object:Gem::Dependency
|
|
15
15
|
name: vagrant
|