kitchen-lxd 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/README.md +16 -9
- data/lib/kitchen/driver/lxd.rb +3 -2
- data/lib/kitchen/driver/lxd/container.rb +7 -0
- data/lib/kitchen/driver/version.rb +3 -5
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d8b4b8d0c6bdd0c29cd0017f24ced51347c69e47
|
4
|
+
data.tar.gz: 51fc54f38b95e6dc5134c819d6fee81f8e336e5c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 45825e97e2ab9c3290a4d231099a73ebff730ab1fd3a9f0019c12cf244d7a816272b47949ec02ee16f2883f5c2fade9c29880f8211d863db996eeb86bd69889d
|
7
|
+
data.tar.gz: 82f62bb46aec07952acd8e5872db76fc0a03b17198421dcb42bcf2768f31b61780eb9014c4a5742b82dfc5cf73dff75988cd29465776a36a2c8e50b04aa2cfd0
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
# Kitchen::Lxd
|
2
2
|
|
3
|
-
[![Build Status](https://travis-ci.org/
|
3
|
+
[![Build Status](https://travis-ci.org/DracoAter/kitchen-lxd.svg?branch=master)](https://travis-ci.org/DracoAter/kitchen-lxd)
|
4
|
+
[![Gem Version](https://badge.fury.io/rb/kitchen-lxd.svg)](https://badge.fury.io/rb/kitchen-lxd)
|
4
5
|
|
5
6
|
- [Requirements](#requirements)
|
6
7
|
- [Lxd](#lxd)
|
@@ -44,8 +45,10 @@ Example config file may look like this:
|
|
44
45
|
driver:
|
45
46
|
name: lxd
|
46
47
|
binary: lxc # this is default
|
47
|
-
remote: images #
|
48
|
-
network: lxdbr0 #
|
48
|
+
remote: images # default
|
49
|
+
network: lxdbr0 # default
|
50
|
+
fix_chef_install: false # default
|
51
|
+
fix_hostnamectl_bug: true # default
|
49
52
|
|
50
53
|
transport:
|
51
54
|
name: lxd
|
@@ -55,9 +58,11 @@ Default values can be omitted, so the minimal config file looks like this:
|
|
55
58
|
|
56
59
|
```yaml
|
57
60
|
---
|
58
|
-
driver:
|
61
|
+
driver:
|
62
|
+
name: lxd
|
59
63
|
|
60
|
-
transport:
|
64
|
+
transport:
|
65
|
+
name: lxd
|
61
66
|
```
|
62
67
|
|
63
68
|
### Driver
|
@@ -66,10 +71,12 @@ Available options:
|
|
66
71
|
|
67
72
|
Name | Description | Type | Default
|
68
73
|
-----|-------------|------|--------
|
69
|
-
binary | Path to lxc executable | String | `lxc`
|
70
|
-
remote | Remote LXD server to download image from, if it does not exist locally | String | `images`
|
71
|
-
network | Network bridge to attach to container | String | `lxdbr0`
|
72
|
-
wait_until_ready | Wait for the network to come up | Boolean | `true`
|
74
|
+
binary | Path to lxc executable. | String | `lxc`
|
75
|
+
remote | Remote LXD server to download image from, if it does not exist locally. | String | `images`
|
76
|
+
network | Network bridge to attach to container. | String | `lxdbr0`
|
77
|
+
wait_until_ready | Wait for the network to come up. | Boolean | `true`
|
78
|
+
fix_chef_install | Apply fix, to make available installation of Chef Omnibus package. | Boolean | `false`
|
79
|
+
fix_hostnamectl_bug | Apply workaround to Ubuntu [hostnamectl bug](https://bugs.launchpad.net/ubuntu/+source/apparmor/+bug/1575779) in LXD. | Boolean | `true`
|
73
80
|
|
74
81
|
## Development
|
75
82
|
|
data/lib/kitchen/driver/lxd.rb
CHANGED
@@ -34,6 +34,7 @@ module Kitchen
|
|
34
34
|
default_config :network, 'lxdbr0'
|
35
35
|
default_config :wait_until_ready, true
|
36
36
|
default_config :fix_chef_install, false
|
37
|
+
default_config :fix_hostnamectl_bug, true # https://bugs.launchpad.net/ubuntu/+source/apparmor/+bug/1575779
|
37
38
|
|
38
39
|
default_config :image do |driver|
|
39
40
|
driver.instance.platform.name
|
@@ -50,6 +51,7 @@ module Kitchen
|
|
50
51
|
|
51
52
|
state[:hostname] = instance.transport.connection( state ).wait_until_ready if config[:wait_until_ready]
|
52
53
|
container.fix_chef_install( instance.platform.name ) if config[:fix_chef_install]
|
54
|
+
container.fix_hostnamectl_bug if config[:fix_hostnamectl_bug]
|
53
55
|
end
|
54
56
|
|
55
57
|
def destroy( state )
|
@@ -68,8 +70,7 @@ module Kitchen
|
|
68
70
|
end
|
69
71
|
|
70
72
|
def container
|
71
|
-
@container
|
72
|
-
@container
|
73
|
+
@container ||= Lxd::Container.new( logger, config )
|
73
74
|
end
|
74
75
|
end
|
75
76
|
end
|
@@ -98,6 +98,13 @@ module Kitchen
|
|
98
98
|
execute 'yum install -y sudo wget'
|
99
99
|
end
|
100
100
|
end
|
101
|
+
|
102
|
+
def fix_hostnamectl_bug
|
103
|
+
logger.info "Replace /usr/bin/hostnamectl with /usr/bin/true, because of bug in Ubuntu. (https://bugs.launchpad.net/ubuntu/+source/apparmor/+bug/1575779)"
|
104
|
+
execute 'rm /usr/bin/hostnamectl'
|
105
|
+
execute 'ln -s /usr/bin/true /usr/bin/hostnamectl'
|
106
|
+
end
|
107
|
+
|
101
108
|
private
|
102
109
|
|
103
110
|
def image_exists?
|
@@ -8,7 +8,7 @@
|
|
8
8
|
# you may not use this file except in compliance with the License.
|
9
9
|
# You may obtain a copy of the License at
|
10
10
|
#
|
11
|
-
#
|
11
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
12
12
|
#
|
13
13
|
# Unless required by applicable law or agreed to in writing, software
|
14
14
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
@@ -16,13 +16,11 @@
|
|
16
16
|
# See the License for the specific language governing permissions and
|
17
17
|
# limitations under the License.
|
18
18
|
|
19
|
-
require 'kitchen'
|
20
|
-
|
21
19
|
module Kitchen
|
22
20
|
module Driver
|
23
|
-
class Lxd
|
21
|
+
class Lxd
|
24
22
|
# Version string for Lxd Kitchen driver
|
25
|
-
VERSION = '0.2.
|
23
|
+
VERSION = '0.2.1'
|
26
24
|
end
|
27
25
|
end
|
28
26
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: kitchen-lxd
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Juri Timošin
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-10-
|
11
|
+
date: 2017-10-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: test-kitchen
|