gogetit 0.21.1 → 0.22.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 +3 -0
- data/lib/gogetit/cli.rb +14 -10
- data/lib/gogetit/version.rb +1 -1
- data/lib/providers/libvirt.rb +6 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ba0608a42390622d4ae89615733214bdb75e01b251f56b77409fd9406bb089a5
|
4
|
+
data.tar.gz: da74ed1fdbcacc0812dae8fe2ea827a71606bd2dfff3b93f5be40ac66a5a24b0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c7863bdecbec3487dc95f4807495356f6f6567ad677d55b2396119915024c838b2632a103f41acc67d1a96483adecfd21850fb3e420d3e4d7d737107bb73ab4a
|
7
|
+
data.tar.gz: 107fbfb0536644765b787a978101a3e2f9c2b105475d2063af1b8700b0a187304e4e701e36d22cc6d43f7e33a55ddec541f61dbacd8da4ba920d36c0704e1aa1
|
data/README.md
CHANGED
@@ -66,6 +66,9 @@ gogetit create lxd02 -p lxd -a centos7
|
|
66
66
|
# When specifying distro for Libvirt provider
|
67
67
|
gogetit create kvm01 -p libvirt -d centos
|
68
68
|
|
69
|
+
# When specifying a spec for Libvirt provider
|
70
|
+
gogetit create kvm01 -p libvirt -s ceph
|
71
|
+
|
69
72
|
# When deploying on an existing machine(only for libvirt provider)
|
70
73
|
gogetit deploy kvm01
|
71
74
|
gogetit deploy kvm01 -d centos
|
data/lib/gogetit/cli.rb
CHANGED
@@ -55,6 +55,8 @@ module Gogetit
|
|
55
55
|
desc 'create NAME', 'Create either a container or KVM domain.'
|
56
56
|
method_option :provider, :aliases => '-p', :type => :string, \
|
57
57
|
:default => 'lxd', :desc => 'A provider such as lxd and libvirt'
|
58
|
+
method_option :spec, :aliases => '-s', :type => :string, \
|
59
|
+
:desc => 'A spec specified in gogetit.yml'
|
58
60
|
method_option :alias, :aliases => '-a', :type => :string, \
|
59
61
|
:desc => 'An alias name for a lxd image'
|
60
62
|
method_option :distro, :aliases => '-d', :type => :string, \
|
@@ -77,18 +79,20 @@ module Gogetit
|
|
77
79
|
method_option :"file", :aliases => '-f', :type => :string, \
|
78
80
|
:desc => 'File location(only for LXD provider)'
|
79
81
|
def create(name)
|
80
|
-
abort("
|
82
|
+
abort(":vlans and :ipaddresses can not be set together.") \
|
81
83
|
if options[:vlans] and options[:ipaddresses]
|
82
|
-
abort("
|
84
|
+
abort(":chef and :zero can not be set together.") \
|
83
85
|
if options[:chef] and options[:zero]
|
84
|
-
abort("when 'no-maas', the network configuration have to be set by
|
86
|
+
abort("when :'no-maas', the network configuration have to be set by :file.") \
|
85
87
|
if options[:'no-maas'] and (options[:vlans] or options[:ipaddresses])
|
86
|
-
abort("'no-maas' and
|
88
|
+
abort(":'no-maas' and :file have to be set together.") \
|
87
89
|
if options[:'no-maas'] ^ !!options[:file]
|
88
|
-
abort("
|
90
|
+
abort(":distro has to be set only with libvirt provider.") \
|
89
91
|
if options[:distro] and options[:provider] == 'lxd'
|
90
|
-
abort("
|
92
|
+
abort(":alias has to be set with lxd provider.") \
|
91
93
|
if options[:alias] and options[:provider] == 'libvirt'
|
94
|
+
abort(":spec has to be set only with libvirt provider.") \
|
95
|
+
if options[:spec] and options[:provider] == 'lxd'
|
92
96
|
|
93
97
|
case options[:provider]
|
94
98
|
when 'lxd'
|
@@ -114,7 +118,7 @@ module Gogetit
|
|
114
118
|
method_option :zero, :aliases => '-z', :type => :boolean, \
|
115
119
|
:default => false, :desc => 'Chef Zero awareness'
|
116
120
|
def destroy(name)
|
117
|
-
abort("
|
121
|
+
abort(":chef and :zero can not be set together.") \
|
118
122
|
if options[:chef] and options[:zero]
|
119
123
|
|
120
124
|
provider = get_provider_of(name, providers)
|
@@ -145,7 +149,7 @@ module Gogetit
|
|
145
149
|
method_option :zero, :aliases => '-z', :type => :boolean, \
|
146
150
|
:default => false, :desc => 'Chef Zero awareness'
|
147
151
|
def deploy(name)
|
148
|
-
abort("
|
152
|
+
abort(":chef and :zero can not be set together.") \
|
149
153
|
if options[:chef] and options[:zero]
|
150
154
|
|
151
155
|
Gogetit::CLI.result = libvirt.deploy(name, options)
|
@@ -166,7 +170,7 @@ module Gogetit
|
|
166
170
|
method_option :zero, :aliases => '-z', :type => :boolean, \
|
167
171
|
:default => false, :desc => 'Chef Zero awareness'
|
168
172
|
def release(name)
|
169
|
-
abort("
|
173
|
+
abort(":chef and :zero can not be set together.") \
|
170
174
|
if options[:chef] and options[:zero]
|
171
175
|
|
172
176
|
Gogetit::CLI.result = libvirt.release(name)
|
@@ -187,7 +191,7 @@ module Gogetit
|
|
187
191
|
method_option :zero, :aliases => '-z', :type => :boolean, \
|
188
192
|
:default => false, :desc => 'Chef Zero awareness'
|
189
193
|
def rebuild(name)
|
190
|
-
abort("
|
194
|
+
abort(":chef and :zero can not be set together.") \
|
191
195
|
if options[:chef] and options[:zero]
|
192
196
|
|
193
197
|
provider = get_provider_of(name, providers)
|
data/lib/gogetit/version.rb
CHANGED
data/lib/providers/libvirt.rb
CHANGED
@@ -160,7 +160,12 @@ module Gogetit
|
|
160
160
|
" Please check both on MAAS and libvirt.") \
|
161
161
|
if maas.domain_name_exists?(name) or domain_exists?(name)
|
162
162
|
|
163
|
-
|
163
|
+
if options[:spec]
|
164
|
+
domain = config[:libvirt][:specs][:"#{options[:spec]}"]
|
165
|
+
else
|
166
|
+
domain = config[:libvirt][:specs][:default]
|
167
|
+
end
|
168
|
+
|
164
169
|
ifaces = nil
|
165
170
|
|
166
171
|
if options[:ipaddresses]
|