|
| 1 | +--- |
| 2 | +resource_reference: true |
| 3 | +resources_common_guards: true |
| 4 | +resources_common_notification: true |
| 5 | +resources_common_properties: true |
| 6 | +resource: chef_client_hab_ca_cert |
| 7 | +resource_description_list: |
| 8 | +- markdown: Use the **chef_client_hab_ca_cert** resource to add certificates to the |
| 9 | + Habitat Chef Infra Client's CA bundle. This allows Chef Infra Client to communicate |
| 10 | + with internal encrypted resources without errors. To make sure these CA certs |
| 11 | + take effect, configure the `ssl_ca_file` to point to the CA cert file path of |
| 12 | + the `core/cacerts` Habitat package. |
| 13 | +resource_new_in: '19.1' |
| 14 | +syntax_full_code_block: |- |
| 15 | + chef_client_hab_ca_cert 'name' do |
| 16 | + cert_name String # default value: 'name' unless specified |
| 17 | + certificate String |
| 18 | + action Symbol # defaults to :add if not specified |
| 19 | + end |
| 20 | +syntax_properties_list: |
| 21 | +syntax_full_properties_list: |
| 22 | +- "`chef_client_hab_ca_cert` is the resource." |
| 23 | +- "`name` is the name given to the resource block." |
| 24 | +- "`action` identifies which steps Chef Infra Client will take to bring the node into |
| 25 | + the desired state." |
| 26 | +- "`cert_name` and `certificate` are the properties available to this resource." |
| 27 | +actions_list: |
| 28 | + :nothing: |
| 29 | + shortcode: resources_common_actions_nothing.md |
| 30 | + :add: |
| 31 | + markdown: Add a local certificate to the Habitat Chef Infra Client's CA bundle. |
| 32 | + (default) |
| 33 | +properties_list: |
| 34 | +- property: cert_name |
| 35 | + ruby_type: String |
| 36 | + required: false |
| 37 | + default_value: The resource block's name |
| 38 | + description_list: |
| 39 | + - markdown: The name to use for the certificate. If not provided, the name of the |
| 40 | + resource block will be used instead. |
| 41 | +- property: certificate |
| 42 | + ruby_type: String |
| 43 | + required: true |
| 44 | + description_list: |
| 45 | + - markdown: The text of the certificate file including the BEGIN/END comment lines. |
| 46 | +examples: | |
| 47 | + **Trust a self-signed certificate**: |
| 48 | +
|
| 49 | + ```ruby |
| 50 | + chef_client_hab_ca_cert 'self-signed.badssl.com' do |
| 51 | + certificate <<~CERT |
| 52 | + -----BEGIN CERTIFICATE----- |
| 53 | + MIIDeTCCAmGgAwIBAgIJAPziuikCTox4MA0GCSqGSIb3DQEBCwUAMGIxCzAJBgNV |
| 54 | + BAYTAlVTMRMwEQYDVQQIDApDYWxpZm9ybmlhMRYwFAYDVQQHDA1TYW4gRnJhbmNp |
| 55 | + c2NvMQ8wDQYDVQQKDAZCYWRTU0wxFTATBgNVBAMMDCouYmFkc3NsLmNvbTAeFw0x |
| 56 | + OTEwMDkyMzQxNTJaFw0yMTEwMDgyMzQxNTJaMGIxCzAJBgNVBAYTAlVTMRMwEQYD |
| 57 | + VQQIDApDYWxpZm9ybmlhMRYwFAYDVQQHDA1TYW4gRnJhbmNpc2NvMQ8wDQYDVQQK |
| 58 | + DAZCYWRTU0wxFTATBgNVBAMMDCouYmFkc3NsLmNvbTCCASIwDQYJKoZIhvcNAQEB |
| 59 | + BQADggEPADCCAQoCggEBAMIE7PiM7gTCs9hQ1XBYzJMY61yoaEmwIrX5lZ6xKyx2 |
| 60 | + PmzAS2BMTOqytMAPgLaw+XLJhgL5XEFdEyt/ccRLvOmULlA3pmccYYz2QULFRtMW |
| 61 | + hyefdOsKnRFSJiFzbIRMeVXk0WvoBj1IFVKtsyjbqv9u/2CVSndrOfEk0TG23U3A |
| 62 | + xPxTuW1CrbV8/q71FdIzSOciccfCFHpsKOo3St/qbLVytH5aohbcabFXRNsKEqve |
| 63 | + ww9HdFxBIuGa+RuT5q0iBikusbpJHAwnnqP7i/dAcgCskgjZjFeEU4EFy+b+a1SY |
| 64 | + QCeFxxC7c3DvaRhBB0VVfPlkPz0sw6l865MaTIbRyoUCAwEAAaMyMDAwCQYDVR0T |
| 65 | + BAIwADAjBgNVHREEHDAaggwqLmJhZHNzbC5jb22CCmJhZHNzbC5jb20wDQYJKoZI |
| 66 | + hvcNAQELBQADggEBAGlwCdbPxflZfYOaukZGCaxYK6gpincX4Lla4Ui2WdeQxE95 |
| 67 | + w7fChXvP3YkE3UYUE7mupZ0eg4ZILr/A0e7JQDsgIu/SRTUE0domCKgPZ8v99k3A |
| 68 | + vka4LpLK51jHJJK7EFgo3ca2nldd97GM0MU41xHFk8qaK1tWJkfrrfcGwDJ4GQPI |
| 69 | + iLlm6i0yHq1Qg1RypAXJy5dTlRXlCLd8ufWhhiwW0W75Va5AEnJuqpQrKwl3KQVe |
| 70 | + wGj67WWRgLfSr+4QG1mNvCZb2CkjZWmxkGPuoP40/y7Yu5OFqxP5tAjj4YixCYTW |
| 71 | + EVA0pmzIzgBg+JIe3PdRy27T0asgQW/F4TY61Yk= |
| 72 | + -----END CERTIFICATE----- |
| 73 | + CERT |
| 74 | + end |
| 75 | + ``` |
0 commit comments