vagrant-shell 0.2.5 → 0.2.6
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.lock +1 -1
- data/Makefile +7 -2
- data/README.md +12 -10
- data/Vagrantfile +16 -3
- data/lib/vagrant-shell/version.rb +1 -1
- data/libexec/init-docker +7 -0
- data/libexec/shell-docker +5 -1
- data/vagrant-shell.box +0 -0
- metadata +5 -3
- data/vagrant-shell-demo.box +0 -0
data/Gemfile.lock
CHANGED
data/Makefile
CHANGED
@@ -6,5 +6,10 @@ bundler:
|
|
6
6
|
bundle --local --path vendor/bundle
|
7
7
|
|
8
8
|
vagrant:
|
9
|
-
bundle exec vagrant box remove vagrant-shell
|
10
|
-
bundle exec vagrant box add vagrant-shell
|
9
|
+
bundle exec vagrant box remove vagrant-shell shell || true
|
10
|
+
bundle exec vagrant box add vagrant-shell vagrant-shell.box
|
11
|
+
|
12
|
+
shell:
|
13
|
+
docker pull ubuntu
|
14
|
+
bundle exec vagrant up --provider shell || true
|
15
|
+
bundle exec vagrant ssh
|
data/README.md
CHANGED
@@ -1,5 +1,3 @@
|
|
1
|
-
# Work in progress, still QA'ing the demo
|
2
|
-
|
3
1
|
# Vagrant Shell Provider
|
4
2
|
|
5
3
|
This is a [Vagrant](http://www.vagrantup.com) 1.2+ plugin that adds a
|
@@ -7,15 +5,11 @@ shell provider to Vagrant, allowing Vagrant to control and provision
|
|
7
5
|
machines using shell scripts. It's meant to be customized with scripts
|
8
6
|
for Xen, Docker, etc.
|
9
7
|
|
10
|
-
**NOTE:** This plugin requires Vagrant 1.2+,
|
8
|
+
**NOTE:** This plugin requires Vagrant 1.2+, ruby 1.9, and bundler.
|
11
9
|
|
12
10
|
vagrant-shell is forked from vagrant-aws with the fog/aws parts replaced
|
13
|
-
with a shell script that takes four
|
14
|
-
|
15
|
-
script run-instance $image_id command args... -> $instance_id
|
16
|
-
script terminate-instance $instance_id
|
17
|
-
script ssh-info $instance_id -> ssh-host ssh-port
|
18
|
-
script read-state $instance_id -> *
|
11
|
+
with a shell script that takes four sub-commands: run-instance,
|
12
|
+
terminate-instance, ssh-info, and read-state.
|
19
13
|
|
20
14
|
See `libexec/shell-docker` for an example.
|
21
15
|
|
@@ -24,14 +18,22 @@ See `libexec/shell-docker` for an example.
|
|
24
18
|
I don't know how to instal vagrant-shell as a plugin, so this repo uses
|
25
19
|
bundler and cached gems. Requires ruby 1.9.3 (vagrant).
|
26
20
|
|
27
|
-
Run make to bundle gems and install the demo vagrant
|
21
|
+
Run make to bundle gems, pull the ubuntu image, and install the demo vagrant
|
22
|
+
box:
|
28
23
|
|
29
24
|
make
|
30
25
|
|
26
|
+
Download the ubuntu docker image:
|
27
|
+
|
28
|
+
docker pull ubuntu
|
29
|
+
|
31
30
|
Bring up the docker container:
|
32
31
|
|
33
32
|
bundle exec vagrant up --provider shell
|
34
33
|
|
34
|
+
The commands passed to the container are sourced from `libexec/init-docker`.
|
35
|
+
It sets up the root user with an ssh key suitable for vagrant.
|
36
|
+
|
35
37
|
SSH into the container:
|
36
38
|
|
37
39
|
bundle exec vagrant ssh
|
data/Vagrantfile
CHANGED
@@ -1,11 +1,24 @@
|
|
1
1
|
require "vagrant-shell"
|
2
2
|
|
3
|
+
def read_script pth_script
|
4
|
+
File.read(pth_script).split(/[ \t]*[\r\n]+/).join("; ")
|
5
|
+
end
|
6
|
+
|
3
7
|
Vagrant.configure("2") do |config|
|
8
|
+
config.vm.box = "vagrant-shell"
|
9
|
+
|
4
10
|
config.vm.provider :shell do |shell, override|
|
5
|
-
|
6
|
-
shell.
|
7
|
-
shell.run_args = [ 'bash -c "mkdir -p /root/.ssh/authorized_keys; curl -s https://raw.github.com/mitchellh/vagrant/master/keys/vagrant.pub > /root/.ssh/authorized_keys; aptitude install -y openssh-server; mkdir -p /var/run/sshd; exec /usr/sbin/sshd -D"' ]
|
11
|
+
# use public docker ubuntu
|
12
|
+
shell.image = "ubuntu"
|
8
13
|
override.ssh.username = "root"
|
14
|
+
|
15
|
+
# vagrant-shell comes with shell-docker to support docker containers
|
16
|
+
shell.script = File.expand_path("../libexec/shell-docker", __FILE__)
|
17
|
+
|
18
|
+
# set up vagrant keys, install/configure/run Ubuntu sshd
|
19
|
+
shell.run_args = [ "bash -c '#{read_script File.expand_path("../libexec/init-docker", __FILE__)}'" ]
|
20
|
+
|
21
|
+
# don't copy anything to /vagrant
|
9
22
|
override.vm.synced_folder ".", "/vagrant", :id => "vagrant-root", :disabled => true
|
10
23
|
end
|
11
24
|
end
|
data/libexec/init-docker
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
DEBIAN_FRONTEND=noninteractive apt-get install -y wget openssh-server
|
2
|
+
install -d -m 0700 -o root -g root /root/.ssh
|
3
|
+
wget -O - https://raw.github.com/mitchellh/vagrant/master/keys/vagrant.pub > /root/.ssh/authorized_keys.tmp
|
4
|
+
install -m 0600 -o root -g root /root/.ssh/authorized_keys.tmp /root/.ssh/authorized_keys
|
5
|
+
rm -f /root/.ssh/authorized_keys.tmp
|
6
|
+
install -d -m 0755 -o root -g root /var/run/sshd
|
7
|
+
exec /usr/sbin/sshd -D
|
data/libexec/shell-docker
CHANGED
data/vagrant-shell.box
ADDED
Binary file
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vagrant-shell
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.6
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2013-05-
|
13
|
+
date: 2013-05-15 00:00:00.000000000 Z
|
14
14
|
dependencies: []
|
15
15
|
description: Enables Vagrant to manage machines using shell scripts
|
16
16
|
email:
|
@@ -41,6 +41,7 @@ files:
|
|
41
41
|
- lib/vagrant-shell/util/timer.rb
|
42
42
|
- lib/vagrant-shell/version.rb
|
43
43
|
- lib/vagrant-shell.rb
|
44
|
+
- libexec/init-docker
|
44
45
|
- libexec/shell-docker
|
45
46
|
- LICENSE
|
46
47
|
- locales/en.yml
|
@@ -48,7 +49,8 @@ files:
|
|
48
49
|
- Rakefile
|
49
50
|
- README.md
|
50
51
|
- vagrant-shell-0.2.3.gem
|
51
|
-
- vagrant-shell-
|
52
|
+
- vagrant-shell-0.2.5.gem
|
53
|
+
- vagrant-shell.box
|
52
54
|
- vagrant-shell.gemspec
|
53
55
|
- Vagrantfile
|
54
56
|
- vendor/bundle/bin/erubis
|
data/vagrant-shell-demo.box
DELETED
Binary file
|