libvirtinator 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/lib/libvirtinator/config.rb
CHANGED
@@ -9,6 +9,7 @@ namespace :libvirtinator do
|
|
9
9
|
'examples/config/deploy.rb' => 'config/deploy_example.rb',
|
10
10
|
'examples/config/sysadmins_keys.rb' => 'config/sysadmins_keys_example.rb',
|
11
11
|
'examples/config/deploy/vm_name.rb' => 'config/deploy/vm_name_example.rb',
|
12
|
+
'examples/config/deploy/manual.rb' => 'config/deploy/manual_example.rb',
|
12
13
|
'examples/first_boot.sh.erb' => 'templates/libvirtinator/first_boot_example.sh.erb',
|
13
14
|
'examples/fstab.erb' => 'templates/libvirtinator/fstab_example.erb',
|
14
15
|
'examples/hostname.erb' => 'templates/libvirtinator/hostname_example.erb',
|
@@ -0,0 +1,25 @@
|
|
1
|
+
set :host_machine_name, "none"
|
2
|
+
set :user, -> { ENV['USER'] }
|
3
|
+
|
4
|
+
role :app, "none"
|
5
|
+
|
6
|
+
set :base_image, "none"
|
7
|
+
set :node_name, "none"
|
8
|
+
|
9
|
+
set :data_disk_enabled, false
|
10
|
+
set :data_disk_gb, "0"
|
11
|
+
set :data_disk_type, "lv"
|
12
|
+
set :data_disk_mount_point, "/"
|
13
|
+
set :data_disk_partition, "0"
|
14
|
+
|
15
|
+
set :memory_gb, "0"
|
16
|
+
set :cpus, "0"
|
17
|
+
|
18
|
+
set :ip, "none"
|
19
|
+
set :cidr, "none"
|
20
|
+
|
21
|
+
set :node_fqdn, "none"
|
22
|
+
set :app_fqdn, "none"
|
23
|
+
set :hostname, "none"
|
24
|
+
|
25
|
+
set :usergroups, ["none"]
|
data/lib/libvirtinator/users.rb
CHANGED
@@ -1,9 +1,14 @@
|
|
1
1
|
namespace :users do
|
2
2
|
|
3
3
|
task :load_settings do
|
4
|
-
|
5
|
-
|
6
|
-
|
4
|
+
if ENV['key_path'].nil?
|
5
|
+
set :path, ""
|
6
|
+
until File.exists?(fetch(:path)) and (! File.directory?(fetch(:path)))
|
7
|
+
ask :path, "Which private key has SSH access to the VM? Specifiy an absolute path"
|
8
|
+
end
|
9
|
+
else
|
10
|
+
warn "Using #{ENV['key_path']} (passed as an environment variable.)"
|
11
|
+
set :path, ENV['key_path']
|
7
12
|
end
|
8
13
|
SSHKit::Backend::Netssh.configure do |ssh|
|
9
14
|
ssh.ssh_options = {
|
@@ -14,12 +19,20 @@ namespace :users do
|
|
14
19
|
end
|
15
20
|
end
|
16
21
|
|
22
|
+
desc "Idempotently setup admin UNIX users using only a domain name (or IP) and a usergroup file"
|
23
|
+
task :setup_domain, [:domain, :usergroup] do |t, args|
|
24
|
+
set :ip, -> { args.domain }
|
25
|
+
set :usergroups, -> { Array(args.usergroup) }
|
26
|
+
Rake::Task['users:setup'].invoke
|
27
|
+
end
|
28
|
+
|
17
29
|
desc "Idempotently setup admin UNIX users."
|
18
30
|
task :setup => :load_settings do
|
19
31
|
on "#{fetch(:user)}@#{fetch(:ip)}" do
|
20
32
|
as :root do
|
21
33
|
fetch(:usergroups).each do |usergroup|
|
22
34
|
usergroup = usergroup.to_sym
|
35
|
+
require "./config/#{usergroup}_keys.rb"
|
23
36
|
next if fetch(usergroup).nil? or fetch(usergroup).empty?
|
24
37
|
fetch(usergroup).each do |user|
|
25
38
|
key_file = "/home/#{user['name']}/.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.0.
|
4
|
+
version: 0.0.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: 2014-11
|
12
|
+
date: 2014-12-11 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: capistrano
|
@@ -42,6 +42,7 @@ files:
|
|
42
42
|
- lib/libvirtinator/examples/Capfile
|
43
43
|
- lib/libvirtinator/examples/config/deploy.rb
|
44
44
|
- lib/libvirtinator/examples/config/deploy/vm_name.rb
|
45
|
+
- lib/libvirtinator/examples/config/deploy/manual.rb
|
45
46
|
- lib/libvirtinator/examples/config/sysadmins_keys.rb
|
46
47
|
- lib/libvirtinator/examples/first_boot.sh.erb
|
47
48
|
- lib/libvirtinator/examples/fstab.erb
|