-
Notifications
You must be signed in to change notification settings - Fork 22
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
Infra Join token Support for Bloxone Ansible v2 #47
base: v2
Are you sure you want to change the base?
Conversation
if not resp.results: | ||
resp.results = [] | ||
|
||
# If result is REVOKED, remove it from the list |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The LIST call returns the "REVOKED" tokens too . This operation has been added to eliminate the revoked tokens
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The UI shows it as well, maybe we don't have to explicitly filter them out here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this is implemented , assertion for idempotency would fail ( see comment below )
plugins/modules/infra_join_token.py
Outdated
- absent | ||
default: present | ||
description: | ||
description: "" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a lot of this description is empty.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added Descriptions
plugins/modules/infra_join_token.py
Outdated
""" # noqa: E501 | ||
|
||
EXAMPLES = r""" | ||
- name: Create a UI Join token |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- name: Create a UI Join token | |
- name: Create a Join Token |
same for the below examples as well
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed UI
keyword from all instances except API Name
plugins/modules/infra_join_token.py
Outdated
tags: | ||
location: "my-location" | ||
|
||
- name: Delete a UI Join token |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it might be better to explicitly state, we are revoking the token, instead of deleting.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
plugins/modules/infra_join_token.py
Outdated
pass # Handled by BloxoneAnsibleModule | ||
|
||
|
||
class UIJoinTokenModule(BloxoneAnsibleModule): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggestion to keep the names matching the module name JoinToken
or InfraJoinToken
class UIJoinTokenModule(BloxoneAnsibleModule): | |
class JoinTokenModule(BloxoneAnsibleModule): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
if not resp.results: | ||
resp.results = [] | ||
|
||
# If result is REVOKED, remove it from the list |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The UI shows it as well, maybe we don't have to explicitly filter them out here.
plugins/modules/infra_join_token.py
Outdated
choices: | ||
- present | ||
- absent |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe the choices here should be present
and revoked
as deletion is not allowed for join tokens.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added
register: join_token | ||
- assert: | ||
that: | ||
- join_token is not changed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we dont filter out the revoked coin tokens , even though the join token would be revoked this , specific assertion would fail as find() function is bound to return the join token and the variable join_token
would be updated accordingly .
So should this assertion be removed ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The find function can return the same join token, which is fine. However a change should not be detected if the join token is found, and is already revoked. That logic needs to be checked.
No description provided.