From c491799f6f6034f09455b7bfb92763acdcc6739b Mon Sep 17 00:00:00 2001 From: Jonas L Date: Mon, 30 Oct 2023 17:30:49 +0100 Subject: [PATCH] docs: fix certificates module options and examples (#377) ##### SUMMARY Closes #374 Closes #375 ##### ISSUE TYPE - Docs Pull Request ##### COMPONENT NAME hcloud_certificates --- plugins/modules/hcloud_certificate.py | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/plugins/modules/hcloud_certificate.py b/plugins/modules/hcloud_certificate.py index 1d001b81..685b4299 100644 --- a/plugins/modules/hcloud_certificate.py +++ b/plugins/modules/hcloud_certificate.py @@ -35,17 +35,17 @@ certificate: description: - Certificate and chain in PEM format, in order so that each record directly certifies the one preceding. - - Required if certificate does not exist. + - Required if certificate does not exist and I(type=uploaded). type: str private_key: description: - Certificate key in PEM format. - - Required if certificate does not exist. + - Required if certificate does not exist and I(type=uploaded). type: str domain_names: description: - - Certificate key in PEM format. - - Required if certificate does not exist. + - Domains and subdomains that should be contained in the Certificate issued by Let's Encrypt. + - Required if I(type=managed). type: list default: [ ] elements: str @@ -70,20 +70,29 @@ - name: Create a basic certificate hetzner.hcloud.hcloud_certificate: name: my-certificate - certificate: ssh-rsa AAAjjk76kgf...Xt - private_key: ssh-rsa AAAjjk76kgf...Xt + certificate: -----BEGIN CERTIFICATE-----... + private_key: -----BEGIN PRIVATE KEY-----... state: present - name: Create a certificate with labels hetzner.hcloud.hcloud_certificate: name: my-certificate - certificate: ssh-rsa AAAjjk76kgf...Xt - private_key: ssh-rsa AAAjjk76kgf...Xt + certificate: -----BEGIN CERTIFICATE-----... + private_key: -----BEGIN PRIVATE KEY-----... labels: key: value mylabel: 123 state: present +- name: Create a managed certificate + hetzner.hcloud.hcloud_certificate: + name: my-certificate + type: managed + domain_names: + - example.com + - www.example.com + state: present + - name: Ensure the certificate is absent (remove if needed) hetzner.hcloud.hcloud_certificate: name: my-certificate