mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
add usage example for the assertonly provider (#34092)
This commit is contained in:
parent
87c98336d6
commit
070ea3270c
1 changed files with 22 additions and 0 deletions
|
@ -218,6 +218,28 @@ EXAMPLES = '''
|
|||
force: True
|
||||
|
||||
# Examples for some checks one could use the assertonly provider for:
|
||||
|
||||
# How to use the assertonly provider to implement and trigger your own custom certificate generation workflow:
|
||||
- name: Check if a certificate is currently still valid, ignoring failures
|
||||
openssl_certificate:
|
||||
path: /etc/ssl/crt/example.com.crt
|
||||
provider: assertonly
|
||||
has_expired: False
|
||||
ignore_errors: True
|
||||
register: validity_check
|
||||
|
||||
- name: Run custom task(s) to get a new, valid certificate in case the initial check failed
|
||||
command: superspecialSSL recreate /etc/ssl/crt/example.com.crt
|
||||
when: validity_check.failed
|
||||
|
||||
- name: Check the new certificate again for validity with the same parameters, this time failing the play if it is still invalid
|
||||
openssl_certificate:
|
||||
path: /etc/ssl/crt/example.com.crt
|
||||
provider: assertonly
|
||||
has_expired: False
|
||||
when: validity_check.failed
|
||||
|
||||
# Some other checks that assertonly could be used for:
|
||||
- name: Verify that an existing certificate was issued by the Let's Encrypt CA and is currently still valid
|
||||
openssl_certificate:
|
||||
path: /etc/ssl/crt/example.com.crt
|
||||
|
|
Loading…
Reference in a new issue