-
Notifications
You must be signed in to change notification settings - Fork 49
Adding License Testing for Tiered Storage #233
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
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
82911a2
feat: add license to testing
gene-redpanda d0c6260
feat: add license operation
gene-redpanda ba1d725
fix: add changed when: false
gene-redpanda 2787f8f
ci: change concurrency group
gene-redpanda 0a2932a
fix: missing license var
gene-redpanda File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
--- | ||
- name: Apply Redpanda License | ||
hosts: redpanda | ||
become: true | ||
vars: | ||
rpk_bin: rpk | ||
|
||
tasks: | ||
- name: Check cluster health | ||
ansible.builtin.shell: | | ||
{{ rpk_bin }} cluster health | grep -i 'healthy:' | tr -d '[:space:]' | awk -F ':' '{print tolower($2)}' | ||
register: health_check | ||
run_once: true | ||
failed_when: "health_check.stdout != 'true'" | ||
changed_when: false | ||
|
||
- name: Set Redpanda license (string) | ||
ansible.builtin.command: rpk cluster license set {{ redpanda_license }} | ||
run_once: true | ||
changed_when: false | ||
when: | ||
- redpanda_license is defined | ||
|
||
- name: Set Redpanda license (path) | ||
ansible.builtin.command: rpk cluster license set --path {{ redpanda_license_path }} | ||
changed_when: false | ||
run_once: true | ||
when: | ||
- redpanda_license_path is defined | ||
|
||
- name: Check broker status | ||
ansible.builtin.shell: | | ||
{{ rpk_bin }} redpanda admin brokers list | grep -q 'active.*true' | ||
register: broker_status | ||
changed_when: false | ||
failed_when: broker_status.rc != 0 |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Probably better to do something like this and check the return code of grep, rather than trying to parse out the true/false status.
rpk cluster health | grep -q -i 'healthy.*false'
returns 0 if one or more lines matched the regex. returns 1 if zero lines matched.
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.
(though, it would be better if rpk cluster health set a return code of 0 or 1 depending on cluster health state, then we could check the return code directly -- don't think that support exists right now)