Skip to content

Specify the resource provider for ssl_certificate#46

Open
vzDevelopment wants to merge 1 commit into
zuazo:masterfrom
vzDevelopment:add_provider-issue_45
Open

Specify the resource provider for ssl_certificate#46
vzDevelopment wants to merge 1 commit into
zuazo:masterfrom
vzDevelopment:add_provider-issue_45

Conversation

@vzDevelopment

@vzDevelopment vzDevelopment commented Jun 27, 2020

Copy link
Copy Markdown

Description

In Chef 16 HWRP Style Resources now require resource_name / provides (source). Without this, Chef fails to compile and provides the following error:

       NoMethodError
       -------------
       undefined method `ssl_certificate' for cookbook: child-cookbook, recipe: default :Chef::Recipe

This PR sets the provider and stops Chef from crashing.

Issues Resolved

#45

Contribution Check List

  • Do the tests pass
    • The CentOS Kitchen tests (I tried with CentOS 6 as per the current kitchen.yml and also CentOS 7.8 as this is what the ticket was raised for) all pass.
    • The Kitchen tests for the other platforms are failing, but this is because they're using out dated operating systems e.g. the Ubuntu 10.04 tests are getting 404s trying to get package lists. I tried running with Ubuntu 20.04, but the tests need updating because the output of openssl has changed. Unfortunately I've run out of time so haven't been able to fix them, but I can't see any evidence that the change I have made has caused issues.
    • I checked the CentOS kitchen tests work with both Chef 16 and Chef 14
  • New functionality includes testing.
    • Not applicable
  • New functionality has been documented in the README and metadata if applicable.
    • Not applicable

HWRP Style Resources require resource_name / provides in Chef 16. Set
the provider to prevent Chef from crashing with "undefined method
ssl_certificate for cookbook".

Fixes zuazo#45
@riccalioliojr

Copy link
Copy Markdown

Thank you for this, @vzDevelopment! I hope it gets reviewed and merged soon.

@Lasering

Copy link
Copy Markdown

@zuazo this PR is really crucial.

@cgunther

Copy link
Copy Markdown

You may be able to replace your usage of ssl_certificate with openssl_x509_certificate that shipped with Chef Infra Client starting in v14.4. The properties may be named slightly different, but functionally it should serve the same purpose, avoiding this issue with Chef Infra Client v16+.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants