vagrant-vmpooler 0.1.5 → 0.1.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +1 -1
- data/README.md +2 -3
- data/example_box/Vagrantfile +2 -4
- data/lib/vagrant-vmpooler/action/delete_server.rb +3 -0
- data/lib/vagrant-vmpooler/action/disable_tty.rb +25 -0
- data/lib/vagrant-vmpooler/action.rb +2 -0
- data/lib/vagrant-vmpooler/version.rb +1 -1
- data/locales/en.yml +2 -0
- data/vagrant-vmpooler.gemspec +1 -1
- metadata +5 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5d940e98cf20dcaf718a7e09499790febb1a0b7a
|
4
|
+
data.tar.gz: 70a13319df7418a492acf928e29634fb36bc1786
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: abfd2fae9e113fb6e77155dbb4bc0ba665a41aa3cdd29a2089e6bb1a67cb58943756b43d86e20891b42ddff67e31463f1ffaec4e11e5422b5313de8b1a2236b2
|
7
|
+
data.tar.gz: 2f2921074f9814b701dc077d41e1135a8caed95800a1b5a7d1985f486974977ca3dc6eba563b8fff08ee5f5af72c8c27ea405cf65589e0cbe30343086873ea8b
|
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -21,7 +21,7 @@ To quickly get started, install the vagrant plugin with the command below. Then
|
|
21
21
|
```
|
22
22
|
$ vagrant plugin install vagrant-vmpooler
|
23
23
|
...
|
24
|
-
$ vagrant box add dummy https://github.com/briancain/vagrant-vmpooler/
|
24
|
+
$ vagrant box add dummy https://github.com/briancain/vagrant-vmpooler/raw/master/example_box/dummy.box
|
25
25
|
...
|
26
26
|
$ vagrant up --provider=vmpooler
|
27
27
|
...
|
@@ -44,8 +44,7 @@ SCRIPT
|
|
44
44
|
Vagrant.configure("2") do |config|
|
45
45
|
config.vm.box = "dummy"
|
46
46
|
|
47
|
-
|
48
|
-
config.vm.provision :shell, :inline => provision_script, privileged: false
|
47
|
+
config.vm.provision :shell, :inline => provision_script
|
49
48
|
|
50
49
|
config.vm.provider :vmpooler do |vmpooler|
|
51
50
|
vmpooler.os = "centos-7-x86_64"
|
data/example_box/Vagrantfile
CHANGED
@@ -4,14 +4,12 @@
|
|
4
4
|
# Provisioning script
|
5
5
|
provision_script = <<SCRIPT
|
6
6
|
#!/bin/bash
|
7
|
-
echo "Hello there" > ~/hi.txt
|
7
|
+
sudo echo "Hello there" > ~/hi.txt
|
8
8
|
SCRIPT
|
9
9
|
|
10
10
|
Vagrant.configure("2") do |config|
|
11
11
|
config.vm.box = "dummy"
|
12
|
-
|
13
|
-
# vagrant-vmpooler already assumes you are root
|
14
|
-
config.vm.provision :shell, :inline => provision_script, privileged: false
|
12
|
+
config.vm.provision :shell, :inline => provision_script
|
15
13
|
|
16
14
|
config.vm.provider :vmpooler do |vmpooler|
|
17
15
|
vmpooler.os = "centos-7-x86_64"
|
@@ -33,6 +33,9 @@ module VagrantPlugins
|
|
33
33
|
response_body = Pooler.delete(verbose, url, os, token)
|
34
34
|
|
35
35
|
if response_body[id]['ok'] == false
|
36
|
+
# the only way this can happen is if the vm existed at one point
|
37
|
+
# but got deleted from vmpoolers redis db. We should probably
|
38
|
+
# still delete it from vagrants internal state if this is true
|
36
39
|
env[:ui].info(I18n.t("vagrant_vmpooler.not_deleted"))
|
37
40
|
else
|
38
41
|
env[:ui].info(I18n.t("vagrant_vmpooler.deleted"))
|
@@ -0,0 +1,25 @@
|
|
1
|
+
|
2
|
+
module VagrantPlugins
|
3
|
+
module Vmpooler
|
4
|
+
module Action
|
5
|
+
class DisableTty
|
6
|
+
def initialize(app, env)
|
7
|
+
@app = app
|
8
|
+
@logger = Log4r::Logger.new("vagrant_vmpooler::action::disable_tty")
|
9
|
+
end
|
10
|
+
|
11
|
+
def call(env)
|
12
|
+
ssh_info = env[:machine].ssh_info
|
13
|
+
os_flavor = env[:machine].provider_config.os
|
14
|
+
disable_tty_command = "sed -i 's/^Defaults\s*requiretty/#Defaults requiretty/' /etc/sudoers"
|
15
|
+
# i18n
|
16
|
+
env[:ui].info(I18n.t("vagrant_vmpooler.disable_tty"))
|
17
|
+
|
18
|
+
env[:machine].communicate.execute(disable_tty_command, :error_check => true)
|
19
|
+
|
20
|
+
@app.call(env)
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
@@ -89,6 +89,7 @@ module VagrantPlugins
|
|
89
89
|
b1.use action_prepare_boot
|
90
90
|
b1.use CreateServer
|
91
91
|
b1.use SetupRsync
|
92
|
+
b1.use DisableTty
|
92
93
|
else
|
93
94
|
b1.use action_resume
|
94
95
|
end
|
@@ -207,6 +208,7 @@ module VagrantPlugins
|
|
207
208
|
autoload :TakeSnapshot, action_root.join("take_snapshot")
|
208
209
|
autoload :WaitForState, action_root.join("wait_for_state")
|
209
210
|
autoload :SetupRsync, action_root.join("setup_rsync")
|
211
|
+
autoload :DisableTty, action_root.join("disable_tty")
|
210
212
|
end
|
211
213
|
end
|
212
214
|
end
|
data/locales/en.yml
CHANGED
data/vagrant-vmpooler.gemspec
CHANGED
@@ -12,7 +12,7 @@ Gem::Specification.new do |s|
|
|
12
12
|
s.summary = "Enables Vagrant to manage machines in vmpooler."
|
13
13
|
s.description = "Enables Vagrant to manage machines in vmpooler."
|
14
14
|
|
15
|
-
s.add_runtime_dependency "vmfloaty", ">= 0.
|
15
|
+
s.add_runtime_dependency "vmfloaty", ">= 0.6.0"
|
16
16
|
|
17
17
|
s.add_development_dependency "rspec-its"
|
18
18
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vagrant-vmpooler
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brian Cain
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-09-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: vmfloaty
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 0.
|
19
|
+
version: 0.6.0
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 0.
|
26
|
+
version: 0.6.0
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rspec-its
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -57,6 +57,7 @@ files:
|
|
57
57
|
- lib/vagrant-vmpooler/action.rb
|
58
58
|
- lib/vagrant-vmpooler/action/create_server.rb
|
59
59
|
- lib/vagrant-vmpooler/action/delete_server.rb
|
60
|
+
- lib/vagrant-vmpooler/action/disable_tty.rb
|
60
61
|
- lib/vagrant-vmpooler/action/hard_reboot_server.rb
|
61
62
|
- lib/vagrant-vmpooler/action/is_created.rb
|
62
63
|
- lib/vagrant-vmpooler/action/is_paused.rb
|