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

Add diff mode support to hashivault_pki_role and update options list #484

Merged
merged 5 commits into from
Jul 9, 2024

Conversation

dezeroku
Copy link
Contributor

As in the title, allows to run the playbooks with --diff --check combination to see what the changes would be without actually applying them.

While at it also updates the list of supported options, based on Vault API docs.

The tricky part here is that "durations" sent to Vault are required to be strings, while GET responses return integers.
Thus a temporary "view" of the desired state is created to converge on the same format.

Reuses (and moves to module_utils) the parse_duration function originally introduced in 721fd55 . The temporary object is necessary here as Vault API doesn't officially support POSTing integers for this endpoint.

@@ -399,3 +399,22 @@ def is_state_changed(desired_state, current_state, ignore=None):
:rtype: bool
"""
return(len(get_keys_updated(desired_state, current_state)) > 0)

Copy link
Owner

Choose a reason for hiding this comment

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

Thanks for moving this

@TerryHowe
Copy link
Owner

Some lint errors looks like

@dezeroku dezeroku force-pushed the hashivault_pki_role_diff_mode branch from 6a3c188 to 9cd19e8 Compare July 9, 2024 00:42
@TerryHowe TerryHowe merged commit e37b89b into TerryHowe:main Jul 9, 2024
3 checks passed
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