libvirtinator 0.1.4 → 0.1.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -66,4 +66,5 @@ set :data_disk_vg_path, -> { fetch("#{fetch(:host_machine_name)}_data_disk_v
66
66
  set :data_disk_lv_name, -> { "#{fetch(:node_name)}-data" }
67
67
  set :data_disk_lv_path, -> { "#{fetch(:data_disk_vg_path)}/#{fetch(:data_disk_lv_name)}" }
68
68
  set :data_disk_qemu_path, -> { "#{fetch(:root_partitions_path)}/#{fetch(:node_name)}-data.qcow2" }
69
+ set :private_key_path, -> { "temp_key_#{fetch(:stage)}" }
69
70
 
@@ -1,9 +1,10 @@
1
1
  namespace :users do
2
2
 
3
3
  task :load_settings => 'libvirtinator:load_settings' do
4
- if fetch(:private_key_path).nil?
4
+ if File.exists? fetch(:private_key_path)
5
5
  SSHKit::Backend::Netssh.configure do |ssh|
6
6
  ssh.ssh_options = {
7
+ keys: fetch(:private_key_path),
7
8
  forward_agent: false,
8
9
  auth_methods: %w(publickey)
9
10
  }
@@ -11,7 +12,6 @@ namespace :users do
11
12
  else
12
13
  SSHKit::Backend::Netssh.configure do |ssh|
13
14
  ssh.ssh_options = {
14
- keys: fetch(:private_key_path),
15
15
  forward_agent: false,
16
16
  auth_methods: %w(publickey)
17
17
  }
@@ -71,7 +71,7 @@ namespace :users do
71
71
  end
72
72
  end
73
73
  run_locally do
74
- unless fetch(:private_key_path).nil?
74
+ if File.exists? fetch(:private_key_path)
75
75
  execute "rm", "-f", "#{fetch(:private_key_path)}*"
76
76
  end
77
77
  end
@@ -241,13 +241,11 @@ 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
- key_name = "temp_key_#{fetch(:stage)}"
245
- set :private_key_path, key_name
246
244
  run_locally do
247
- execute "rm", "-f", key_name
248
- execute "ssh-keygen", "-P", "''", "-f", key_name
245
+ execute "rm", "-f", fetch(:private_key_path)
246
+ execute "ssh-keygen", "-P", "''", "-f", fetch(:private_key_path)
249
247
  end
250
- upload! File.open("#{key_name}.pub"), "/tmp/pubkeys"
248
+ upload! File.open("#{fetch(:private_key_path)}.pub"), "/tmp/pubkeys"
251
249
  execute "mv", "/tmp/pubkeys", "#{mount_point}/home/#{user}/.ssh/authorized_keys"
252
250
  execute "chroot", mount_point, "/bin/bash", "-c",
253
251
  "\"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
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: 2016-02-12 00:00:00.000000000 Z
12
+ date: 2016-02-25 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: capistrano
@@ -27,6 +27,22 @@ dependencies:
27
27
  - - ~>
28
28
  - !ruby/object:Gem::Version
29
29
  version: 3.2.1
30
+ - !ruby/object:Gem::Dependency
31
+ name: net-ssh
32
+ requirement: !ruby/object:Gem::Requirement
33
+ none: false
34
+ requirements:
35
+ - - ~>
36
+ - !ruby/object:Gem::Version
37
+ version: 2.9.1
38
+ type: :runtime
39
+ prerelease: false
40
+ version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ~>
44
+ - !ruby/object:Gem::Version
45
+ version: 2.9.1
30
46
  description: An Opinionated libvirt VM Deployment gem
31
47
  email: davidamick@ctisolutionsinc.com
32
48
  executables: []
@@ -78,3 +94,4 @@ signing_key:
78
94
  specification_version: 3
79
95
  summary: Deploy libvirt VMs
80
96
  test_files: []
97
+ has_rdoc: