vagrant-butter 0.0.1 → 0.0.2
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 +4 -0
- data/README.md +27 -0
- data/lib/vagrant/butter/systems/suse.rb +34 -0
- data/lib/vagrant/butter/version.rb +1 -1
- data/vagrant-butter.gemspec +1 -1
- metadata +13 -6
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -0,0 +1,27 @@
|
|
1
|
+
# vagrant-butter
|
2
|
+
|
3
|
+
## Install
|
4
|
+
|
5
|
+
```sh
|
6
|
+
gem install vagrant-butter
|
7
|
+
```
|
8
|
+
|
9
|
+
## Helpers
|
10
|
+
|
11
|
+
### local_ip
|
12
|
+
|
13
|
+
#### Usage
|
14
|
+
|
15
|
+
```ruby
|
16
|
+
include Vagrant::Butter::Helpers
|
17
|
+
```
|
18
|
+
|
19
|
+
## Patches and Support
|
20
|
+
|
21
|
+
### SuSE Halting and Setting Hostname
|
22
|
+
|
23
|
+
#### Usage
|
24
|
+
|
25
|
+
```ruby
|
26
|
+
require 'vagrant/butter/systems/suse'
|
27
|
+
```
|
@@ -0,0 +1,34 @@
|
|
1
|
+
module Vagrant
|
2
|
+
module Systems
|
3
|
+
class Suse
|
4
|
+
def halt
|
5
|
+
vm.env.ui.info I18n.t("vagrant.systems.linux.attempting_halt")
|
6
|
+
vm.ssh.execute do |ssh|
|
7
|
+
ssh.exec!("sudo /sbin/shutdown -hP now")
|
8
|
+
end
|
9
|
+
|
10
|
+
# Wait until the VM's state is actually powered off. If this doesn't
|
11
|
+
# occur within a reasonable amount of time (15 seconds by default),
|
12
|
+
# then simply return and allow Vagrant to kill the machine.
|
13
|
+
count = 0
|
14
|
+
while vm.vm.state != :powered_off
|
15
|
+
count += 1
|
16
|
+
|
17
|
+
return if count >= vm.env.config.linux.halt_timeout
|
18
|
+
sleep vm.env.config.linux.halt_check_interval
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
def change_host_name(name)
|
23
|
+
vm.ssh.execute do |ssh|
|
24
|
+
# Only do this if the hostname is not already set
|
25
|
+
if !ssh.test?("sudo hostname | grep '#{name}'")
|
26
|
+
ssh.exec!("sudo sed -i 's/^.*$/#{name}/' /etc/HOSTNAME")
|
27
|
+
ssh.exec!("sudo hostname #{name}")
|
28
|
+
ssh.exec!("sudo sed -i 's@^\\(127[.]0[.]0[.]1[[:space:]]\\+\\)@\\1#{name} #{name.split('.')[0]} @' /etc/hosts")
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
data/vagrant-butter.gemspec
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vagrant-butter
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,19 +9,19 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2012-02-05 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: vagrant
|
16
|
-
requirement: &
|
16
|
+
requirement: &2157134260 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ~>
|
20
20
|
- !ruby/object:Gem::Version
|
21
|
-
version: 0
|
21
|
+
version: '0'
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *2157134260
|
25
25
|
description: Smooth out Vagrantfiles with some common helpers and shims
|
26
26
|
email:
|
27
27
|
- fnichol@nichol.ca
|
@@ -35,6 +35,7 @@ files:
|
|
35
35
|
- Rakefile
|
36
36
|
- lib/vagrant-butter.rb
|
37
37
|
- lib/vagrant/butter/helpers.rb
|
38
|
+
- lib/vagrant/butter/systems/suse.rb
|
38
39
|
- lib/vagrant/butter/version.rb
|
39
40
|
- lib/vagrant_init.rb
|
40
41
|
- vagrant-butter.gemspec
|
@@ -50,15 +51,21 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
50
51
|
- - ! '>='
|
51
52
|
- !ruby/object:Gem::Version
|
52
53
|
version: '0'
|
54
|
+
segments:
|
55
|
+
- 0
|
56
|
+
hash: -3594635565780566737
|
53
57
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
54
58
|
none: false
|
55
59
|
requirements:
|
56
60
|
- - ! '>='
|
57
61
|
- !ruby/object:Gem::Version
|
58
62
|
version: '0'
|
63
|
+
segments:
|
64
|
+
- 0
|
65
|
+
hash: -3594635565780566737
|
59
66
|
requirements: []
|
60
67
|
rubyforge_project:
|
61
|
-
rubygems_version: 1.8.
|
68
|
+
rubygems_version: 1.8.10
|
62
69
|
signing_key:
|
63
70
|
specification_version: 3
|
64
71
|
summary: Smooth out Vagrantfiles with some common helpers and shims
|