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 +4 -4
- data/.gitlab-ci.yml +2 -1
- data/Gemfile +1 -1
- data/Gemfile.lock +43 -56
- data/README.md +18 -0
- data/lib/vagrant-lxd/action.rb +22 -1
- data/lib/vagrant-lxd/provider.rb +3 -4
- data/lib/vagrant-lxd/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 06befa3b329e3326a09931a8b2a9697fd7f30c25d95935382eaa14fc71f55667
|
4
|
+
data.tar.gz: ed9cea092231c528d359a629b69b4c3ff847098c1e26706886a9d686df6d02b6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ed5232a956aed40892dfc03e072e42a9292ad08f24e2ea5b5a720697aad947714f7a5b6d1073e8aee5b17e21445394b1f193f6e9f23ad1ea381a3b9a7d066979
|
7
|
+
data.tar.gz: a282394ec033c9b5ca9ba5706b8d288dfb19fa6ff6d492aa06170062cf83d7eff3984d03003fec9ebdc0a00cd0ea91554e0050fce22da96d96fe0ca9acaafebb
|
data/.gitlab-ci.yml
CHANGED
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,25 +1,24 @@
|
|
1
1
|
GIT
|
2
2
|
remote: https://github.com/mitchellh/vagrant.git
|
3
|
-
revision:
|
3
|
+
revision: 9247e07fc8ffe2fdb91c6422bbb133a25983fe15
|
4
|
+
tag: v2.2.15
|
4
5
|
specs:
|
5
|
-
vagrant (2.2.
|
6
|
-
bcrypt_pbkdf (~> 1.
|
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.
|
13
|
+
listen (~> 3.4)
|
13
14
|
log4r (~> 1.1.9, < 1.1.11)
|
14
|
-
mime (~>
|
15
|
+
mime-types (~> 3.3)
|
15
16
|
net-scp (~> 1.2.0)
|
16
17
|
net-sftp (~> 3.0)
|
17
|
-
net-ssh (
|
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 (~>
|
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.
|
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.
|
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.
|
43
|
+
addressable (2.8.0)
|
45
44
|
public_suffix (>= 2.0.2, < 5.0)
|
46
|
-
bcrypt_pbkdf (1.0
|
45
|
+
bcrypt_pbkdf (1.1.0)
|
47
46
|
builder (3.2.4)
|
48
47
|
childprocess (4.0.0)
|
49
|
-
concurrent-ruby (1.1.
|
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.
|
55
|
-
|
56
|
-
|
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.
|
59
|
-
gssapi (1.3.
|
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.
|
66
|
+
i18n (1.8.10)
|
71
67
|
concurrent-ruby (~> 1.0)
|
72
|
-
listen (3.
|
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.
|
84
|
-
minitest (5.14.
|
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.
|
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
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
rspec (3.
|
106
|
-
rspec-
|
107
|
-
|
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.
|
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.
|
107
|
+
rspec-mocks (3.10.2)
|
118
108
|
diff-lcs (>= 1.2.0, < 2.0)
|
119
|
-
rspec-support (~> 3.
|
120
|
-
rspec-support (3.
|
121
|
-
|
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.
|
117
|
+
tzinfo (1.2.9)
|
129
118
|
thread_safe (~> 0.1)
|
130
|
-
|
131
|
-
|
132
|
-
|
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.
|
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.
|
145
|
-
winrm-elevated (1.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
|
data/lib/vagrant-lxd/action.rb
CHANGED
@@ -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
|
-
|
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
|
data/lib/vagrant-lxd/provider.rb
CHANGED
@@ -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
|
-
|
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
|
-
|
42
|
-
env[:machine_info]
|
41
|
+
@driver.info
|
43
42
|
end
|
44
43
|
|
45
44
|
def to_s
|
data/lib/vagrant-lxd/version.rb
CHANGED
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.
|
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:
|
11
|
+
date: 2021-09-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|