vagrant-lxd 0.1.2 → 0.1.3

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: 61672c78ba393c4f34973d8d0f56a76568dcb3be
4
- data.tar.gz: b0c08820b88572b7fc94fa67559d4c129f06f647
3
+ metadata.gz: 5b7a90200673f156589bed529f7a173e7950798d
4
+ data.tar.gz: 2e266432e3978370153b9788740ab7619fb61687
5
5
  SHA512:
6
- metadata.gz: 4b0cca7c0d4fa3c8c9c6f5931a6db8e5ed1988fada9085461a1c2eedfcd2785e729f2812c0aa7c210f2916d277018c57883f52f6457f6aaea42c4285bf876cf4
7
- data.tar.gz: dc7da8f906ccf8ca2e81ca3d2b43c6c3cde6cf4cd9b3b58e0c2c6420c2d4dc45b68a5335602bb7a3d3a339654ef1015fe0dc0f42b026ac3fa25bb1d8507ee29b
6
+ metadata.gz: c69f93fad75e816cc856e75783b040bd38188468d7a4f8f098eddfb0f592e22d5fbdb23dacc430f23b72f48c07aaabc409246fbbbe8096dbb0ea999285ad821c
7
+ data.tar.gz: e77b010f6287d9aa119f535e845859cbc85ee0a16269ccacd6abedd6f884bba82e1dc076f7d230ec0d2169d3796cee56a091b5ab69e46d8b5d67ea8edc2a21b8
@@ -23,8 +23,8 @@ GIT
23
23
  PATH
24
24
  remote: .
25
25
  specs:
26
- vagrant-lxd (0.1.2)
27
- hyperkit (~> 1.1.0)
26
+ vagrant-lxd (0.1.3)
27
+ hyperkit (~> 1.1)
28
28
 
29
29
  GEM
30
30
  remote: https://rubygems.org/
@@ -145,4 +145,4 @@ DEPENDENCIES
145
145
  vagrant-lxd!
146
146
 
147
147
  BUNDLED WITH
148
- 1.15.3
148
+ 1.16.1
data/README.md CHANGED
@@ -80,6 +80,8 @@ Vagrant.configure('2') do |config|
80
80
  lxd.api_endpoint = 'https://127.0.0.1:8443'
81
81
  lxd.timeout = 10
82
82
  lxd.name = nil
83
+ lxd.nesting = false
84
+ lxd.privileged = false
83
85
  lxd.ephemeral = false
84
86
  end
85
87
  end
@@ -119,6 +121,21 @@ container called "my-container", use the `vagrant lxd attach` command:
119
121
  $ vagrant lxd attach default my-container
120
122
  ==> default: Attaching to container 'my-container'...
121
123
 
124
+ ### Nested Containers
125
+
126
+ In order to run Linux containers on an LXD-backed machine, it must be
127
+ created with the `nesting` and `privileged` properties set to `true`.
128
+ These correspond to the `security.nesting` and `security.privileged`
129
+ configuration items for LXD, respectively. Refer to LXD's [container
130
+ configuration documentation][docs] for details.
131
+
132
+ config.vm.provider 'lxd' do |lxd|
133
+ lxd.nesting = true
134
+ lxd.privileged = true
135
+ end
136
+
137
+ [docs]: https://lxd.readthedocs.io/en/latest/containers/
138
+
122
139
  ## Hacking
123
140
 
124
141
  To run Vagrant with the plugin automatically loaded, you can use the
@@ -23,12 +23,16 @@ module VagrantLXD
23
23
  class Config < Vagrant.plugin('2', :config)
24
24
  attr_accessor :api_endpoint
25
25
  attr_accessor :name
26
+ attr_accessor :nesting
27
+ attr_accessor :privileged
26
28
  attr_accessor :ephemeral
27
29
  attr_accessor :timeout
28
30
 
29
31
  def initialize
30
32
  @name = UNSET_VALUE
31
33
  @timeout = UNSET_VALUE
34
+ @nesting = UNSET_VALUE
35
+ @privileged = UNSET_VALUE
32
36
  @ephemeral = UNSET_VALUE
33
37
  @api_endpoint = UNSET_VALUE
34
38
  end
@@ -47,7 +51,7 @@ module VagrantLXD
47
51
  end
48
52
 
49
53
  unless timeout == UNSET_VALUE
50
- if not timeout.is_a? Fixnum
54
+ if not timeout.is_a? Integer
51
55
  errors << "Invalid `timeout' (value must be an integer): #{timeout.inspect}"
52
56
  elsif timeout < 1
53
57
  errors << "Invalid `timeout' (value must be positive): #{timeout.inspect}"
@@ -62,6 +66,14 @@ module VagrantLXD
62
66
  end
63
67
  end
64
68
 
69
+ unless [UNSET_VALUE, true, false].include? nesting
70
+ errors << "Invalid `nesting' (value must be true or false): #{nesting.inspect}"
71
+ end
72
+
73
+ unless [UNSET_VALUE, true, false].include? privileged
74
+ errors << "Invalid `privileged' (value must be true or false): #{privileged.inspect}"
75
+ end
76
+
65
77
  unless [UNSET_VALUE, true, false].include? ephemeral
66
78
  errors << "Invalid `ephemeral' (value must be true or false): #{ephemeral.inspect}"
67
79
  end
@@ -74,6 +86,14 @@ module VagrantLXD
74
86
  @name = nil
75
87
  end
76
88
 
89
+ if nesting == UNSET_VALUE
90
+ @nesting = false
91
+ end
92
+
93
+ if privileged == UNSET_VALUE
94
+ @privileged = false
95
+ end
96
+
77
97
  if ephemeral == UNSET_VALUE
78
98
  @ephemeral = false
79
99
  end
@@ -88,6 +88,8 @@ module VagrantLXD
88
88
  NOT_CREATED = Vagrant::MachineState::NOT_CREATED_ID
89
89
 
90
90
  attr_reader :api_endpoint
91
+ attr_reader :nesting
92
+ attr_reader :privileged
91
93
  attr_reader :ephemeral
92
94
  attr_reader :name
93
95
  attr_reader :timeout
@@ -96,6 +98,8 @@ module VagrantLXD
96
98
  @machine = machine
97
99
  @timeout = machine.provider_config.timeout
98
100
  @api_endpoint = machine.provider_config.api_endpoint
101
+ @nesting = machine.provider_config.nesting
102
+ @privileged = machine.provider_config.privileged
99
103
  @ephemeral = machine.provider_config.ephemeral
100
104
  @name = machine.provider_config.name
101
105
  @logger = Log4r::Logger.new('vagrant::lxd')
@@ -365,7 +369,10 @@ module VagrantLXD
365
369
  end
366
370
 
367
371
  def config
368
- config = {}
372
+ config = {
373
+ :'security.nesting' => nesting,
374
+ :'security.privileged' => privileged,
375
+ }
369
376
 
370
377
  # Set "raw.idmap" if the host's sub{u,g}id configuration allows it.
371
378
  # This allows sharing folders via LXD (see synced_folder.rb).
@@ -20,7 +20,7 @@
20
20
  module VagrantLXD
21
21
  module Version
22
22
  NAME = 'vagrant-lxd'
23
- VERSION = '0.1.2'
23
+ VERSION = '0.1.3'
24
24
  DESCRIPTION = 'Vagrant LXD provider'
25
25
  end
26
26
  end
@@ -28,12 +28,12 @@ Gem::Specification.new do |spec|
28
28
  spec.description = 'A Vagrant plugin that allows management of containers using LXD.'
29
29
  spec.authors = ['Evan Hanson']
30
30
  spec.email = ['evanh@catalyst.net.nz']
31
- spec.license = 'GPLv3'
31
+ spec.license = 'GPL-3.0'
32
32
  spec.homepage = 'https://gitlab.com/catalyst-it/vagrant-lxd'
33
33
  spec.require_paths = ['lib']
34
34
  spec.files = `git ls-files -z`.split("\x0").reject do |f|
35
35
  f.match(%r{^(test|spec|features)/})
36
36
  end
37
37
 
38
- spec.add_runtime_dependency 'hyperkit', '~> 1.1.0'
38
+ spec.add_runtime_dependency 'hyperkit', '~> 1.1'
39
39
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vagrant-lxd
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Evan Hanson
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-12-11 00:00:00.000000000 Z
11
+ date: 2018-02-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: hyperkit
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 1.1.0
19
+ version: '1.1'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: 1.1.0
26
+ version: '1.1'
27
27
  description: A Vagrant plugin that allows management of containers using LXD.
28
28
  email:
29
29
  - evanh@catalyst.net.nz
@@ -52,7 +52,7 @@ files:
52
52
  - vagrant-lxd.gemspec
53
53
  homepage: https://gitlab.com/catalyst-it/vagrant-lxd
54
54
  licenses:
55
- - GPLv3
55
+ - GPL-3.0
56
56
  metadata: {}
57
57
  post_install_message:
58
58
  rdoc_options: []