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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9b948f1d84dee55995cc37b2f36c7c43f8387e7f
4
- data.tar.gz: 52376d60bc6fba4b33a3aec3f8f34ab3d949b08b
3
+ metadata.gz: ecc7d28a6dc812c44bad750c640d88ef70a1d008
4
+ data.tar.gz: 12f8e162414f8c9d8feba3b6b47126ebbd1ff31f
5
5
  SHA512:
6
- metadata.gz: f758fc957e6a78b5c88f787ec877fa09ecc2ee48c2991fa0a3abf731560cd96de4dace044f4d89b8b690c3c911cd9c533d8f5e2fe17b4d21219647eeca3b3ba7
7
- data.tar.gz: 1a7c5d9515708d24304d152324c0a8fb9927b6ed99c847f65cb4c8bc4df10c68d07e102cd43740555b63b4ca0eeb739b6d1b921f09edb1d71cac7473121b4880
6
+ metadata.gz: 457f10d4baf4807b617ca890373c895c14bfcd9a1138c36eb3ed995c39c267e709df2034b82b789c4ae5d33a52e4ee967a50cf2ffc5980f9ecf944e0d2d2b923
7
+ data.tar.gz: c34edb45b38b45408717cf9aba9c8971483e13d664aa3a00486c0e38601dc9f53cc9515cfeba6b0ca9b91f9730d3263ff84bd5eef74be43d455fa53b7a48a406
@@ -1,7 +1,9 @@
1
1
  ---
2
2
  driver:
3
3
  name: vagrant
4
- provider: parallels
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: el6
14
+ - name: el7
13
15
  driver:
14
- box: bento/centos-6.8
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
- - el6
40
+ - el7
39
41
 
40
42
  - name: ssh
41
43
  transport:
@@ -22,7 +22,7 @@ Metrics/AbcSize:
22
22
  Enabled: false
23
23
  PerceivedComplexity:
24
24
  Enabled: false
25
- Style/SpaceBeforeFirstArg:
25
+ Layout/SpaceBeforeFirstArg:
26
26
  Enabled: false
27
27
  Style/ClassAndModuleChildren:
28
28
  Enabled: false
data/Gemfile CHANGED
@@ -17,7 +17,7 @@ end
17
17
 
18
18
  group :kitchen do
19
19
  gem 'chef-dk', '~> 0.10'
20
- gem 'test-kitchen', '~> 1.5'
21
20
  gem 'kitchen-sync', '~> 2.0'
22
21
  gem 'kitchen-vagrant', '~> 0.19'
22
+ gem 'test-kitchen', '~> 1.5'
23
23
  end
data/Rakefile CHANGED
File without changes
@@ -1,4 +1,5 @@
1
1
  # coding: utf-8
2
+
2
3
  lib = File.expand_path('../lib', __FILE__)
3
4
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
5
  require 'kitchen/provisioner/chef_zero_nodes_version'
@@ -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 = Dir.glob("#{provisioner.sandbox_path}/*")
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.4'.freeze
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[0].to_json)
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[0].to_json)
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
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: 2017-01-11 00:00:00.000000000 Z
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.8
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