-
Notifications
You must be signed in to change notification settings - Fork 39
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
ansible-scylla-node: Use Scylla API for getting existent tokens instead of nodetool ring #308
ansible-scylla-node: Use Scylla API for getting existent tokens instead of nodetool ring #308
Conversation
30289f5
to
7e590b6
Compare
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.
Looks good in general. There are some comments though.
copy: | ||
content: "" | ||
dest: /tmp/tokens_file | ||
delegate_to: localhost |
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.
This won't work well when multiple concurrent instances of the job would be running.
Generate a temp file instead, please.
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.
Done
dest: /tmp/tokens_file | ||
delegate_to: localhost | ||
|
||
- name: Get existent 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.
spelling: s/existent/existing/
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
uri: | ||
url: "http://{{ scylla_api_address }}:{{ scylla_api_port }}/storage_service/tokens/{{ item }}" | ||
method: GET | ||
register: _existent_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.
same 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.
Fixed
1a4ce9c
to
f91ad63
Compare
…during tokens generation This patch changes the role to stop validating that all nodes are in UN state during tokens generation, since the nodes don't have to be up in order for us to be able to retrieve existing tokens and generate the new ones.
…ad of nodetool ring Currently we're using nodetool ring to get the current tokens and iterating over its output in order to create an ansible fact with all the tokens. This might be a problem when using ansible verbose mode since nodetool ring prints one token per line and every time we append a value to the ansible fact the whole fact will be printed resulting in a very big number of lines printed, specially for big clusters. This patch fixes this problem by using the API to get the current tokens and by writing them to a file instead of to an ansible fact.
f91ad63
to
986eb28
Compare
No description provided.