From 15fcc2fa87f7372f88d8b5e5101548c282d482f2 Mon Sep 17 00:00:00 2001 From: Maxim Pogozhiy Date: Thu, 18 Aug 2016 16:32:37 +0300 Subject: [PATCH 1/2] Add logging in certificate response --- metadata.rb | 2 +- resources/gencert.rb | 12 ++++++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/metadata.rb b/metadata.rb index 46540b3..297c6ed 100644 --- a/metadata.rb +++ b/metadata.rb @@ -4,7 +4,7 @@ license 'LGPLv3' description 'Installs/Configures cfssl' long_description 'Installs/Configures cfssl' -version '0.2.5' +version '0.2.6' issues_url 'https://github.com/onetwotrip/chef-cfssl/issues' source_url 'https://github.com/onetwotrip/chef-cfssl' diff --git a/resources/gencert.rb b/resources/gencert.rb index 09b8c10..5a47db4 100644 --- a/resources/gencert.rb +++ b/resources/gencert.rb @@ -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 From f84e86a7b88b9b1c4b0e57960ab1b980c2bffb99 Mon Sep 17 00:00:00 2001 From: Maxim Pogozhiy Date: Thu, 22 Sep 2016 17:02:40 +0300 Subject: [PATCH 2/2] CFSSL without apt cookbook. --- .kitchen.yml | 2 -- Berksfile | 1 - metadata.rb | 3 +-- 3 files changed, 1 insertion(+), 5 deletions(-) diff --git a/.kitchen.yml b/.kitchen.yml index 28f7ca1..e094bd0 100644 --- a/.kitchen.yml +++ b/.kitchen.yml @@ -14,7 +14,6 @@ verifier: suites: - name: default run_list: - - recipe[apt] - recipe[cfssl::server] - recipe[cfssl::client] attributes: @@ -59,7 +58,6 @@ suites: - name: noauth run_list: - - recipe[apt] - recipe[cfssl::server] - recipe[cfssl::client] attributes: diff --git a/Berksfile b/Berksfile index 49eba8e..d31c1be 100644 --- a/Berksfile +++ b/Berksfile @@ -2,5 +2,4 @@ source 'https://supermarket.getchef.com' metadata -cookbook 'apt' cookbook 'runit' diff --git a/metadata.rb b/metadata.rb index 297c6ed..0321e98 100644 --- a/metadata.rb +++ b/metadata.rb @@ -4,7 +4,7 @@ license 'LGPLv3' description 'Installs/Configures cfssl' long_description 'Installs/Configures cfssl' -version '0.2.6' +version '0.2.7' issues_url 'https://github.com/onetwotrip/chef-cfssl/issues' source_url 'https://github.com/onetwotrip/chef-cfssl' @@ -12,6 +12,5 @@ chef_version '>= 12.5' if respond_to?(:chef_version) supports 'ubuntu' -depends 'apt' depends 'runit' depends 'compat_resource'