vagrant-lxd 0.5.3 → 0.5.4

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: b89636a6a97535b4de4e9e3cfb4fcc458fb06f70ca3d55ff7bc62c9bea14c74a
4
- data.tar.gz: a3fe8906086a40e8b9ed66840834990832a401569a70373d99ee8b81281e47a8
3
+ metadata.gz: 06befa3b329e3326a09931a8b2a9697fd7f30c25d95935382eaa14fc71f55667
4
+ data.tar.gz: ed9cea092231c528d359a629b69b4c3ff847098c1e26706886a9d686df6d02b6
5
5
  SHA512:
6
- metadata.gz: d0289b302cb01183cea109c3dc80aa61ea0d54350b9d9ae1539bed266f784f37f12b4ce64711afe9cc17cedcac87d0825ad51df1aa66fe90a1df750fa9e9a9e9
7
- data.tar.gz: 180e12636dd09fed787989067229a4f501120dfcdfac46ec6cdeb1d799254ddd4e5f305b51a272c4b8e10b30fd68efdaf9280088299c25294655e2c95eef5736
6
+ metadata.gz: ed5232a956aed40892dfc03e072e42a9292ad08f24e2ea5b5a720697aad947714f7a5b6d1073e8aee5b17e21445394b1f193f6e9f23ad1ea381a3b9a7d066979
7
+ data.tar.gz: a282394ec033c9b5ca9ba5706b8d288dfb19fa6ff6d492aa06170062cf83d7eff3984d03003fec9ebdc0a00cd0ea91554e0050fce22da96d96fe0ca9acaafebb
data/.gitlab-ci.yml CHANGED
@@ -4,7 +4,8 @@ before_script:
4
4
  - apt-get -y update
5
5
  - apt-get -y upgrade
6
6
  - gem install bundler
7
- - bundle install -j $(nproc) --path vendor/bundle
7
+ - bundle config set --local path vendor/bundle
8
+ - bundle install --jobs $(nproc)
8
9
 
9
10
  spec:
10
11
  script:
data/Gemfile CHANGED
@@ -7,7 +7,7 @@ group :development do
7
7
  gem 'rspec'
8
8
  gem 'rspec-its'
9
9
  gem 'rspec-mocks'
10
- gem 'vagrant', git: 'https://github.com/mitchellh/vagrant.git'
10
+ gem 'vagrant', git: 'https://github.com/mitchellh/vagrant.git', tag: 'v2.2.15'
11
11
  end
12
12
 
13
13
  group :plugins do
data/Gemfile.lock CHANGED
@@ -1,25 +1,24 @@
1
1
  GIT
2
2
  remote: https://github.com/mitchellh/vagrant.git
3
- revision: f19eb286e4cc2aeae06b632ef1fa44db499df403
3
+ revision: 9247e07fc8ffe2fdb91c6422bbb133a25983fe15
4
+ tag: v2.2.15
4
5
  specs:
5
- vagrant (2.2.11.dev)
6
- bcrypt_pbkdf (~> 1.0.0)
6
+ vagrant (2.2.15)
7
+ bcrypt_pbkdf (~> 1.1)
7
8
  childprocess (~> 4.0.0)
8
9
  ed25519 (~> 1.2.4)
9
10
  erubi
10
11
  hashicorp-checkpoint (~> 0.1.5)
11
12
  i18n (~> 1.8)
12
- listen (~> 3.1)
13
+ listen (~> 3.4)
13
14
  log4r (~> 1.1.9, < 1.1.11)
14
- mime (~> 0.4.4)
15
+ mime-types (~> 3.3)
15
16
  net-scp (~> 1.2.0)
16
17
  net-sftp (~> 3.0)
17
- net-ssh (~> 6.0)
18
+ net-ssh (>= 6.1.0, < 7)
18
19
  rb-kqueue (~> 0.2.0)
19
- rest-client (>= 1.6.0, < 3.0)
20
- ruby_dep (<= 1.3.1)
21
20
  rubyzip (~> 2.0)
22
- vagrant_cloud (~> 2.0.3)
21
+ vagrant_cloud (~> 3.0.4)
23
22
  wdm (~> 0.1.0)
24
23
  winrm (>= 2.3.4, < 3.0)
25
24
  winrm-elevated (>= 1.2.1, < 2.0)
@@ -28,7 +27,7 @@ GIT
28
27
  PATH
29
28
  remote: .
30
29
  specs:
31
- vagrant-lxd (0.5.3)
30
+ vagrant-lxd (0.5.4)
32
31
  activesupport (~> 5.2.3)
33
32
  faraday (~> 0.17)
34
33
  hyperkit (~> 1.3.0)
@@ -36,40 +35,37 @@ PATH
36
35
  GEM
37
36
  remote: https://rubygems.org/
38
37
  specs:
39
- activesupport (5.2.4.4)
38
+ activesupport (5.2.6)
40
39
  concurrent-ruby (~> 1.0, >= 1.0.2)
41
40
  i18n (>= 0.7, < 2)
42
41
  minitest (~> 5.1)
43
42
  tzinfo (~> 1.1)
44
- addressable (2.7.0)
43
+ addressable (2.8.0)
45
44
  public_suffix (>= 2.0.2, < 5.0)
46
- bcrypt_pbkdf (1.0.1)
45
+ bcrypt_pbkdf (1.1.0)
47
46
  builder (3.2.4)
48
47
  childprocess (4.0.0)
49
- concurrent-ruby (1.1.7)
48
+ concurrent-ruby (1.1.8)
50
49
  diff-lcs (1.4.4)
51
- domain_name (0.5.20190701)
52
- unf (>= 0.0.5, < 1.0.0)
53
50
  ed25519 (1.2.4)
54
- erubi (1.9.0)
55
- fakefs (1.2.2)
56
- faraday (0.17.3)
51
+ erubi (1.10.0)
52
+ excon (0.79.0)
53
+ fakefs (1.3.2)
54
+ faraday (0.17.4)
57
55
  multipart-post (>= 1.2, < 3)
58
- ffi (1.13.1)
59
- gssapi (1.3.0)
56
+ ffi (1.15.0)
57
+ gssapi (1.3.1)
60
58
  ffi (>= 1.0.1)
61
59
  gyoku (1.3.1)
62
60
  builder (>= 2.1.2)
63
61
  hashicorp-checkpoint (0.1.5)
64
- http-cookie (1.0.3)
65
- domain_name (~> 0.5)
66
62
  httpclient (2.8.3)
67
63
  hyperkit (1.3.0)
68
64
  activesupport (>= 4.2.6)
69
65
  sawyer
70
- i18n (1.8.5)
66
+ i18n (1.8.10)
71
67
  concurrent-ruby (~> 1.0)
72
- listen (3.2.1)
68
+ listen (3.5.1)
73
69
  rb-fsevent (~> 0.10, >= 0.10.3)
74
70
  rb-inotify (~> 0.9, >= 0.9.10)
75
71
  little-plugger (1.1.4)
@@ -77,11 +73,10 @@ GEM
77
73
  logging (2.3.0)
78
74
  little-plugger (~> 1.1)
79
75
  multi_json (~> 1.14)
80
- mime (0.4.4)
81
76
  mime-types (3.3.1)
82
77
  mime-types-data (~> 3.2015)
83
- mime-types-data (3.2020.0512)
84
- minitest (5.14.2)
78
+ mime-types-data (3.2021.0225)
79
+ minitest (5.14.4)
85
80
  multi_json (1.15.0)
86
81
  multipart-post (2.1.1)
87
82
  net-scp (1.2.1)
@@ -89,51 +84,43 @@ GEM
89
84
  net-sftp (3.0.0)
90
85
  net-ssh (>= 5.0.0, < 7.0.0)
91
86
  net-ssh (6.1.0)
92
- netrc (0.11.0)
93
87
  nori (2.6.0)
94
88
  public_suffix (4.0.6)
95
- rake (13.0.1)
89
+ rake (13.0.3)
96
90
  rb-fsevent (0.10.4)
97
91
  rb-inotify (0.10.1)
98
92
  ffi (~> 1.0)
99
93
  rb-kqueue (0.2.5)
100
94
  ffi (>= 0.5.0)
101
- rest-client (2.0.2)
102
- http-cookie (>= 1.0.2, < 2.0)
103
- mime-types (>= 1.16, < 4.0)
104
- netrc (~> 0.8)
105
- rspec (3.9.0)
106
- rspec-core (~> 3.9.0)
107
- rspec-expectations (~> 3.9.0)
108
- rspec-mocks (~> 3.9.0)
109
- rspec-core (3.9.3)
110
- rspec-support (~> 3.9.3)
111
- rspec-expectations (3.9.2)
95
+ rspec (3.10.0)
96
+ rspec-core (~> 3.10.0)
97
+ rspec-expectations (~> 3.10.0)
98
+ rspec-mocks (~> 3.10.0)
99
+ rspec-core (3.10.1)
100
+ rspec-support (~> 3.10.0)
101
+ rspec-expectations (3.10.1)
112
102
  diff-lcs (>= 1.2.0, < 2.0)
113
- rspec-support (~> 3.9.0)
103
+ rspec-support (~> 3.10.0)
114
104
  rspec-its (1.3.0)
115
105
  rspec-core (>= 3.0.0)
116
106
  rspec-expectations (>= 3.0.0)
117
- rspec-mocks (3.9.1)
107
+ rspec-mocks (3.10.2)
118
108
  diff-lcs (>= 1.2.0, < 2.0)
119
- rspec-support (~> 3.9.0)
120
- rspec-support (3.9.3)
121
- ruby_dep (1.3.1)
122
- rubyntlm (0.6.2)
109
+ rspec-support (~> 3.10.0)
110
+ rspec-support (3.10.2)
111
+ rubyntlm (0.6.3)
123
112
  rubyzip (2.3.0)
124
113
  sawyer (0.8.2)
125
114
  addressable (>= 2.3.5)
126
115
  faraday (> 0.8, < 2.0)
127
116
  thread_safe (0.3.6)
128
- tzinfo (1.2.7)
117
+ tzinfo (1.2.9)
129
118
  thread_safe (~> 0.1)
130
- unf (0.1.4)
131
- unf_ext
132
- unf_ext (0.0.7.7)
133
- vagrant_cloud (2.0.3)
134
- rest-client (~> 2.0.2)
119
+ vagrant_cloud (3.0.4)
120
+ excon (~> 0.73)
121
+ log4r (~> 1.1.10)
135
122
  wdm (0.1.1)
136
- winrm (2.3.4)
123
+ winrm (2.3.6)
137
124
  builder (>= 2.1.2)
138
125
  erubi (~> 1.8)
139
126
  gssapi (~> 1.2)
@@ -141,8 +128,8 @@ GEM
141
128
  httpclient (~> 2.2, >= 2.2.0.2)
142
129
  logging (>= 1.6.1, < 3.0)
143
130
  nori (~> 2.0)
144
- rubyntlm (~> 0.6.0, >= 0.6.1)
145
- winrm-elevated (1.2.2)
131
+ rubyntlm (~> 0.6.0, >= 0.6.3)
132
+ winrm-elevated (1.2.3)
146
133
  erubi (~> 1.8)
147
134
  winrm (~> 2.0)
148
135
  winrm-fs (~> 1.0)
data/README.md CHANGED
@@ -236,6 +236,24 @@ folders](#synced-folders) rather than ad-hoc devices.
236
236
 
237
237
  [device-config]: https://lxd.readthedocs.io/en/latest/instances/#devices-configuration
238
238
 
239
+ ### Container Configuration
240
+
241
+ You can pass custom key/value configuration using the `config` setting. This
242
+ should be a map of [instance settings][instance-config], which will be wired
243
+ directly through to the container:
244
+
245
+ config.vm.provider 'lxd' do |lxd|
246
+ lxd.config = {
247
+ 'linux.kernel_modules': 'ip_tables,ip6_tables,netlink_diag,nf_nat,overlay',
248
+ }
249
+ end
250
+
251
+ Not all instance settings make sense in the Vagrant context, and some will or
252
+ won't work based on your LXD host's configuration, so making sure the config is
253
+ valid is up to you.
254
+
255
+ [instance-config]: https://lxd.readthedocs.io/en/latest/instances/#keyvalue-configuration
256
+
239
257
  ## Hacking
240
258
 
241
259
  To run Vagrant with the plugin automatically loaded, you can use the
@@ -95,6 +95,24 @@ module VagrantLXD
95
95
  end
96
96
  end
97
97
 
98
+ #
99
+ # Remove all files from the provider's data directory.
100
+ #
101
+ class RemoveData
102
+ include FileUtils
103
+
104
+ def initialize(app, env)
105
+ @app = app
106
+ end
107
+
108
+ def call(env)
109
+ @app.call(env)
110
+ ensure
111
+ rm_rf(env[:machine].data_dir)
112
+ mkdir_p(env[:machine].data_dir)
113
+ end
114
+ end
115
+
98
116
  #
99
117
  # Issue a warning when the machine wants synced folders but the host
100
118
  # doesn't support it (according to the relevant shadow files).
@@ -125,6 +143,8 @@ module VagrantLXD
125
143
  end
126
144
 
127
145
  class Package
146
+ include FileUtils
147
+
128
148
  def initialize(app, env)
129
149
  @app = app
130
150
  @env = env
@@ -134,7 +154,7 @@ module VagrantLXD
134
154
  env['package.directory'] = env[:machine_package]
135
155
  @app.call(env)
136
156
  ensure
137
- FileUtils.rm_rf(env[:machine_package])
157
+ rm_rf(env[:machine_package])
138
158
  end
139
159
  end
140
160
 
@@ -180,6 +200,7 @@ module VagrantLXD
180
200
  d.use halt
181
201
  d.use Message, :info, 'Destroying machine and associated data...'
182
202
  d.use LXD.action(:destroy)
203
+ d.use RemoveData
183
204
  else
184
205
  d.use Message, :info, 'Machine will not be destroyed.'
185
206
  end
@@ -23,6 +23,7 @@ module VagrantLXD
23
23
  class Provider < Vagrant.plugin('2', :provider)
24
24
  def initialize(machine)
25
25
  @machine = machine
26
+ @driver = Driver.new(machine)
26
27
  end
27
28
 
28
29
  def action(name)
@@ -30,16 +31,14 @@ module VagrantLXD
30
31
  end
31
32
 
32
33
  def state
33
- env = @machine.action('state', lock: false)
34
- state = env[:machine_state]
34
+ state = @driver.state
35
35
  short = state.to_s.gsub('_', ' ')
36
36
  long = I18n.t("vagrant.commands.status.#{state}")
37
37
  Vagrant::MachineState.new(state, short, long)
38
38
  end
39
39
 
40
40
  def ssh_info
41
- env = @machine.action('info', lock: false)
42
- env[:machine_info]
41
+ @driver.info
43
42
  end
44
43
 
45
44
  def to_s
@@ -20,7 +20,7 @@
20
20
  module VagrantLXD
21
21
  module Version
22
22
  NAME = 'vagrant-lxd'
23
- VERSION = '0.5.3'
23
+ VERSION = '0.5.4'
24
24
  DESCRIPTION = 'Vagrant LXD provider'
25
25
  end
26
26
  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.5.3
4
+ version: 0.5.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Evan Hanson
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-10-05 00:00:00.000000000 Z
11
+ date: 2021-09-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport