gogetit 0.16.0 → 0.17.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
  SHA256:
3
- metadata.gz: 8907083242126e73dddd139d9e763457cf37a6b6bcc4dd571b405ff70e1e9052
4
- data.tar.gz: a15dd0a170a63825fe70e5677719f2bb6b2cae5b90d520a14ab8687acac2b5ab
3
+ metadata.gz: feea9f469e99f44736df03434f39e6656ff98f539e2984c9612c48dbf3e517e9
4
+ data.tar.gz: 7ffd7149dd8da0571ba1f12ae50126431949431798c1fa52253c9fb8ac750751
5
5
  SHA512:
6
- metadata.gz: afb2d8cb2b3ac18f07cdedc8bacb1177e7fdc83e37bea752c6a042492dd147d40d6c98ad5555d2c466b48761c4aa9d37f519497237395d47cc5f621c56851c5b
7
- data.tar.gz: 95b329fd114ec4623be32d2eaa916e5ceebd42155d99a9a2ee0e1ee9292d5f5a6339709660967092320158e236817c3e2ed7405cd80c1a1061485bde5ca68df9
6
+ metadata.gz: 5ad95329dabf38ba47b066d7b8e8aa907675e34304afd7449c17157a54ee87e1758611dfef033682f62225ab1134237fd21b9e5638ac67a10d54d408fb753dc7
7
+ data.tar.gz: eca792979825cbec1db67566e76ddeedb2b8eafb5edd4613b40e48f3e4d51e093933c7c53f259d836149a25e69bf2c60142bf45ad4aaf05c340687ea24ae4f95
@@ -77,22 +77,16 @@ module Gogetit
77
77
  def create(name)
78
78
  abort("'vlans' and 'ipaddresses' can not be set together.") \
79
79
  if options['vlans'] and options['ipaddresses']
80
-
81
80
  abort("'chef' and 'zero' can not be set together.") \
82
81
  if options['chef'] and options['zero']
83
-
84
82
  abort("when 'no-maas', the network configuration have to be set by 'file'.") \
85
83
  if options['no-maas'] and (options['vlans'] or options['ipaddresses'])
86
-
87
84
  abort("'no-maas' and 'file' have to be set together.") \
88
85
  if options['no-maas'] ^ !!options['file']
89
-
90
- abort("'maas-on-lxc' and 'no-maas' have to be set together.") \
91
- if options['maas-on-lxc'] ^ !!options['no-maas']
92
-
86
+ abort("'maas-on-lxc' has to be set with 'no-maas'.") \
87
+ if options['maas-on-lxc'] and !options['no-maas']
93
88
  abort("'distro' has to be set with libvirt provider.") \
94
89
  if options['distro'] and options['provider'] == 'lxd'
95
-
96
90
  abort("'alias' has to be set with lxd provider.") \
97
91
  if options['alias'] and options['provider'] == 'libvirt'
98
92
 
@@ -1,3 +1,3 @@
1
1
  module Gogetit
2
- VERSION = "0.16.0"
2
+ VERSION = "0.17.0"
3
3
  end
@@ -271,8 +271,16 @@ echo \"RevokedKeys #{config[:cloud_init][:ssh_ca_public_key][:revocation_path]}\
271
271
  args[:devices] = {}
272
272
 
273
273
  if options['no-maas']
274
- args[:devices] = \
275
- (Hashie.symbolize_keys YAML.load_file(options['file'])['devices'])
274
+ args[:devices] = YAML.load_file(options['file'])['devices']
275
+
276
+ # https://docs.maas.io/2.4/en/installconfig-lxd-install
277
+ for i in 0..7
278
+ i = i.to_s
279
+ args[:devices]["loop" + i] = {}
280
+ args[:devices]["loop" + i]["path"] = "/dev/loop" + i
281
+ args[:devices]["loop" + i]["type"] = "unix-block"
282
+ end
283
+
276
284
  # Now, LXD API can handle integer as a value of a map
277
285
  args[:devices].each do |k, v|
278
286
  v.each do |kk, vv|
@@ -282,6 +290,8 @@ echo \"RevokedKeys #{config[:cloud_init][:ssh_ca_public_key][:revocation_path]}\
282
290
  end
283
291
  end
284
292
 
293
+ args[:devices] = (Hashie.symbolize_keys args[:devices])
294
+
285
295
  elsif options['ipaddresses']
286
296
  options[:ifaces].each_with_index do |iface,index|
287
297
  if index == 0
@@ -414,6 +424,7 @@ echo \"RevokedKeys #{config[:cloud_init][:ssh_ca_public_key][:revocation_path]}\
414
424
  # Adding configurations that are necessary for shipping MAAS on lxc
415
425
  if options['no-maas'] and options['maas-on-lxc']
416
426
  container.config = container.config.to_hash
427
+ # https://docs.maas.io/2.4/en/installconfig-lxd-install
417
428
  container.config[:"raw.lxc"] = "\
418
429
  lxc.cgroup.devices.allow = c 10:237 rwm\n\
419
430
  lxc.aa_profile = unconfined\n\
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.16.0
4
+ version: 0.17.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: 2018-05-17 00:00:00.000000000 Z
11
+ date: 2018-05-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler