Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add logging in certificate response #6

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions .kitchen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ verifier:
suites:
- name: default
run_list:
- recipe[apt]
- recipe[cfssl::server]
- recipe[cfssl::client]
attributes:
Expand Down Expand Up @@ -59,7 +58,6 @@ suites:

- name: noauth
run_list:
- recipe[apt]
- recipe[cfssl::server]
- recipe[cfssl::client]
attributes:
Expand Down
1 change: 0 additions & 1 deletion Berksfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,4 @@ source 'https://supermarket.getchef.com'

metadata

cookbook 'apt'
cookbook 'runit'
3 changes: 1 addition & 2 deletions metadata.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,13 @@
license 'LGPLv3'
description 'Installs/Configures cfssl'
long_description 'Installs/Configures cfssl'
version '0.2.5'
version '0.2.7'

issues_url 'https://github.com/onetwotrip/chef-cfssl/issues'
source_url 'https://github.com/onetwotrip/chef-cfssl'

chef_version '>= 12.5' if respond_to?(:chef_version)
supports 'ubuntu'

depends 'apt'
depends 'runit'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WTF?
recipes/install.rb used apt_repository

depends 'compat_resource'
12 changes: 10 additions & 2 deletions resources/gencert.rb
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,16 @@

def cert
uri = make_uri(sign_method)
@cert ||= cfssl_request(uri, body)['result']['certificate'].chomp ||
Chef::Log.error("Unable to get cert from #{uri}")
response = cfssl_request(uri, body)
if response['errors'].size > 0
response.errors.each do |error|
Chef::Log.error("Response error: #{error}")
end
Chef::Log.error("Uri: #{uri}")
Chef::Log.error("Body: #{body}")
raise
end
@cert = response['result']['certificate'].chomp
end

def ca
Expand Down