kitchen-lxd 0.2.0 → 0.2.1

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: bb8e8006b752908610c409c5d138e712fc11472c
4
- data.tar.gz: a62b71d6d1504c16479809006124444918fb901e
3
+ metadata.gz: d8b4b8d0c6bdd0c29cd0017f24ced51347c69e47
4
+ data.tar.gz: 51fc54f38b95e6dc5134c819d6fee81f8e336e5c
5
5
  SHA512:
6
- metadata.gz: f0e9d5a7a1fee40803833b21ddd7c4070abb9ad39fc3a152f3c834c94045e1e61f62c2ad0c3b1922877a05cf5028193dd466be668a010d73d82f7bf389a1d60b
7
- data.tar.gz: d46312416e606f2ac76c0d57a2f49f2f5301d85a87cb5bb6307379e40868b1e664fb15dd737699fdab9bcc36ee605dba95292632c55a87b96a4453b4e5ddf8ea
6
+ metadata.gz: 45825e97e2ab9c3290a4d231099a73ebff730ab1fd3a9f0019c12cf244d7a816272b47949ec02ee16f2883f5c2fade9c29880f8211d863db996eeb86bd69889d
7
+ data.tar.gz: 82f62bb46aec07952acd8e5872db76fc0a03b17198421dcb42bcf2768f31b61780eb9014c4a5742b82dfc5cf73dff75988cd29465776a36a2c8e50b04aa2cfd0
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## 0.2.1 (2017-10-13)
2
+
3
+ - Add workaround to Ubuntu hostnamectl bug in LXD (https://bugs.launchpad.net/ubuntu/+source/apparmor/+bug/1575779)
4
+
1
5
  ## 0.2.0 (2017-10-11)
2
6
 
3
7
  - Add LXD transport.
data/README.md CHANGED
@@ -1,6 +1,7 @@
1
1
  # Kitchen::Lxd
2
2
 
3
- [![Build Status](https://travis-ci.org/zeroturnaround/kitchen-lxd.svg?branch=master)](https://travis-ci.org/zeroturnaround/kitchen-lxd)
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 # this is default
48
- network: lxdbr0 # this is default
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: lxd
61
+ driver:
62
+ name: lxd
59
63
 
60
- transport: lxd
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
 
@@ -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 = Lxd::Container.new( logger, config ) if @container.nil?
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
- # http://www.apache.org/licenses/LICENSE-2.0
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 < Kitchen::Driver::Base
21
+ class Lxd
24
22
  # Version string for Lxd Kitchen driver
25
- VERSION = '0.2.0'
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.0
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 00:00:00.000000000 Z
11
+ date: 2017-10-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: test-kitchen