libvirtinator 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
@@ -2,4 +2,5 @@
|
|
2
2
|
|
3
3
|
chroot $1 apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D
|
4
4
|
chroot $1 sh -c "echo deb https://apt.dockerproject.org/repo ubuntu-trusty main > /etc/apt/sources.list.d/docker.list"
|
5
|
-
chroot $1 apt-get update -qq
|
5
|
+
chroot $1 apt-get update -qq
|
6
|
+
chroot $1 apt-get install -y docker-engine
|
data/lib/libvirtinator/users.rb
CHANGED
@@ -1,21 +1,21 @@
|
|
1
1
|
namespace :users do
|
2
2
|
|
3
3
|
task :load_settings => 'libvirtinator:load_settings' do
|
4
|
-
if
|
5
|
-
|
6
|
-
|
7
|
-
|
4
|
+
if fetch(:private_key_path).nil?
|
5
|
+
SSHKit::Backend::Netssh.configure do |ssh|
|
6
|
+
ssh.ssh_options = {
|
7
|
+
forward_agent: false,
|
8
|
+
auth_methods: %w(publickey)
|
9
|
+
}
|
8
10
|
end
|
9
11
|
else
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
auth_methods: %w(publickey)
|
18
|
-
}
|
12
|
+
SSHKit::Backend::Netssh.configure do |ssh|
|
13
|
+
ssh.ssh_options = {
|
14
|
+
keys: fetch(:private_key_path),
|
15
|
+
forward_agent: false,
|
16
|
+
auth_methods: %w(publickey)
|
17
|
+
}
|
18
|
+
end
|
19
19
|
end
|
20
20
|
end
|
21
21
|
|
@@ -65,6 +65,11 @@ namespace :users do
|
|
65
65
|
end
|
66
66
|
end
|
67
67
|
end
|
68
|
+
run_locally do
|
69
|
+
unless fetch(:private_key_path).nil?
|
70
|
+
execute "rm", "-f", "#{fetch(:private_key_path)}*"
|
71
|
+
end
|
72
|
+
end
|
68
73
|
info "Finished setting up users"
|
69
74
|
end
|
70
75
|
end
|
data/lib/libvirtinator/vm.rb
CHANGED
@@ -241,11 +241,13 @@ task :update_root_image => 'libvirtinator:load_settings' do
|
|
241
241
|
execute "chroot", mount_point, "/bin/bash", "-c",
|
242
242
|
"\"chown", "#{user}:#{user}", "/home/#{user}", "/home/#{user}/.ssh\""
|
243
243
|
execute "chmod", "700", "#{mount_point}/home/#{user}/.ssh"
|
244
|
-
|
245
|
-
|
246
|
-
|
244
|
+
key_name = "temp_key_#{fetch(:stage)}"
|
245
|
+
set :private_key_path, key_name
|
246
|
+
run_locally do
|
247
|
+
execute "rm", "-f", key_name
|
248
|
+
execute "ssh-keygen", "-P", "''", "-f", key_name
|
247
249
|
end
|
248
|
-
upload! File.open(
|
250
|
+
upload! File.open("#{key_name}.pub"), "/tmp/pubkeys"
|
249
251
|
execute "mv", "/tmp/pubkeys", "#{mount_point}/home/#{user}/.ssh/authorized_keys"
|
250
252
|
execute "chroot", mount_point, "/bin/bash", "-c",
|
251
253
|
"\"chown", "#{user}:#{user}", "/home/#{user}/.ssh/authorized_keys\""
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: libvirtinator
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
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: 2016-
|
12
|
+
date: 2016-02-04 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: capistrano
|