gogetit 0.6.0 → 0.7.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/gogetit/cli.rb +2 -0
- data/lib/gogetit/version.rb +1 -1
- data/lib/providers/lxd.rb +16 -4
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3fe1aadb7778ccd6b7a4dcf5fadba904e63b27dc
|
4
|
+
data.tar.gz: 062af3dd9a89457c06a2a6f9996b9a9bcde2c898
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6ba7a634d943732ca6f4a7a0be8a7834bc79a4ebbab919548789f6870b27c039130dee6f04061dfaefdd4026fa28182e35b11cbcee9abc1bc26c037113f816d8
|
7
|
+
data.tar.gz: 9c1e82982b6bc8f54dbed794c567c3687f24eae269e4ba9ca8bfadcae102bb2b395863222b4654208cb510410e798d4b90a5d60c196bfccb9e7de9404e8d6c4a
|
data/lib/gogetit/cli.rb
CHANGED
@@ -19,6 +19,8 @@ module Gogetit
|
|
19
19
|
desc 'create NAME', 'Create either a container or KVM domain.'
|
20
20
|
method_option :provider, :aliases => '-p', :type => :string, \
|
21
21
|
:default => 'lxd', :desc => 'A provider such as lxd and libvirt'
|
22
|
+
method_option :alias, :aliases => '-a', :type => :string, \
|
23
|
+
:default => '', :desc => 'An alias name for a lxd image'
|
22
24
|
method_option :chef, :aliases => '-c', :type => :boolean, \
|
23
25
|
:default => false, :desc => 'Chef awareness'
|
24
26
|
method_option :vlans, :aliases => '-v', :type => :array, \
|
data/lib/gogetit/version.rb
CHANGED
data/lib/providers/lxd.rb
CHANGED
@@ -290,7 +290,12 @@ module Gogetit
|
|
290
290
|
args = generate_network_config(args, options)
|
291
291
|
args = generate_devices(args, options)
|
292
292
|
|
293
|
-
|
293
|
+
if options['alias'].nil? or options['alias'].empty?
|
294
|
+
args[:alias] = config[:lxd][:default_alias]
|
295
|
+
else
|
296
|
+
args[:alias] = options['alias']
|
297
|
+
end
|
298
|
+
|
294
299
|
args[:sync] ||= true
|
295
300
|
|
296
301
|
conn.create_container(name, args)
|
@@ -316,11 +321,18 @@ module Gogetit
|
|
316
321
|
wait_until_available(ip_or_fqdn, logger)
|
317
322
|
logger.info("#{name} has been created.")
|
318
323
|
|
319
|
-
|
324
|
+
if conn.execute_command(name, "ls /etc/lsb-release")[:metadata][:return] == 0
|
325
|
+
default_user = 'ubuntu'
|
326
|
+
elsif conn.execute_command(name, "ls /etc/redhat-release")[:metadata][:return] == 0
|
327
|
+
default_user = 'centos'
|
328
|
+
else
|
329
|
+
default_user = config[:default][:user]
|
330
|
+
end
|
331
|
+
|
320
332
|
if options['no-maas']
|
321
|
-
puts "ssh #{
|
333
|
+
puts "ssh #{default_user}@#{options['ip_to_access']}"
|
322
334
|
else
|
323
|
-
puts "ssh #{
|
335
|
+
puts "ssh #{default_user}@#{name}"
|
324
336
|
end
|
325
337
|
|
326
338
|
true
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gogetit
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.7.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Don Draper
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-12-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|