kitchen-gogetkitchen 0.3.0 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +31 -21
- data/lib/kitchen/driver/gogetkitchen.rb +32 -7
- data/lib/kitchen/driver/gogetkitchen_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: c8fc862c8ed788875141bce93f430c7d2f9eb4b4a930fdbdde7458e27d0862da
|
4
|
+
data.tar.gz: 7a12b10d7eee2d8314d2804a3521df7bd68d1d41fea5a3eb2b2a05d42fb39dbe
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1a1488d72243c55e80c40adf2a75622d9b29b50922de6a0701b5bd0ea5810d73740ee741c4cfd239f9fd42396db4091f636dc5fbedd2bb8ad94b24beaa394194
|
7
|
+
data.tar.gz: 585d83701bdbcd782b16321e04d68d259c3e10a6edb2b952dca51f6dbfda4a9ef9ca303f0eda428185843f02d0ac511144d36d3633e51e630dd96158a5e55180
|
data/README.md
CHANGED
@@ -19,7 +19,7 @@ $ gem install kitchen-gogetkitchen
|
|
19
19
|
|
20
20
|
```
|
21
21
|
## <a name="config"></a> Configuration
|
22
|
-
|
22
|
+
For lxd provider
|
23
23
|
```yaml
|
24
24
|
|
25
25
|
---
|
@@ -39,12 +39,32 @@ platforms:
|
|
39
39
|
template: default
|
40
40
|
options:
|
41
41
|
maas-on-lxc: true
|
42
|
+
|
43
|
+
suites:
|
44
|
+
- name: default
|
45
|
+
run_list:
|
46
|
+
- recipe[all_nodes::default]
|
47
|
+
attributes:
|
48
|
+
|
49
|
+
```
|
50
|
+
|
51
|
+
For kvm(libvirt) provider
|
52
|
+
```yaml
|
53
|
+
|
54
|
+
---
|
55
|
+
driver:
|
56
|
+
name: gogetkitchen
|
57
|
+
|
58
|
+
provisioner:
|
59
|
+
name: chef_zero
|
60
|
+
|
61
|
+
transport:
|
62
|
+
ssh_key: <%= Dir.home + '/.ssh/id_rsa' %>
|
63
|
+
|
64
|
+
platforms:
|
42
65
|
- name: kvm01
|
43
66
|
driver:
|
44
|
-
provider:
|
45
|
-
template: default
|
46
|
-
options:
|
47
|
-
lxd-in-lxd: true
|
67
|
+
provider: kvm
|
48
68
|
|
49
69
|
suites:
|
50
70
|
- name: default
|
@@ -53,6 +73,12 @@ suites:
|
|
53
73
|
attributes:
|
54
74
|
|
55
75
|
```
|
76
|
+
## Provider specific behaviors
|
77
|
+
For KVM(Libvirt)
|
78
|
+
- It will always use `deploy`/`release` pair once `create`d.
|
79
|
+
For LXD
|
80
|
+
- It is able to convey `options` which Gogetit LXD provider comsumes.
|
81
|
+
|
56
82
|
|
57
83
|
## <a name="Uninstall"></a> Uninstall
|
58
84
|
|
@@ -64,22 +90,6 @@ gem uninstall kitchen-gogetkitchen gogetit maas-client
|
|
64
90
|
|
65
91
|
```
|
66
92
|
|
67
|
-
### <a name="config-require-chef-omnibus"></a> require\_chef\_omnibus
|
68
|
-
|
69
|
-
Determines whether or not a Chef [Omnibus package][chef_omnibus_dl] will be
|
70
|
-
installed. There are several different behaviors available:
|
71
|
-
|
72
|
-
* `true` - the latest release will be installed. Subsequent converges
|
73
|
-
will skip re-installing if chef is present.
|
74
|
-
* `latest` - the latest release will be installed. Subsequent converges
|
75
|
-
will always re-install even if chef is present.
|
76
|
-
* `<VERSION_STRING>` (ex: `10.24.0`) - the desired version string will
|
77
|
-
be passed the the install.sh script. Subsequent converges will skip if
|
78
|
-
the installed version and the desired version match.
|
79
|
-
* `false` or `nil` - no chef is installed.
|
80
|
-
|
81
|
-
The default value is unset, or `nil`.
|
82
|
-
|
83
93
|
## <a name="development"></a> Development
|
84
94
|
|
85
95
|
* Source hosted at [GitHub][repo]
|
@@ -38,10 +38,29 @@ module Kitchen
|
|
38
38
|
Gogetit.config[:consumer] = 'kitchen'
|
39
39
|
|
40
40
|
def create(state)
|
41
|
-
options = {
|
42
|
-
|
41
|
+
options = {}
|
42
|
+
|
43
|
+
# for LXD
|
44
|
+
options['alias'] = config[:template] if config[:template]
|
45
|
+
|
46
|
+
# to receive new other options
|
47
|
+
options.merge!(config[:options]) if config[:options]
|
48
|
+
|
43
49
|
provider = choose_provider(config[:provider])
|
44
|
-
|
50
|
+
|
51
|
+
case provider
|
52
|
+
when Gogetit::GogetLibvirt
|
53
|
+
|
54
|
+
if Gogetit.maas.machine_exists?(instance.name)
|
55
|
+
result = provider.deploy(instance.name, options)
|
56
|
+
else
|
57
|
+
result = provider.create(instance.name, options)
|
58
|
+
end
|
59
|
+
|
60
|
+
when Gogetit::GogetLXD
|
61
|
+
result = provider.create(instance.name, options)
|
62
|
+
end
|
63
|
+
|
45
64
|
domain = Gogetit.maas.get_domain
|
46
65
|
state[:hostname] = instance.name + '.' + domain
|
47
66
|
state[:username] = result[:info][:default_user]
|
@@ -55,10 +74,14 @@ module Kitchen
|
|
55
74
|
end
|
56
75
|
|
57
76
|
def destroy(state)
|
58
|
-
options = {}
|
59
|
-
options.merge!(config[:options])
|
60
77
|
provider = choose_provider(config[:provider])
|
61
|
-
|
78
|
+
|
79
|
+
case provider
|
80
|
+
when Gogetit::GogetLibvirt
|
81
|
+
provider.release(instance.name)
|
82
|
+
when Gogetit::GogetLXD
|
83
|
+
provider.destroy(instance.name)
|
84
|
+
end
|
62
85
|
|
63
86
|
instance.transport.connection(state).close
|
64
87
|
end
|
@@ -67,7 +90,9 @@ module Kitchen
|
|
67
90
|
case provider
|
68
91
|
when 'lxd'
|
69
92
|
Gogetit.lxd
|
70
|
-
when '
|
93
|
+
when 'kvm'
|
94
|
+
# kvm externally but libvirt internally
|
95
|
+
# because gogetit actually handles libvirtd
|
71
96
|
Gogetit.libvirt
|
72
97
|
end
|
73
98
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: kitchen-gogetkitchen
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Don Draper
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-07-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: test-kitchen
|