kitchen-nodes-lobatoa 0.10.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 9e78d427710e2b14c3204dec652df9ec93fa2d0e06a24280dd65f6b9f65d6301
4
+ data.tar.gz: 7c326435e1478e7558a69b44a69af37077c36fade034f7bee061d8de869e5f0b
5
+ SHA512:
6
+ metadata.gz: 4aad41de45a38e2b5ac8b0b25f23e20689c7567b1d12f27d4dbc3ab0edc09ca8d796a415a86b2a9174a1828241ee575f4cc30b3f420e1f731da748c9797210e7
7
+ data.tar.gz: a045c6be0b2097686c9f69e99ad9e3be4b72eca05cabfab97c25fd820ff7fb583e901200a9caeed3ca5a2a7789c3938aafa9981a58194ed24ea623a4a6a31f5e
@@ -0,0 +1,3 @@
1
+ # Managing line ending conversions
2
+ # See http://git-scm.com/docs/gitattributes#_end-of-line_conversion
3
+ * text eol=lf
@@ -0,0 +1,20 @@
1
+ *.gem
2
+ *.rbc
3
+ .bundle
4
+ .config
5
+ .kitchen/
6
+ .yardoc
7
+ Berksfile.lock
8
+ Gemfile.lock
9
+ InstalledFiles
10
+ _yardoc
11
+ coverage
12
+ doc/
13
+ lib/bundler/man
14
+ pkg
15
+ rdoc
16
+ spec/reports
17
+ test/tmp
18
+ test/version_tmp
19
+ tmp
20
+ test/integration/nodes
@@ -0,0 +1,37 @@
1
+ ---
2
+ driver:
3
+ name: docker
4
+ username: vagrant
5
+ provision_command:
6
+ - usermod -p $(echo vagrant | openssl passwd -1 -stdin) vagrant
7
+ - locale-gen en_US.UTF-8
8
+ - dpkg-reconfigure locales
9
+
10
+ provisioner:
11
+ name: nodes
12
+ roles_path: test/fixtures/roles
13
+ require_chef_omnibus: latest
14
+
15
+ platforms:
16
+ - name: ubuntu-14.04
17
+
18
+ suites:
19
+ - name: node1
20
+ run_list:
21
+ - role[test_json_role]
22
+ - role[test_ruby_role]
23
+ - recipe[node-tests::node1]
24
+ attributes:
25
+ consul:
26
+ config:
27
+ bootstrap_expect: 2
28
+ server: true
29
+
30
+ - name: node2
31
+ run_list:
32
+ - recipe[node-tests::node2]
33
+ attributes:
34
+ consul:
35
+ config:
36
+ bootstrap_expect: 2
37
+ server: true
@@ -0,0 +1,48 @@
1
+ ---
2
+ driver:
3
+ name: vagrant
4
+ network:
5
+ - ["private_network", { type: "dhcp" }]
6
+
7
+ provisioner:
8
+ name: nodes
9
+ roles_path: test/fixtures/roles
10
+
11
+ platforms:
12
+ - name: ubuntu-12.04
13
+ run_list:
14
+ - recipe[apt]
15
+ driver_config:
16
+ box: hashicorp/precise64
17
+
18
+ - name: windows-2016
19
+ driver_config:
20
+ gui: true
21
+ box: mwrock/Windows2016
22
+
23
+ - name: windows-2008R2
24
+ driver_config:
25
+ gui: true
26
+ box: opentable/win-2008r2-datacenter-amd64-nocm
27
+
28
+ suites:
29
+ - name: node1
30
+ run_list:
31
+ - role[test_json_role]
32
+ - role[test_ruby_role]
33
+ - recipe[node-tests::node1]
34
+ attributes:
35
+ consul:
36
+ config:
37
+ bootstrap_expect: 2
38
+ server: true
39
+
40
+ - name: node2
41
+ run_list:
42
+ - recipe[hurry-up-and-test::set_non_nat_vbox_ip]
43
+ - recipe[node-tests::node2]
44
+ attributes:
45
+ consul:
46
+ config:
47
+ bootstrap_expect: 2
48
+ server: true
data/.rspec ADDED
@@ -0,0 +1 @@
1
+ --format documentation
@@ -0,0 +1,9 @@
1
+ Metrics/MethodLength:
2
+ Max: 20
3
+
4
+ Metrics/BlockLength:
5
+ Max: 150
6
+
7
+ AllCops:
8
+ Exclude:
9
+ - '.kitchen/**/*'
@@ -0,0 +1,22 @@
1
+ language: ruby
2
+
3
+ matrix:
4
+ include:
5
+ - rvm: 2.3.1
6
+ - rvm: ruby-head
7
+ - rvm: 2.3.1
8
+ services: docker
9
+ sudo: required
10
+ before_script:
11
+ - sudo iptables -L DOCKER || ( echo "DOCKER iptables chain missing" ; sudo iptables -N DOCKER )
12
+ script:
13
+ - bundle exec kitchen verify
14
+ after_failure:
15
+ - cat .kitchen/logs/kitchen.log
16
+ env:
17
+ - UBUNTU=14.04
18
+ - KITCHEN_YAML=.kitchen.travis.yml
19
+
20
+ branches:
21
+ only:
22
+ - master
@@ -0,0 +1,7 @@
1
+ source 'https://supermarket.chef.io'
2
+
3
+ group :integration do
4
+ cookbook 'apt'
5
+ cookbook 'hurry-up-and-test'
6
+ cookbook 'node-tests', path: './test/integration/cookbooks/node-tests'
7
+ end
@@ -0,0 +1,124 @@
1
+ # Change Log
2
+
3
+ ## [0.9.1](https://github.com/mwrock/kitchen-nodes/tree/0.9.1) (2017-03-19)
4
+ [Full Changelog](https://github.com/mwrock/kitchen-nodes/compare/v0.9.0...0.9.1)
5
+
6
+ **Closed issues:**
7
+
8
+ - Failed to complete \#converge action: \[undefined method `\[\]' for \#\<WinRM::Output:0x4adaab8\>\] [\#32](https://github.com/mwrock/kitchen-nodes/issues/32)
9
+
10
+ **Merged pull requests:**
11
+
12
+ - Fix winrm [\#33](https://github.com/mwrock/kitchen-nodes/pull/33) ([mwrock](https://github.com/mwrock))
13
+
14
+ ## [v0.9.0](https://github.com/mwrock/kitchen-nodes/tree/v0.9.0) (2017-01-13)
15
+ [Full Changelog](https://github.com/mwrock/kitchen-nodes/compare/v0.8.0...v0.9.0)
16
+
17
+ **Closed issues:**
18
+
19
+ - Trouble searching the node [\#23](https://github.com/mwrock/kitchen-nodes/issues/23)
20
+ - Working Example: Nginx Balancer + 2 App Nodes [\#22](https://github.com/mwrock/kitchen-nodes/issues/22)
21
+
22
+ **Merged pull requests:**
23
+
24
+ - Add support for loading roles from .rb and .json [\#31](https://github.com/mwrock/kitchen-nodes/pull/31) ([dullyouth](https://github.com/dullyouth))
25
+
26
+ ## [v0.8.0](https://github.com/mwrock/kitchen-nodes/tree/v0.8.0) (2016-09-24)
27
+ [Full Changelog](https://github.com/mwrock/kitchen-nodes/compare/v0.7.0...v0.8.0)
28
+
29
+ **Closed issues:**
30
+
31
+ - Searching fqdn and ip on windows breaks [\#28](https://github.com/mwrock/kitchen-nodes/issues/28)
32
+ - Nodes returned from search are missing attributes from ohai? [\#24](https://github.com/mwrock/kitchen-nodes/issues/24)
33
+ - policyfile support [\#14](https://github.com/mwrock/kitchen-nodes/issues/14)
34
+
35
+ **Merged pull requests:**
36
+
37
+ - run kitchen tests in travis/docker [\#27](https://github.com/mwrock/kitchen-nodes/pull/27) ([mwrock](https://github.com/mwrock))
38
+ - update rubies in travis [\#26](https://github.com/mwrock/kitchen-nodes/pull/26) ([mwrock](https://github.com/mwrock))
39
+ - Put node object to the "nodes\_path" if defined [\#25](https://github.com/mwrock/kitchen-nodes/pull/25) ([legal90](https://github.com/legal90))
40
+
41
+ ## [v0.7.0](https://github.com/mwrock/kitchen-nodes/tree/v0.7.0) (2016-03-08)
42
+ [Full Changelog](https://github.com/mwrock/kitchen-nodes/compare/v0.6.6...v0.7.0)
43
+
44
+ **Implemented enhancements:**
45
+
46
+ - Added support for windows 2008R2 [\#18](https://github.com/mwrock/kitchen-nodes/pull/18) ([johnsmyth](https://github.com/johnsmyth))
47
+
48
+ **Fixed bugs:**
49
+
50
+ - Fix device filtering breaking for IPv6 interfaces [\#15](https://github.com/mwrock/kitchen-nodes/pull/15) ([vervas](https://github.com/vervas))
51
+
52
+ ## [v0.6.6](https://github.com/mwrock/kitchen-nodes/tree/v0.6.6) (2016-02-12)
53
+ [Full Changelog](https://github.com/mwrock/kitchen-nodes/compare/v0.6.5...v0.6.6)
54
+
55
+ **Fixed bugs:**
56
+
57
+ - kitchen-nodes fails serverspec test on 2012 node due to unpopulated IP address [\#11](https://github.com/mwrock/kitchen-nodes/issues/11)
58
+ - Shave extra newline off fqdn [\#13](https://github.com/mwrock/kitchen-nodes/pull/13) ([watkinsv-hp](https://github.com/watkinsv-hp))
59
+
60
+ ## [v0.6.5](https://github.com/mwrock/kitchen-nodes/tree/v0.6.5) (2016-02-11)
61
+ [Full Changelog](https://github.com/mwrock/kitchen-nodes/compare/v0.6.4...v0.6.5)
62
+
63
+ **Fixed bugs:**
64
+
65
+ - kitchen-nodes provisioner needs kitchen-sync sftp finder [\#10](https://github.com/mwrock/kitchen-nodes/issues/10)
66
+
67
+ ## [v0.6.4](https://github.com/mwrock/kitchen-nodes/tree/v0.6.4) (2016-01-27)
68
+ [Full Changelog](https://github.com/mwrock/kitchen-nodes/compare/v0.6.0...v0.6.4)
69
+
70
+ **Fixed bugs:**
71
+
72
+ - Error: Sandbox directory has not yet been created [\#9](https://github.com/mwrock/kitchen-nodes/issues/9)
73
+
74
+ ## [v0.6.0](https://github.com/mwrock/kitchen-nodes/tree/v0.6.0) (2015-12-14)
75
+ [Full Changelog](https://github.com/mwrock/kitchen-nodes/compare/v0.5.0...v0.6.0)
76
+
77
+ **Implemented enhancements:**
78
+
79
+ - Expand the run\_list into the automatic=\>recipes attribute [\#8](https://github.com/mwrock/kitchen-nodes/pull/8) ([eherot](https://github.com/eherot))
80
+
81
+ ## [v0.5.0](https://github.com/mwrock/kitchen-nodes/tree/v0.5.0) (2015-10-11)
82
+ [Full Changelog](https://github.com/mwrock/kitchen-nodes/compare/v0.4.1...v0.5.0)
83
+
84
+ **Implemented enhancements:**
85
+
86
+ - Feature/adding fqdn [\#7](https://github.com/mwrock/kitchen-nodes/pull/7) ([faja](https://github.com/faja))
87
+
88
+ ## [v0.4.1](https://github.com/mwrock/kitchen-nodes/tree/v0.4.1) (2015-08-14)
89
+ [Full Changelog](https://github.com/mwrock/kitchen-nodes/compare/v0.4.0...v0.4.1)
90
+
91
+ ## [v0.4.0](https://github.com/mwrock/kitchen-nodes/tree/v0.4.0) (2015-08-12)
92
+ [Full Changelog](https://github.com/mwrock/kitchen-nodes/compare/v0.3.4...v0.4.0)
93
+
94
+ ## [v0.3.4](https://github.com/mwrock/kitchen-nodes/tree/v0.3.4) (2015-08-04)
95
+ [Full Changelog](https://github.com/mwrock/kitchen-nodes/compare/v0.3.3...v0.3.4)
96
+
97
+ ## [v0.3.3](https://github.com/mwrock/kitchen-nodes/tree/v0.3.3) (2015-07-30)
98
+ [Full Changelog](https://github.com/mwrock/kitchen-nodes/compare/v0.3.2...v0.3.3)
99
+
100
+ **Implemented enhancements:**
101
+
102
+ - Update IP finder to work for CentOS 7.1 [\#6](https://github.com/mwrock/kitchen-nodes/pull/6) ([joerocklin](https://github.com/joerocklin))
103
+
104
+ ## [v0.3.2](https://github.com/mwrock/kitchen-nodes/tree/v0.3.2) (2015-06-26)
105
+ [Full Changelog](https://github.com/mwrock/kitchen-nodes/compare/v0.3.1...v0.3.2)
106
+
107
+ **Fixed bugs:**
108
+
109
+ - Fix search\(\) for currently provisioned node [\#4](https://github.com/mwrock/kitchen-nodes/pull/4) ([ustuehler](https://github.com/ustuehler))
110
+
111
+ ## [v0.3.1](https://github.com/mwrock/kitchen-nodes/tree/v0.3.1) (2015-05-11)
112
+ [Full Changelog](https://github.com/mwrock/kitchen-nodes/compare/v0.3.0...v0.3.1)
113
+
114
+ ## [v0.3.0](https://github.com/mwrock/kitchen-nodes/tree/v0.3.0) (2015-05-10)
115
+ [Full Changelog](https://github.com/mwrock/kitchen-nodes/compare/v0.2.0...v0.3.0)
116
+
117
+ **Implemented enhancements:**
118
+
119
+ - Include .kitchen.yml attributes to the node file at 'normal' scope. [\#2](https://github.com/mwrock/kitchen-nodes/pull/2) ([jcejohnson](https://github.com/jcejohnson))
120
+
121
+ ## [v0.2.0](https://github.com/mwrock/kitchen-nodes/tree/v0.2.0) (2015-04-21)
122
+
123
+
124
+ \* *This Change Log was automatically generated by [github_changelog_generator](https://github.com/skywinder/Github-Changelog-Generator)*
data/Gemfile ADDED
@@ -0,0 +1,11 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gemspec
4
+
5
+ gem 'berkshelf'
6
+ gem 'chef'
7
+ gem 'kitchen-docker'
8
+ gem 'kitchen-vagrant'
9
+ gem 'pry'
10
+ gem 'rb-readline'
11
+ gem 'winrm-fs', '~> 1.0'
data/LICENSE ADDED
@@ -0,0 +1,15 @@
1
+ Author:: Matt Wrock (<matt@mattwrock.com>)
2
+
3
+ Copyright (C) 2015, Matt Wrock
4
+
5
+ Licensed under the Apache License, Version 2.0 (the "License");
6
+ you may not use this file except in compliance with the License.
7
+ You may obtain a copy of the License at
8
+
9
+ http://www.apache.org/licenses/LICENSE-2.0
10
+
11
+ Unless required by applicable law or agreed to in writing, software
12
+ distributed under the License is distributed on an "AS IS" BASIS,
13
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ See the License for the specific language governing permissions and
15
+ limitations under the License.
@@ -0,0 +1,154 @@
1
+ # <a name="title"></a> Kitchen::Nodes
2
+
3
+ A Test Kitchen Provisioner that generates searchable Nodes.
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
+ "recipes": [
16
+ "apt::default",
17
+ "couchbase-tests::ipaddress",
18
+ "couchbase::server",
19
+ "export-node"
20
+ ]
21
+ },
22
+ "normal": {
23
+ "attr1": "val1"
24
+ }
25
+ "run_list": [
26
+ "recipe[apt]",
27
+ "recipe[couchbase-tests::ipaddress]",
28
+ "recipe[couchbase::server]",
29
+ "recipe[export-node]"
30
+ ]
31
+ }
32
+
33
+ {
34
+ "id": "second-node-ubuntu-1204",
35
+ "automatic": {
36
+ "ipaddress": "172.17.0.9",
37
+ "platform": "ubuntu",
38
+ "recipes": [
39
+ "apt::default",
40
+ "couchbase-tests::ipaddress",
41
+ "couchbase::server",
42
+ "export-node"
43
+ ]
44
+ },
45
+ "run_list": [
46
+ "recipe[apt]",
47
+ "recipe[couchbase-tests::ipaddress]",
48
+ "recipe[couchbase-tests::default]",
49
+ "recipe[export-node]"
50
+ ]
51
+ }
52
+ ```
53
+
54
+ The node data includes the node id based on the test-kitchen suite name, the run list assigned to the node, the normal attributes included in the `.kitchen.yml` file, the externally reachable ip address and the platform of the test instance os.
55
+
56
+ ## <a name="installation"></a> Installation
57
+
58
+ ```
59
+ gem install kitchen-nodes
60
+ ```
61
+
62
+ ## <a name="config"></a> Configuration
63
+
64
+ Use `nodes` instead of `chef-zero` for the kitchen provisioner name.
65
+
66
+ ```
67
+ provisioner:
68
+ name: nodes
69
+ ```
70
+
71
+ ## <a name="Usage"></a> Usage
72
+
73
+ 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:
74
+
75
+ ```
76
+ require 'timeout'
77
+
78
+ def search_for_nodes(query, timeout = 120)
79
+ nodes = []
80
+ Timeout::timeout(timeout) do
81
+ nodes = search(:node, query)
82
+ until nodes.count > 0 && nodes[0].has_key?('ipaddress')
83
+ sleep 5
84
+ nodes = search(:node, query)
85
+ end
86
+ end
87
+
88
+ if nodes.count == 0 || !nodes[0].has_key?('ipaddress')
89
+ raise "Unable to find nodes!"
90
+ end
91
+
92
+ nodes
93
+ end
94
+
95
+ primary = search_for_nodes("run_list:*couchbase??server* AND platform:#{node['platform']}")
96
+ node.normal["couchbase-tests"]["primary_ip"] = primary[0]['ipaddress']
97
+
98
+ ```
99
+ ### <a name="vagrant"></a> Using with Vagrant
100
+
101
+ When using kitchen-nodes with the vagrant driver, make sure you add the following to your `driver_config`:
102
+
103
+ ```
104
+ network:
105
+ - ["private_network", { type: "dhcp" }]
106
+ ```
107
+
108
+ This will add an additional non-NAT NIC to your vagrant box with an IP reachable from the host and other test nodes.
109
+
110
+ ### <a name="virtualbox"></a> Why is my ohai `ipaddress` different from my node ipaddress on vagrant with VirtualBox?
111
+
112
+ Ohai will pick up the localhost ipaddress on vagrant boxes using virtualbox. To reset the `node["ipaddress"]` to the reachable ip, add `hurry-up-and-test::set_non_nat_vbox_ip` to the top of your `run_list`.
113
+
114
+ ```
115
+ suites:
116
+ - name: my-suite
117
+ run_list:
118
+ - recipe[hurry-up-and-test::set_non_nat_vbox_ip]
119
+ - recipe[cookbook-under-test]
120
+ ```
121
+
122
+ You can add this even if you do not use virtualbox and the recipe will do nothing.
123
+
124
+
125
+ ## <a name="development"></a> Development
126
+
127
+ * Source hosted at [GitHub][repo]
128
+ * Report issues/questions/feature requests on [GitHub Issues][issues]
129
+
130
+ Pull requests are very welcome! Make sure your patches are well tested.
131
+ Ideally create a topic branch for every separate change you make. For
132
+ example:
133
+
134
+ 1. Fork the repo
135
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
136
+ 3. Commit your changes (`git commit -am 'Added some feature'`)
137
+ 4. Push to the branch (`git push origin my-new-feature`)
138
+ 5. Create new Pull Request
139
+
140
+ ## <a name="authors"></a> Authors
141
+
142
+ Created and maintained by [Matt Wrock][author] (<matt@mattwrock.com>)
143
+
144
+ ## <a name="license"></a> License
145
+
146
+ Apache 2.0 (see [LICENSE][license])
147
+
148
+
149
+ [author]: https://github.com/mwrock
150
+ [issues]: https://github.com/mwrock/kitchen-nodes/issues
151
+ [license]: https://github.com/mwrock/kitchen-nodes/blob/master/LICENSE
152
+ [repo]: https://github.com/mwrock/kitchen-nodes
153
+ [driver_usage]: http://docs.kitchen-ci.org/drivers/usage
154
+ [chef_omnibus_dl]: http://www.getchef.com/chef/install/