kitchen-nodes 0.2.0.dev.4 → 0.2.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 +68 -5
- data/lib/kitchen/provisioner/nodes_version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: da461052591bdff16f395e67bd2bd645a934b544
|
4
|
+
data.tar.gz: 4c57d3985ade375441b74038979db4fdda240431
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c2c09cfb781316b8859b0cce26d83ed276013a9ddc019cea39b822eb96626c97444eac548495d924f3f054d6f0a7ce276a1f3b3f618ac63934fc1d6eb20c4595
|
7
|
+
data.tar.gz: c6f3d25e203197b2ee709232181f05e4983047c47454d115f1641bbbe289937acc550d42407a4b5603b8dfc0a26c7edf337df0fe5d17e4a8f292f127133208a3
|
data/README.md
CHANGED
@@ -2,18 +2,81 @@
|
|
2
2
|
|
3
3
|
A Test Kitchen Provisioner that generates searchable Nodes.
|
4
4
|
|
5
|
+
The nodes provisioner extends the `chef-zero` provisioner along with all of its functionality and configuration. `chef-zero` can support chef searches by querying against node data stored in json files inside of the kitchen `nodes` folder. The `kitchen-nodes` plugin automatically generates a node file when a test instance is provisioned by test-kitchen.
|
6
|
+
|
7
|
+
### Example nodes:
|
8
|
+
|
9
|
+
```
|
10
|
+
{
|
11
|
+
"id": "server-community-ubuntu-1204",
|
12
|
+
"automatic": {
|
13
|
+
"ipaddress": "172.17.0.8",
|
14
|
+
"platform": "ubuntu"
|
15
|
+
},
|
16
|
+
"run_list": [
|
17
|
+
"recipe[apt]",
|
18
|
+
"recipe[couchbase-tests::ipaddress]",
|
19
|
+
"recipe[couchbase::server]",
|
20
|
+
"recipe[export-node]"
|
21
|
+
]
|
22
|
+
}
|
23
|
+
|
24
|
+
{
|
25
|
+
"id": "second-node-ubuntu-1204",
|
26
|
+
"automatic": {
|
27
|
+
"ipaddress": "172.17.0.9",
|
28
|
+
"platform": "ubuntu"
|
29
|
+
},
|
30
|
+
"run_list": [
|
31
|
+
"recipe[apt]",
|
32
|
+
"recipe[couchbase-tests::ipaddress]",
|
33
|
+
"recipe[couchbase-tests::default]",
|
34
|
+
"recipe[export-node]"
|
35
|
+
]
|
36
|
+
}
|
37
|
+
```
|
38
|
+
|
5
39
|
## <a name="installation"></a> Installation and Setup
|
6
40
|
|
7
41
|
Please read the [Driver usage][driver_usage] page for more details.
|
8
42
|
|
9
43
|
## <a name="config"></a> Configuration
|
10
44
|
|
45
|
+
Use `nodes` instead of `chef-zero` for the kitchen provisioner name.
|
46
|
+
|
11
47
|
```
|
12
48
|
provisioner:
|
13
49
|
name: nodes
|
14
50
|
```
|
15
51
|
|
16
|
-
|
52
|
+
## <a name="installation"></a> Usage
|
53
|
+
|
54
|
+
Using `kitchen-nodes` one can expect all previously converged nodes to be represented in a node file and be searchable. For example consider this scenario looking for a primary node in a cluster in order to add a node to join:
|
55
|
+
|
56
|
+
```
|
57
|
+
require 'timeout'
|
58
|
+
|
59
|
+
def search_for_nodes(query, timeout = 120)
|
60
|
+
nodes = []
|
61
|
+
Timeout::timeout(timeout) do
|
62
|
+
nodes = search(:node, query)
|
63
|
+
until nodes.count > 0 && nodes[0].has_key?('ipaddress')
|
64
|
+
sleep 5
|
65
|
+
nodes = search(:node, query)
|
66
|
+
end
|
67
|
+
end
|
68
|
+
|
69
|
+
if nodes.count == 0 || !nodes[0].has_key?('ipaddress')
|
70
|
+
raise "Unable to find nodes!"
|
71
|
+
end
|
72
|
+
|
73
|
+
nodes
|
74
|
+
end
|
75
|
+
|
76
|
+
primary = search_for_nodes("run_list:*couchbase??server* AND platform:#{node['platform']}")
|
77
|
+
node.normal["couchbase-tests"]["primary_ip"] = primary[0]['ipaddress']
|
78
|
+
|
79
|
+
```
|
17
80
|
|
18
81
|
## <a name="development"></a> Development
|
19
82
|
|
@@ -39,9 +102,9 @@ Created and maintained by [Matt Wrock][author] (<matt@mattwrock.com>)
|
|
39
102
|
Apache 2.0 (see [LICENSE][license])
|
40
103
|
|
41
104
|
|
42
|
-
[author]: https://github.com/
|
43
|
-
[issues]: https://github.com/
|
44
|
-
[license]: https://github.com/
|
45
|
-
[repo]: https://github.com/
|
105
|
+
[author]: https://github.com/mwrock
|
106
|
+
[issues]: https://github.com/mwrock/kitchen-nodes/issues
|
107
|
+
[license]: https://github.com/mwrock/kitchen-nodes/blob/master/LICENSE
|
108
|
+
[repo]: https://github.com/mwrock/kitchen-nodes
|
46
109
|
[driver_usage]: http://docs.kitchen-ci.org/drivers/usage
|
47
110
|
[chef_omnibus_dl]: http://www.getchef.com/chef/install/
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: kitchen-nodes
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.0
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Matt Wrock
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-04-
|
11
|
+
date: 2015-04-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: net-ping
|
@@ -144,9 +144,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
144
144
|
version: '0'
|
145
145
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
146
146
|
requirements:
|
147
|
-
- - "
|
147
|
+
- - ">="
|
148
148
|
- !ruby/object:Gem::Version
|
149
|
-
version:
|
149
|
+
version: '0'
|
150
150
|
requirements: []
|
151
151
|
rubyforge_project:
|
152
152
|
rubygems_version: 2.4.1
|