Skip to content
This repository has been archived by the owner on Mar 19, 2022. It is now read-only.

Commit

Permalink
Merge pull request #363 from Domon/ssl-verify-mode
Browse files Browse the repository at this point in the history
Allow ssl_verify_mode to be configured
  • Loading branch information
matschaffer committed Apr 19, 2014
2 parents c8eba8a + 30a7f54 commit e65c5c1
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/chef/knife/solo_cook.rb
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,10 @@ def sync_kitchen
upload_to_provision_path(:environment_path, 'environments')
end

def ssl_verify_mode
Chef::Config[:ssl_verify_mode] || :verify_peer
end

def expand_path(path)
Pathname.new(path).expand_path
end
Expand Down
1 change: 1 addition & 0 deletions lib/knife-solo/resources/solo.rb.erb
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ data_bag_path File.join(base, 'data_bags')
encrypted_data_bag_secret File.join(base, 'data_bag_key')
environment_path File.join(base, 'environments')
environment <%= node_environment.inspect %>
ssl_verify_mode <%= ssl_verify_mode.inspect %>

cookbook_path []
<% cookbook_paths.each_with_index do |path, i| -%>
Expand Down
10 changes: 10 additions & 0 deletions test/solo_cook_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,16 @@ def test_rsync_exclude_sources_chefignore
end
end

def test_sets_ssl_verify_mode_returns_verify_peer_for_nil
Chef::Config[:ssl_verify_mode] = nil
assert_equal :verify_peer, command.ssl_verify_mode
end

def test_sets_ssl_verify_mode
Chef::Config[:ssl_verify_mode] = :verify_none
assert_equal :verify_none, command.ssl_verify_mode
end

def test_expanded_config_paths_returns_empty_array_for_nil
Chef::Config[:foo] = nil
assert_equal [], command.expanded_config_paths(:foo)
Expand Down

0 comments on commit e65c5c1

Please sign in to comment.