Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

openssh_cert - cleanup and diff support #255

Merged

Conversation

Ajpantuso
Copy link
Collaborator

SUMMARY

Significant cleanup of openssh_cert with added diff support;

ISSUE TYPE
  • Feature Pull Request
COMPONENT NAME

plugins/modules/openssh_cert.py

ADDITIONAL INFORMATION

Changes:

  • Added diff support after integration of OpensshCertificate from module_utils
  • Refactored integration tests and enabled assertions so that idempotency is always checked. (Also added test cases for known idempotency issues to be addressed in a future PR)
  • Time parameters presented in the "validity string" for the -V option will now just use always and forever for arbitrarily large and small dates rather than datetime.min and datetime.max from Python. (No effect to end users as ssh-keygen will behave the same way as when provided out-of-range dates)

Fixes:

  • Used AnsibleModule methods to more consistently setup temp files and preserve permissions.
  • Ensured backup is taken before final move operation to restore if necessary.

@Ajpantuso Ajpantuso changed the title [WIP] openssh_cert - cleanup and diff support openssh_cert - cleanup and diff support Jul 14, 2021
@Ajpantuso Ajpantuso marked this pull request as ready for review July 14, 2021 17:21
Copy link
Contributor

@felixfontein felixfontein left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thanks a lot for working on this!

plugins/module_utils/openssh/certificate.py Outdated Show resolved Hide resolved
plugins/module_utils/openssh/certificate.py Outdated Show resolved Hide resolved
@felixfontein felixfontein merged commit 4908f1a into ansible-collections:main Jul 16, 2021
@felixfontein
Copy link
Contributor

@Ajpantuso thanks for implementing this!

@Ajpantuso
Copy link
Collaborator Author

@Ajpantuso thanks for implementing this!

Thanks for reviewing. The follow-up PR's should be much smaller.

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.

2 participants