gogetit 0.4.2 → 0.5.0

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 836a2ee58a72512d876c97ed02a181f2b1d66710
4
- data.tar.gz: 658c24d5c341d30705fa50ce837cc811115a0168
3
+ metadata.gz: ba25e354af7e871467815ee7ee211978b13fd2b1
4
+ data.tar.gz: 1056a526be418a64b7f4f08ee42c6195e1b16372
5
5
  SHA512:
6
- metadata.gz: f6e89a670bc315c877621587a301b65c1fdd6337b052fc4a70715b26930a060c8843938a691bdfa58cb299b7bbfdeaac0ef74287bdbd83f574308a570c5dc5e6
7
- data.tar.gz: e690a457ea2cffe64c4b58414a35915045afd63d8360c45f020c745839b184d133a7bcbffbad05003e2df6a8134cb247074b16c87fde9b1a7287ffaa42a2c1ca
6
+ metadata.gz: 6740ad1b301616c777da614f28c54da58b1c1f6885bc66c13cf79055c6fddaac80c15ea8e3583ba2524b68508b357a736380a2189af4c1f26652e06723cc0e4b
7
+ data.tar.gz: af8648d442cf64042c3c358573a7ba5390a509a65bc1abe339abc7c783b5056958123e2df4c190456a09f277184c5c78673b8cc3a0c8e850d71d931227c11066
data/README.md CHANGED
@@ -82,6 +82,7 @@ require 'gogetit'
82
82
  - Provisioning LXD with useful cloud-init user-data.
83
83
  - Deploying bare metal machine from machine pool.
84
84
  - Static IP auto-assignment with VLAN info.
85
+ - Working with Multiple LXD and Libvirt hosts
85
86
 
86
87
  ## Development and Contributing
87
88
  Clone and then execute followings:
data/lib/gogetit/util.rb CHANGED
@@ -101,7 +101,7 @@ module Gogetit
101
101
  end
102
102
  logger.info("#{fqdn} is now available to ping..")
103
103
 
104
- until ssh_available?(fqdn, 'ubuntu')
104
+ until ssh_available?(fqdn, 'ubuntu', logger)
105
105
  logger.info("Calling <#{__method__.to_s}> for ssh to be ready..")
106
106
  sleep 3
107
107
  end
@@ -115,7 +115,8 @@ module Gogetit
115
115
  $?.exitstatus == 0
116
116
  end
117
117
 
118
- def ssh_available?(fqdn, user)
118
+ def ssh_available?(fqdn, user, logger)
119
+ logger.info("Calling <#{__method__.to_s}>")
119
120
  begin
120
121
  Net::SSH.start(fqdn, user).class
121
122
  rescue Exception => e
@@ -136,5 +137,15 @@ module Gogetit
136
137
  return ifaces
137
138
  end
138
139
 
140
+ def run_through_ssh(host, commands, logger)
141
+ logger.info("Calling <#{__method__.to_s}>")
142
+ Net::SSH.start(host, 'ubuntu') do |ssh|
143
+ commands.each do |cmd|
144
+ logger.info("'#{cmd}' is being executed..")
145
+ output = ssh.exec!(cmd)
146
+ puts output if output != ''
147
+ end
148
+ end
149
+ end
139
150
  end
140
151
  end
@@ -1,3 +1,3 @@
1
1
  module Gogetit
2
- VERSION = "0.4.2"
2
+ VERSION = "0.5.0"
3
3
  end
@@ -178,6 +178,14 @@ module Gogetit
178
178
 
179
179
  fqdn = name + '.' + maas.get_domain
180
180
  wait_until_available(fqdn, logger)
181
+
182
+ # To enable serial console to use 'virsh console'
183
+ commands = [
184
+ 'sudo systemctl enable serial-getty@ttyS0.service',
185
+ 'sudo systemctl start serial-getty@ttyS0.service'
186
+ ]
187
+ run_through_ssh(fqdn, commands, logger)
188
+
181
189
  logger.info("#{domain[:name]} has been created.")
182
190
  true
183
191
  end
@@ -39,7 +39,7 @@
39
39
  <target type='serial' port='0'/>
40
40
  </console>
41
41
  <input type='keyboard' bus='ps2'/>
42
- <graphics type='vnc' port='-1' autoport='yes'/>
42
+ <graphics type='vnc' port='-1' autoport='yes' listen='0.0.0.0' keymap='en-us'/>
43
43
  <video>
44
44
  <model type='cirrus' vram='16384' heads='1'/>
45
45
  </video>
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.2
4
+ version: 0.5.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-09-11 00:00:00.000000000 Z
11
+ date: 2017-09-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler