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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 12e40cd361023a3ff153bcc3e0287a4cfed104fc
4
- data.tar.gz: d66b86f684ba545e9cc4b1570700daeccc9e7220
3
+ metadata.gz: 3fe1aadb7778ccd6b7a4dcf5fadba904e63b27dc
4
+ data.tar.gz: 062af3dd9a89457c06a2a6f9996b9a9bcde2c898
5
5
  SHA512:
6
- metadata.gz: a2bc0eed67e003d9d6e8d51118fc4d8c7e4e55433ca0dafad9f3513a201f5e9e3b4e4a1e723e219153590c41dbf7c2c803cc831f1c5e4fb278d01ab62d91f38b
7
- data.tar.gz: df8b808cc5898aeee76d05554ee0e9c21f0e090742efe0a1cc594979164bd799956d9424d3d0bb499af88a1d36f7ea88eb868bbb791d6ae61db811911b5700e7
6
+ metadata.gz: 6ba7a634d943732ca6f4a7a0be8a7834bc79a4ebbab919548789f6870b27c039130dee6f04061dfaefdd4026fa28182e35b11cbcee9abc1bc26c037113f816d8
7
+ data.tar.gz: 9c1e82982b6bc8f54dbed794c567c3687f24eae269e4ba9ca8bfadcae102bb2b395863222b4654208cb510410e798d4b90a5d60c196bfccb9e7de9404e8d6c4a
@@ -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, \
@@ -1,3 +1,3 @@
1
1
  module Gogetit
2
- VERSION = "0.6.0"
2
+ VERSION = "0.7.0"
3
3
  end
@@ -290,7 +290,12 @@ module Gogetit
290
290
  args = generate_network_config(args, options)
291
291
  args = generate_devices(args, options)
292
292
 
293
- args[:alias] ||= config[:lxd][:default_alias]
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
- config[:default][:user] ||= ENV['USER']
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 #{config[:default][:user]}@#{options['ip_to_access']}"
333
+ puts "ssh #{default_user}@#{options['ip_to_access']}"
322
334
  else
323
- puts "ssh #{config[:default][:user]}@#{name}"
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.6.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-10-19 00:00:00.000000000 Z
11
+ date: 2017-12-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler