schubergphilis / chef-acme

Chef cookbook to request SSL certificates at Let's Encrypt
Apache License 2.0
112 stars 74 forks source link

Undefined method "acme_ssl_certificate" #81

Closed dbudwin closed 7 years ago

dbudwin commented 7 years ago

I noticed a discrepancy between the README here on GitHub and the README on https://supermarket.chef.io/cookbooks/acme.

I want to create a certificate to use on my Nginx server using acme_ssl_certificate. But when I try to use the acme_ssl_certificate resource in my recipe I get the following error when I run kitchen converge:

       Recipe: acme::default
         * chef_gem[acme-client] action install (up to date)

         ================================================================================
         Recipe Compile Error in /tmp/kitchen/cache/cookbooks/LEMPChefCookbook/recipes/default.rb
         ================================================================================

         NoMethodError
         -------------
         undefined method `acme_ssl_certificate' for cookbook: LEMPChefCookbook, recipe: default :Chef::Recipe

         Cookbook Trace:
         ---------------
           /tmp/kitchen/cache/cookbooks/LEMPChefCookbook/recipes/default.rb:27:in `from_file'

         Relevant File Content:
         ----------------------
         /tmp/kitchen/cache/cookbooks/LEMPChefCookbook/recipes/default.rb:

          20:  include_recipe 'LEMPChefCookbook::nginx'
          21:  include_recipe 'acme::default'
          22:
          23:  secrets = Chef::EncryptedDataBagItem.load('secrets', 'secrets')
          24:
          25:  node.default['acme']['contact'] = [secrets['acme_contact']]
          26:
          27>> acme_ssl_certificate '/etc/ssl/budw.in.crt' do
          28:    cn 'budw.in'
          29:    output :fullchain
          30:    key '/etc/ssl/private/budw.in.key.pem'
          31:    min_validity 30
          32:    webserver :nginx
          33:  end
          34:
          35:  include_recipe 'composer::default'
          36:

         System Info:
         ------------
         chef_version=13.1.31
         platform=ubuntu
         platform_version=16.04
         ruby=ruby 2.4.1p111 (2017-03-22 revision 58053) [x86_64-linux]
         program_name=chef-client worker: ppid=3020;start=23:09:46;
         executable=/opt/chef/bin/chef-client

         Running handlers:
       [2017-06-16T23:09:52+00:00] ERROR: Running exception handlers
       [2017-06-16T23:09:52+00:00] ERROR: Running exception handlers
         Running handlers complete
       [2017-06-16T23:09:52+00:00] ERROR: Exception handlers complete
       [2017-06-16T23:09:52+00:00] ERROR: Exception handlers complete
         Chef Client failed. 2 resources updated in 05 seconds
       [2017-06-16T23:09:52+00:00] FATAL: Stacktrace dumped to /tmp/kitchen/cache/chef-stacktrace.out
       [2017-06-16T23:09:52+00:00] FATAL: Stacktrace dumped to /tmp/kitchen/cache/chef-stacktrace.out
       [2017-06-16T23:09:52+00:00] FATAL: Please provide the contents of the stacktrace.out file if you file a bug report
       [2017-06-16T23:09:52+00:00] FATAL: Please provide the contents of the stacktrace.out file if you file a bug report
       [2017-06-16T23:09:52+00:00] ERROR: undefined method `acme_ssl_certificate' for cookbook: LEMPChefCookbook, recipe: default :Chef::Recipe
       [2017-06-16T23:09:52+00:00] ERROR: undefined method `acme_ssl_certificate' for cookbook: LEMPChefCookbook, recipe: default :Chef::Recipe
       [2017-06-16T23:09:52+00:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)
       [2017-06-16T23:09:52+00:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)
>>>>>> ------Exception-------
>>>>>> Class: Kitchen::ActionFailed
>>>>>> Message: 1 actions failed.
>>>>>>     Converge failed on instance <default-ubuntu-1604>.  Please see .kitchen/logs/default-ubuntu-1604.log for more details
>>>>>> ----------------------
>>>>>> Please see .kitchen/logs/kitchen.log for more details
>>>>>> Also try running `kitchen diagnose --all` for configuration
dbudwin commented 7 years ago

It appears that this functionality was added since v3.0.0 was published on the Super Market: https://github.com/schubergphilis/chef-acme/commit/eefe9e61759ebd0a9e923961cf6b57cbb5e4222e

Is it possible to create a new version please :)

infertux commented 7 years ago

Same problem here. As a temporary workaround, you can add cookbook "acme", github: "schubergphilis/chef-acme", branch: "master" in your Policyfile :)

thoutenbos commented 7 years ago

Version 3.1.0 was just released to the supermarket 👍