-
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
Support multiple inventories and --limit
#366
base: master
Are you sure you want to change the base?
Changes from all commits
0dd900d
b2a45de
006e4e8
9ab7961
ce9a7be
3fde08c
93135cb
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -79,7 +79,7 @@ | |
- name: Create a map from dc to its list of nodes | ||
set_fact: | ||
dc_to_node_list: "{{ dc_to_node_list | default({}) | combine( {hostvars[item]['dc']: (dc_to_node_list | default({}))[hostvars[item]['dc']] | default([]) + [item]} ) }}" | ||
loop: "{{ groups['scylla'] }}" | ||
loop: "{{ play_hosts }}" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is bogus! This MUST include all scylla hosts |
||
run_once: true | ||
when: scylla_io_probe_dc_aware|bool | ||
|
||
|
@@ -328,13 +328,13 @@ | |
- name: Start seeders serially | ||
run_once: true | ||
include_tasks: start_one_node.yml | ||
loop: "{{ groups['scylla'] }}" | ||
loop: "{{ play_hosts }}" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same here |
||
when: hostvars[item]['broadcast_address'] in scylla_seeds or item in scylla_seeds | ||
|
||
- name: Start scylla non-seeds nodes serially | ||
run_once: true | ||
include_tasks: start_one_node.yml | ||
loop: "{{ groups['scylla'] }}" | ||
loop: "{{ play_hosts }}" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. And here |
||
when: | ||
- item not in scylla_seeds | ||
- hostvars[item]['broadcast_address'] not in scylla_seeds | ||
|
@@ -345,11 +345,17 @@ | |
host: "{{ scylla_api_address }}" | ||
timeout: 300 | ||
|
||
- name: Create a list with the broadcast addresses of the nodes in play_hosts | ||
set_fact: | ||
broadcast_address_list: "{{ broadcast_address_list | default([]) + [hostvars[item]['broadcast_address']] }}" | ||
loop: "{{ play_hosts }}" | ||
run_once: true | ||
|
||
- name: wait for the cluster to become healthy | ||
shell: | | ||
nodetool status|grep -E '^UN|^UJ|^DN'|wc -l | ||
nodetool status|grep -E '^UN|^UJ|^DN'| grep -Ew "{{ broadcast_address_list | join('|') }}" | wc -l | ||
register: node_count | ||
until: node_count.stdout|int == ansible_play_batch|length | ||
until: node_count.stdout|int == play_hosts|length | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Waiting for the nodes of a specific DC become UN is not enough - we need to wait that other nodes are UN from these nodes perspective too. So you should wait for all (!!) nodes in the cluster to become UN from all nodes perspective. |
||
retries: "{{ scylla_bootstrap_wait_time_sec|int }}" | ||
delay: 1 | ||
when: full_inventory|bool | ||
|
@@ -390,14 +396,26 @@ | |
{% if (_scylla_yaml_map.audit is defined and _scylla_yaml_map.audit == 'table') %}True{% else %}False{% endif %} | ||
run_once: true | ||
|
||
- name: Check if all nodes are up | ||
block: | ||
- name: Check if there are joining or down nodes | ||
shell: | | ||
nodetool status|grep -E '^UJ|^DN' | wc -l | ||
register: node_count | ||
|
||
- name: Set all_nodes_up as a fact | ||
set_fact: | ||
all_nodes_up: "{{ node_count.stdout|int == 0 }}" | ||
run_once: true | ||
|
||
- name: Adjust replication for system_auth keyspace | ||
include_tasks: adjust_keyspace_replication.yml | ||
vars: | ||
_keyspace: "system_auth" | ||
_keyspace_replication_strategy: "{{ system_auth_replication_strategy }}" | ||
_keyspace_rf: "{{ system_auth_rf }}" | ||
when: | ||
- start_scylla_service|bool | ||
- all_nodes_up|bool | ||
- adjust_system_auth_replication is defined and adjust_system_auth_replication|bool | ||
- _authentication_enabled is defined and _authentication_enabled|bool | ||
- system_auth_rf is defined and system_auth_replication_strategy is defined | ||
|
@@ -409,7 +427,7 @@ | |
_keyspace_replication_strategy: "{{ audit_replication_strategy }}" | ||
_keyspace_rf: "{{ audit_rf }}" | ||
when: | ||
- start_scylla_service|bool | ||
- all_nodes_up|bool | ||
- adjust_audit_replication is defined and adjust_audit_replication|bool | ||
- _audit_enabled is defined and _audit_enabled|bool | ||
- audit_rf is defined and audit_replication_strategy is defined | ||
|
@@ -421,7 +439,7 @@ | |
_keyspace_replication_strategy: "{{ system_distributed_replication_strategy }}" | ||
_keyspace_rf: "{{ system_distributed_rf }}" | ||
when: | ||
- start_scylla_service|bool | ||
- all_nodes_up|bool | ||
- adjust_system_distributed_replication is defined and adjust_system_distributed_replication|bool | ||
- system_distributed_rf is defined and system_distributed_replication_strategy is defined | ||
|
||
|
@@ -432,7 +450,7 @@ | |
_keyspace_replication_strategy: "{{ system_traces_replication_strategy }}" | ||
_keyspace_rf: "{{ system_traces_rf }}" | ||
when: | ||
- start_scylla_service|bool | ||
- all_nodes_up|bool | ||
- adjust_system_traces_replication is defined and adjust_system_traces_replication|bool | ||
- system_traces_rf is defined and system_traces_replication_strategy is defined | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
- name: Set password for scylla_admin | ||
set_fact: | ||
scylla_admin_password: "{{ lookup('ini', scylla_admin_username, section='cql_credentials', allow_no_value=true, default=omit, file=iv_file) }}" | ||
inventory_with_credentials: "{{ iv_file }}" | ||
ignore_errors: true |
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.
Again: this is bad - this will work terribly for large clusters.
We need a solution that will execute concurrently on all hosts - not serially.