vagrant-lxc 1.2.3 → 1.2.4
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/CHANGELOG.md +26 -0
- data/Gemfile.lock +1 -1
- data/README.md +1 -1
- data/lib/vagrant-lxc/command/sudoers.rb +7 -3
- data/lib/vagrant-lxc/errors.rb +9 -0
- data/lib/vagrant-lxc/provider.rb +1 -7
- data/lib/vagrant-lxc/sudo_wrapper.rb +19 -6
- data/lib/vagrant-lxc/version.rb +1 -1
- data/lib/vagrant-lxc.rb +8 -0
- data/locales/en.yml +3 -0
- data/scripts/lxc-template +7 -10
- data/templates/sudoers.rb.erb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: be12d8c8e72a9909dec8bf1a588338dcba483bbc
|
4
|
+
data.tar.gz: 4331cfda3e8612bf69e4090c383967508387acb6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 48107a2da8b24576f1af4999374f96819441332de0fffeed7602554347aed266a4f15e0f3d07e821b16fb54eb3d888b1556cd2db32ecfda3416415e00191fde0
|
7
|
+
data.tar.gz: 7e40658d9a437855025e71b57c9ee82f25e532cc439410763adaa312c5abf2852571552159bd183cedfde9c92bf7e95a496fc602fa0ac9449fcc5c012c3875de
|
data/CHANGELOG.md
CHANGED
@@ -1,19 +1,44 @@
|
|
1
|
+
## [1.2.4](https://github.com/fgrehm/vagrant-lxc/compare/v1.2.3...v1.2.4) (Dec 20, 2017)
|
2
|
+
|
3
|
+
BUGFIX:
|
4
|
+
- Support alternative `lxcpath` [[GH-413]]
|
5
|
+
- Update `pipework` regexp in sudo wrapper for Vagrant 1.9+ [[GH-438]]
|
6
|
+
- Work around restrictive `umask` values [[GH-435]]
|
7
|
+
- Make `--config` in `lxc-template` optional [[GH-421]]
|
8
|
+
- Fix sudo wrapper binpath construction logic [[GH-410]]
|
9
|
+
- Fix bug causing CTRL-C on `vagrant up` to destroy the VM [[GH-449]]
|
10
|
+
|
11
|
+
[GH-413]: https://github.com/fgrehm/vagrant-lxc/pull/413
|
12
|
+
[GH-438]: https://github.com/fgrehm/vagrant-lxc/pull/438
|
13
|
+
[GH-435]: https://github.com/fgrehm/vagrant-lxc/pull/435
|
14
|
+
[GH-421]: https://github.com/fgrehm/vagrant-lxc/pull/421
|
15
|
+
[GH-410]: https://github.com/fgrehm/vagrant-lxc/pull/410
|
16
|
+
[GH-449]: https://github.com/fgrehm/vagrant-lxc/pull/449
|
17
|
+
|
1
18
|
## [1.2.3](https://github.com/fgrehm/vagrant-lxc/compare/v1.2.2...v1.2.3) (Dec 20, 2016)
|
2
19
|
|
3
20
|
- Fix bug in Gemfile.lock
|
4
21
|
|
5
22
|
## [1.2.2](https://github.com/fgrehm/vagrant-lxc/compare/v1.2.1...v1.2.2) (Dec 20, 2016)
|
6
23
|
|
24
|
+
BUGFIX:
|
7
25
|
- Make the timeout for fetching container IP's configurable [[GH-426]]
|
8
26
|
- Load locale file only once [[GH-423]]
|
9
27
|
- Preserve xattrs in container filesystems [[GH-411]]
|
10
28
|
- Forward port latest pipework script [[GH-408]]
|
11
29
|
- Fix handling of non-fatal lxc-stop return code [[GH-405]]
|
12
30
|
|
31
|
+
[GH-426]: https://github.com/fgrehm/vagrant-lxc/pull/426
|
32
|
+
[GH-423]: https://github.com/fgrehm/vagrant-lxc/pull/423
|
33
|
+
[GH-411]: https://github.com/fgrehm/vagrant-lxc/pull/411
|
34
|
+
[GH-408]: https://github.com/fgrehm/vagrant-lxc/pull/408
|
35
|
+
[GH-405]: https://github.com/fgrehm/vagrant-lxc/pull/405
|
36
|
+
|
13
37
|
## [1.2.1](https://github.com/fgrehm/vagrant-lxc/compare/v1.2.0...v1.2.1) (Sep 24, 2015)
|
14
38
|
|
15
39
|
BUGFIX:
|
16
40
|
- Fix sudo Wrapper [[GH-393]]
|
41
|
+
|
17
42
|
[GH-393]: https://github.com/fgrehm/vagrant-lxc/pull/393
|
18
43
|
|
19
44
|
## [1.2.0](https://github.com/fgrehm/vagrant-lxc/compare/v1.1.0...v1.2.0) (Sep 15, 2015)
|
@@ -31,6 +56,7 @@ IMPROVEMENTS:
|
|
31
56
|
- Fix shebangs to be more portable [[GH-376]]
|
32
57
|
- Fix removal of lxcbr0/virbr0 when using private networking [[GH-383]]
|
33
58
|
- Improve /tmp handling by using tmpfs [[GH-362]]
|
59
|
+
|
34
60
|
[GH-301]: https://github.com/fgrehm/vagrant-lxc/issues/301
|
35
61
|
[GH-355]: https://github.com/fgrehm/vagrant-lxc/pull/355
|
36
62
|
[GH-357]: https://github.com/fgrehm/vagrant-lxc/pull/357
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -18,7 +18,7 @@ to see it in action.
|
|
18
18
|
## Requirements
|
19
19
|
|
20
20
|
* [Vagrant 1.5+](http://www.vagrantup.com/downloads.html) (tested with 1.7.2)
|
21
|
-
* lxc 0.7.5
|
21
|
+
* lxc >=0.7.5 and <2.1.0 (see [#445](https://github.com/fgrehm/vagrant-lxc/issues/445))
|
22
22
|
* tar 1.27 (the lxc-template script uses the --xattrs option)
|
23
23
|
* `redir` (if you are planning to use port forwarding)
|
24
24
|
* `brctl` (if you are planning to use private networks, on Ubuntu this means `apt-get install bridge-utils`)
|
@@ -1,5 +1,7 @@
|
|
1
1
|
require 'tempfile'
|
2
2
|
|
3
|
+
require "vagrant-lxc/driver"
|
4
|
+
|
3
5
|
module Vagrant
|
4
6
|
module LXC
|
5
7
|
module Command
|
@@ -43,12 +45,14 @@ module Vagrant
|
|
43
45
|
|
44
46
|
# This requires vagrant 1.5.2+ https://github.com/mitchellh/vagrant/commit/3371c3716278071680af9b526ba19235c79c64cb
|
45
47
|
def create_wrapper!
|
48
|
+
lxc_base_path = Driver.new(0, LXC.sudo_wrapper).containers_path
|
46
49
|
wrapper = Tempfile.new('lxc-wrapper').tap do |file|
|
47
50
|
template = Vagrant::Util::TemplateRenderer.new(
|
48
51
|
'sudoers.rb',
|
49
52
|
:template_root => Vagrant::LXC.source_root.join('templates').to_s,
|
50
53
|
:cmd_paths => build_cmd_paths_hash,
|
51
|
-
:
|
54
|
+
:lxc_base_path => lxc_base_path,
|
55
|
+
:pipework_regex => "#{ENV['HOME']}/\.vagrant\.d/gems/(?:\\d+?\\.\\d+?\\.\\d+?/)?gems/vagrant-lxc.+/scripts/pipework"
|
52
56
|
)
|
53
57
|
file.puts template.render
|
54
58
|
end
|
@@ -80,9 +84,9 @@ module Vagrant
|
|
80
84
|
def build_cmd_paths_hash
|
81
85
|
{}.tap do |hash|
|
82
86
|
%w( which cat mkdir cp chown chmod rm tar chown ip ifconfig brctl ).each do |cmd|
|
83
|
-
hash[cmd] = `which #{cmd}`.strip
|
87
|
+
hash[cmd] = `sudo which #{cmd}`.strip
|
84
88
|
end
|
85
|
-
hash['lxc_bin'] = Pathname(`which lxc-create`.strip).parent.to_s
|
89
|
+
hash['lxc_bin'] = Pathname(`sudo which lxc-create`.strip).parent.to_s
|
86
90
|
hash['ruby'] = Gem.ruby
|
87
91
|
end
|
88
92
|
end
|
data/lib/vagrant-lxc/errors.rb
CHANGED
@@ -16,6 +16,15 @@ module Vagrant
|
|
16
16
|
end
|
17
17
|
end
|
18
18
|
|
19
|
+
# Raised when user interrupts a subprocess
|
20
|
+
class SubprocessInterruptError < Vagrant::Errors::VagrantError
|
21
|
+
error_key(:lxc_interrupt_error)
|
22
|
+
def initialize(message, *args)
|
23
|
+
super
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
|
19
28
|
class NamespacesNotSupported < Vagrant::Errors::VagrantError
|
20
29
|
end
|
21
30
|
|
data/lib/vagrant-lxc/provider.rb
CHANGED
@@ -2,7 +2,6 @@ require "log4r"
|
|
2
2
|
|
3
3
|
require "vagrant-lxc/action"
|
4
4
|
require "vagrant-lxc/driver"
|
5
|
-
require "vagrant-lxc/sudo_wrapper"
|
6
5
|
|
7
6
|
module Vagrant
|
8
7
|
module LXC
|
@@ -26,12 +25,7 @@ module Vagrant
|
|
26
25
|
end
|
27
26
|
|
28
27
|
def sudo_wrapper
|
29
|
-
@shell ||=
|
30
|
-
wrapper = Pathname.new(LXC.sudo_wrapper_path).exist? &&
|
31
|
-
LXC.sudo_wrapper_path || nil
|
32
|
-
@logger.debug("Found sudo wrapper : #{wrapper}") if wrapper
|
33
|
-
SudoWrapper.new(wrapper)
|
34
|
-
end
|
28
|
+
@shell ||= LXC.sudo_wrapper
|
35
29
|
end
|
36
30
|
|
37
31
|
def ensure_lxc_installed!
|
@@ -13,11 +13,24 @@ module Vagrant
|
|
13
13
|
|
14
14
|
def run(*command)
|
15
15
|
options = command.last.is_a?(Hash) ? command.last : {}
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
16
|
+
|
17
|
+
# Avoid running LXC commands with a restrictive umask.
|
18
|
+
# Otherwise disasters occur, like the container root directory
|
19
|
+
# having permissions `rwxr-x---` which prevents the `vagrant`
|
20
|
+
# user from accessing its own home directory; among other
|
21
|
+
# problems, SSH cannot then read `authorized_keys`!
|
22
|
+
old_mask = File.umask
|
23
|
+
File.umask(old_mask & 022) # allow all `r` and `x` bits
|
24
|
+
|
25
|
+
begin
|
26
|
+
if @wrapper_path && !options[:no_wrapper]
|
27
|
+
command.unshift @wrapper_path
|
28
|
+
execute *(['sudo'] + command)
|
29
|
+
else
|
30
|
+
execute *(['sudo', '/usr/bin/env'] + command)
|
31
|
+
end
|
32
|
+
ensure
|
33
|
+
File.umask(old_mask)
|
21
34
|
end
|
22
35
|
end
|
23
36
|
|
@@ -46,7 +59,7 @@ module Vagrant
|
|
46
59
|
# nicely handled by Vagrant.
|
47
60
|
if r.exit_code != 0
|
48
61
|
if @interrupted
|
49
|
-
|
62
|
+
raise LXC::Errors::SubprocessInterruptError, command.inspect
|
50
63
|
else
|
51
64
|
raise LXC::Errors::ExecuteError,
|
52
65
|
command: command.inspect, stderr: r.stderr, stdout: r.stdout, exitcode: r.exit_code
|
data/lib/vagrant-lxc/version.rb
CHANGED
data/lib/vagrant-lxc.rb
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
require "vagrant-lxc/version"
|
2
2
|
require "vagrant-lxc/plugin"
|
3
|
+
require "vagrant-lxc/sudo_wrapper"
|
3
4
|
|
4
5
|
module Vagrant
|
5
6
|
module LXC
|
@@ -10,5 +11,12 @@ module Vagrant
|
|
10
11
|
def self.sudo_wrapper_path
|
11
12
|
"/usr/local/bin/vagrant-lxc-wrapper"
|
12
13
|
end
|
14
|
+
|
15
|
+
def self.sudo_wrapper
|
16
|
+
wrapper = Pathname.new(sudo_wrapper_path).exist? &&
|
17
|
+
sudo_wrapper_path || nil
|
18
|
+
SudoWrapper.new(wrapper)
|
19
|
+
end
|
20
|
+
|
13
21
|
end
|
14
22
|
end
|
data/locales/en.yml
CHANGED
data/scripts/lxc-template
CHANGED
@@ -96,11 +96,6 @@ if [ -z "${LXC_PATH}" ]; then
|
|
96
96
|
exit 1
|
97
97
|
fi
|
98
98
|
|
99
|
-
if [ -z "${LXC_CONFIG}" ]; then
|
100
|
-
echo "'config' parameter is required"
|
101
|
-
exit 1
|
102
|
-
fi
|
103
|
-
|
104
99
|
# if $LXC_ROOTFS exists here, it was passed in with --rootfs
|
105
100
|
if [ -z "${LXC_ROOTFS}" ]; then
|
106
101
|
config=${LXC_PATH}/config
|
@@ -160,11 +155,13 @@ if [ -e "${LXC_PATH}/config-network" ]; then
|
|
160
155
|
rm ${LXC_PATH}/config-network
|
161
156
|
fi
|
162
157
|
|
163
|
-
|
164
|
-
|
165
|
-
echo "
|
166
|
-
echo "
|
167
|
-
|
158
|
+
if [ -n "${LXC_CONFIG}" ]; then
|
159
|
+
## Append the defaults
|
160
|
+
echo "" >> ${LXC_PATH}/config
|
161
|
+
echo "##############################################" >> ${LXC_PATH}/config
|
162
|
+
echo "# vagrant-lxc base box specific configuration" >> ${LXC_PATH}/config
|
163
|
+
cat ${LXC_CONFIG} >> ${LXC_PATH}/config
|
164
|
+
fi
|
168
165
|
|
169
166
|
# Empty section for lxc.customize calls from vagrantfile
|
170
167
|
echo "" >> ${LXC_PATH}/config
|
data/templates/sudoers.rb.erb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vagrant-lxc
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.
|
4
|
+
version: 1.2.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Fabio Rehm
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-12-20 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Linux Containers provider for Vagrant
|
14
14
|
email:
|
@@ -101,7 +101,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
101
101
|
version: '0'
|
102
102
|
requirements: []
|
103
103
|
rubyforge_project:
|
104
|
-
rubygems_version: 2.
|
104
|
+
rubygems_version: 2.6.14
|
105
105
|
signing_key:
|
106
106
|
specification_version: 4
|
107
107
|
summary: Linux Containers provider for Vagrant
|