You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# /usr/local/lib/python3.9/dist-packages/ansible_collections
Collection Version
---------------- -------
community.crypto 2.0.2
# /usr/share/ansible/collections/ansible_collections
Collection Version
---------------- -------
community.crypto 2.0.2
STEPS TO REPRODUCE
# Generate an OpenSSH host certificate that is valid for 32 weeks from now and will be regenerated# if it is valid for less than 2 weeks from the time the module is being run
- name: Generate an OpenSSH host certificate with valid_from, valid_to and valid_at parameterscommunity.crypto.openssh_cert:
type: hostsigning_key: /path/to/private_keypublic_key: /path/to/public_key.pubpath: /path/to/certificatevalid_from: +0svalid_to: +32wvalid_at: +2w
EXPECTED RESULTS
Only run when cert is invalid in "now + 2w" or some non "valid_*" Parameters changed
ACTUAL RESULTS
This will always regenerate the cert. Probably due to changes in relative valid_from and valid_to.
TASK [ssh_server : Generate an OpenSSH host certificate with valid_from, valid_to and valid_at parameters] ********************************************************************************************************************************************************
changed: [srvans01 -> localhost]
When run with absolute times (e.g. 2022-01-01) on valid_from and valid_to it works like a charm...
Not sure its a bug, a feature request or documentation error. Second example is exactly my intended usecase.
The text was updated successfully, but these errors were encountered:
This is as intended and the module documentation mentions that use of relative timestamps is not idempotent. I guess we could implement a toggle similar to #317 and when ignore_timestamps is true the module would just check valid_at falls between the values from an existing certificate. Then you would be able to enforce a rotation policy.
SUMMARY
valid_at does not behave as expected
ISSUE TYPE
COMPONENT NAME
openssh_cert
ANSIBLE VERSION
COLLECTION VERSION
STEPS TO REPRODUCE
EXPECTED RESULTS
Only run when cert is invalid in "now + 2w" or some non "valid_*" Parameters changed
ACTUAL RESULTS
This will always regenerate the cert. Probably due to changes in relative valid_from and valid_to.
When run with absolute times (e.g. 2022-01-01) on valid_from and valid_to it works like a charm...
Not sure its a bug, a feature request or documentation error. Second example is exactly my intended usecase.
The text was updated successfully, but these errors were encountered: