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 +4 -4
- data/README.md +1 -0
- data/lib/gogetit/util.rb +13 -2
- data/lib/gogetit/version.rb +1 -1
- data/lib/providers/libvirt.rb +8 -0
- data/lib/template/domain.xml +1 -1
- 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: ba25e354af7e871467815ee7ee211978b13fd2b1
|
4
|
+
data.tar.gz: 1056a526be418a64b7f4f08ee42c6195e1b16372
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
data/lib/gogetit/version.rb
CHANGED
data/lib/providers/libvirt.rb
CHANGED
@@ -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
|
data/lib/template/domain.xml
CHANGED
@@ -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
|
+
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
|
+
date: 2017-09-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|