kitchen-chefzero-nodes 1.0.4 → 1.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.kitchen.yml +6 -4
- data/.rubocop.yml +1 -1
- data/Gemfile +1 -1
- data/Rakefile +0 -0
- data/kitchen-chefzero-nodes.gemspec +1 -0
- data/lib/kitchen/provisioner/chef_zero_nodes.rb +6 -1
- data/lib/kitchen/provisioner/chef_zero_nodes_version.rb +2 -1
- data/test/integration/cookbooks/test/recipes/default.rb +11 -0
- data/test/integration/cookbooks/test/recipes/search.rb +6 -4
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ecc7d28a6dc812c44bad750c640d88ef70a1d008
|
4
|
+
data.tar.gz: 12f8e162414f8c9d8feba3b6b47126ebbd1ff31f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 457f10d4baf4807b617ca890373c895c14bfcd9a1138c36eb3ed995c39c267e709df2034b82b789c4ae5d33a52e4ee967a50cf2ffc5980f9ecf944e0d2d2b923
|
7
|
+
data.tar.gz: c34edb45b38b45408717cf9aba9c8971483e13d664aa3a00486c0e38601dc9f53cc9515cfeba6b0ca9b91f9730d3263ff84bd5eef74be43d455fa53b7a48a406
|
data/.kitchen.yml
CHANGED
@@ -1,7 +1,9 @@
|
|
1
1
|
---
|
2
2
|
driver:
|
3
3
|
name: vagrant
|
4
|
-
|
4
|
+
network:
|
5
|
+
private_network:
|
6
|
+
type: dhcp
|
5
7
|
|
6
8
|
provisioner:
|
7
9
|
name: chef_zero_nodes
|
@@ -9,9 +11,9 @@ provisioner:
|
|
9
11
|
policyfile: test/integration/cookbooks/test/Policyfile.rb
|
10
12
|
|
11
13
|
platforms:
|
12
|
-
- name:
|
14
|
+
- name: el7
|
13
15
|
driver:
|
14
|
-
box: bento/centos-
|
16
|
+
box: bento/centos-7.2
|
15
17
|
|
16
18
|
- name: win2012R2
|
17
19
|
driver:
|
@@ -35,7 +37,7 @@ suites:
|
|
35
37
|
provisioner:
|
36
38
|
named_run_list: win
|
37
39
|
excludes:
|
38
|
-
-
|
40
|
+
- el7
|
39
41
|
|
40
42
|
- name: ssh
|
41
43
|
transport:
|
data/.rubocop.yml
CHANGED
data/Gemfile
CHANGED
data/Rakefile
CHANGED
File without changes
|
@@ -1,4 +1,5 @@
|
|
1
1
|
# -*- encoding: utf-8 -*-
|
2
|
+
|
2
3
|
#
|
3
4
|
# Author:: Andrei Skopenko (<andrei@skopenko.net>)
|
4
5
|
#
|
@@ -41,7 +42,7 @@ module Kitchen
|
|
41
42
|
def converge(state)
|
42
43
|
provisioner = instance.provisioner
|
43
44
|
provisioner.create_sandbox
|
44
|
-
sandbox_dirs =
|
45
|
+
sandbox_dirs = Util.list_directory(provisioner.sandbox_path)
|
45
46
|
instance.transport.connection(backcompat_merged_state(state)) do |conn|
|
46
47
|
conn.execute(env_cmd(provisioner.install_command))
|
47
48
|
conn.execute(env_cmd(provisioner.init_command))
|
@@ -161,6 +162,10 @@ module Kitchen
|
|
161
162
|
class ChefZeroNodes < ChefZero
|
162
163
|
# (see ChefZero#create_sandbox)
|
163
164
|
def create_sandbox
|
165
|
+
if config[:nodes_path].nil?
|
166
|
+
info("Provisioner setting 'nodes_path' is not defined! Using 'test/fixtures/nodes' for node objects!")
|
167
|
+
config[:nodes_path] = 'test/fixtures/nodes'
|
168
|
+
end
|
164
169
|
FileUtils.rm(ext_node_file) if File.exist?(ext_node_file)
|
165
170
|
create_chefzero_sandbox
|
166
171
|
end
|
@@ -1,4 +1,5 @@
|
|
1
1
|
# -*- encoding: utf-8 -*-
|
2
|
+
|
2
3
|
#
|
3
4
|
# Author:: Andrei Skopenko (<andrei@skopenko.net>)
|
4
5
|
#
|
@@ -19,6 +20,6 @@
|
|
19
20
|
module Kitchen
|
20
21
|
# Version string for chefzero_nodes Kitchen driver
|
21
22
|
module Provisioner
|
22
|
-
CHEF_ZERO_NODES_VERSION = '1.0.
|
23
|
+
CHEF_ZERO_NODES_VERSION = '1.0.5'.freeze
|
23
24
|
end
|
24
25
|
end
|
@@ -15,3 +15,14 @@
|
|
15
15
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
16
16
|
# See the License for the specific language governing permissions and
|
17
17
|
# limitations under the License.
|
18
|
+
|
19
|
+
interfaces = node['network']['interfaces']
|
20
|
+
interface_key = interfaces.keys.last
|
21
|
+
|
22
|
+
# linux
|
23
|
+
if node['virtualization'] && node['virtualization']['system'] == 'vbox'
|
24
|
+
interfaces[interface_key]['addresses'].each { |ip, params| node.automatic['ipaddress'] = ip if params['family'] == 'inet' }
|
25
|
+
# windows
|
26
|
+
elsif node['kernel'] && node['kernel']['cs_info'] && node['kernel']['cs_info']['model'] == 'VirtualBox'
|
27
|
+
node.automatic['ipaddress'] = interfaces[interface_key]['configuration']['ip_address'][0]
|
28
|
+
end
|
@@ -16,18 +16,20 @@
|
|
16
16
|
# See the License for the specific language governing permissions and
|
17
17
|
# limitations under the License.
|
18
18
|
|
19
|
-
sftp_node = search(:node, "name:sftp-* AND platform:#{node['platform']}")
|
19
|
+
sftp_node = search(:node, "name:sftp-* AND platform:#{node['platform']}").first
|
20
|
+
pp sftp_node['ipaddress']
|
20
21
|
ruby_block 'save sftp attributes' do
|
21
22
|
block do
|
22
23
|
parent = File.join(ENV['TEMP'] || '/tmp', 'kitchen')
|
23
|
-
IO.write(File.join(parent, 'sftp.json'), sftp_node
|
24
|
+
IO.write(File.join(parent, 'sftp.json'), sftp_node.to_json)
|
24
25
|
end
|
25
26
|
end
|
26
27
|
|
27
|
-
win_node = search(:node, 'platform:windows')
|
28
|
+
win_node = search(:node, 'platform:windows').first
|
29
|
+
pp win_node['ipaddress']
|
28
30
|
ruby_block 'save win attributes' do
|
29
31
|
block do
|
30
32
|
parent = File.join(ENV['TEMP'] || '/tmp', 'kitchen')
|
31
|
-
IO.write(File.join(parent, 'win.json'), win_node
|
33
|
+
IO.write(File.join(parent, 'win.json'), win_node.to_json)
|
32
34
|
end
|
33
35
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: kitchen-chefzero-nodes
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrei Skopenko
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-01-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: test-kitchen
|
@@ -137,7 +137,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
137
137
|
version: '0'
|
138
138
|
requirements: []
|
139
139
|
rubyforge_project:
|
140
|
-
rubygems_version: 2.6.
|
140
|
+
rubygems_version: 2.6.13
|
141
141
|
signing_key:
|
142
142
|
specification_version: 4
|
143
143
|
summary: Test Kitchen provisioner based on chef_zero that generates searchable nodes
|